From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by sourceware.org (Postfix) with ESMTPS id 52AA1385841C for ; Mon, 30 Aug 2021 15:56:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 52AA1385841C Received: by mail-qv1-xf36.google.com with SMTP id s16so6711128qvt.13 for ; Mon, 30 Aug 2021 08:56:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WwIKdRG22Id+z822y1qPVbt72fa98F4ZPgkFiilSXnw=; b=BhHwfZcMORqMQKth+zZxMCBIXxC4zGnuHQCeFXOGafkA1rlGr92JWvpPd7oJTi/YYH qTMQ5m3EMJDHtFbCVwI6+jy98tEKsqoXkRen6RTlV/BkxnaVUjYNqCxOaCbukGuKre6C 3xsP2FZ+ddnq2w6LK8nnmN/CaH9q9Mecnue2F2M3/8USy/+pDQl7Hnn61PA/+OLby/kz JmVTPrjhATu81iSsf+VreOc6Tk2+GHtFV1yJ+10NLoHl6loIvNNlGV03y5mBq9Jz/xKn WLK+j9dCnV+VJgG0rqmU/9qauTgG+39WigzcO1GADwk7PrXE5Gp3MMg6t+8Kes9rwK7J jpcQ== X-Gm-Message-State: AOAM532SY9Fwg6YHbk+JfD4y/Wik5H6nELt3wm+e1AqlFGzB399lshXs Y0mcSYGMy9xDXIBUNq3b5GAhCZqfaB5PR5hZDBFy/Vq15EY= X-Google-Smtp-Source: ABdhPJzO5QVe8JE6CFFuF+NisBCbBrWdxRInESeCJ+hK8Uc6IG4R9uhFCjjkVEQ727jyrt17OAWdK3VafaYDtp0jmPs= X-Received: by 2002:ad4:5247:: with SMTP id s7mr23822913qvq.58.1630338998722; Mon, 30 Aug 2021 08:56:38 -0700 (PDT) MIME-Version: 1.0 References: <1367979679.9898.1630088891149.ref@mail.yahoo.com> <1367979679.9898.1630088891149@mail.yahoo.com> In-Reply-To: <1367979679.9898.1630088891149@mail.yahoo.com> From: Christian Biesinger Date: Mon, 30 Aug 2021 11:56:01 -0400 Message-ID: Subject: Re: Running GDB with args and variables To: Mahmood Naderan Cc: "gdb@sourceware.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-18.5 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Aug 2021 15:56:49 -0000 On Fri, Aug 27, 2021 at 2:29 PM Mahmood Naderan via Gdb wrote: > I use the following command to run a program > > $ LD_PRELOAD=/home/mahmood/foo.so /home/mahmood/program/run /home/mahmood/p2/bin/p2 -config t.txt > > Now I want to use 'gdb --args' but the following command doesn't work. > > > $ gdb --args LD_PRELOAD=/home/mahmood/foo.so /home/mahmood/program/run /home/mahmood/p2/bin/p2 -config t.txt > ... > > For help, type "help". > Type "apropos word" to search for commands related to "word"... > LD_PRELOAD=/home/mahmood/foo.so: No such file or directory. > (gdb) > > > > > The "No such file" error is weird because the file exists when I run 'ls' command. > > Any idea about that? I would think the error comes from the fact that gdb is looking for a file called "LD_PRELOAD=..." and there is no such file. Maybe try: gdb --args env LD_PRELOAD=... foo Christian