public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Christian Biesinger <cbiesinger@google.com>
To: Mahmood Naderan <nt_mahmood@yahoo.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Running GDB with args and variables
Date: Mon, 30 Aug 2021 11:56:01 -0400	[thread overview]
Message-ID: <CAPTJ0XH2Q1Fc-DQuSdpa-PBWZvkzy6BgZvzmxbXtpt9X4EdBgA@mail.gmail.com> (raw)
In-Reply-To: <1367979679.9898.1630088891149@mail.yahoo.com>

On Fri, Aug 27, 2021 at 2:29 PM Mahmood Naderan via Gdb
<gdb@sourceware.org> 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

  reply	other threads:[~2021-08-30 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1367979679.9898.1630088891149.ref@mail.yahoo.com>
2021-08-27 18:28 ` Mahmood Naderan
2021-08-30 15:56   ` Christian Biesinger [this message]
2021-08-30 16:13     ` Luke Drummond
2021-08-30 17:18       ` Mahmood Naderan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPTJ0XH2Q1Fc-DQuSdpa-PBWZvkzy6BgZvzmxbXtpt9X4EdBgA@mail.gmail.com \
    --to=cbiesinger@google.com \
    --cc=gdb@sourceware.org \
    --cc=nt_mahmood@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).