Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@redhat.com>
To: david carlton <carlton@math.stanford.edu>
Cc: gdb-patches@sources.redhat.com
Subject: Re: gdbinit.in
Date: Fri, 26 Jul 2002 11:17:00 -0000	[thread overview]
Message-ID: <np3cu6s91g.fsf@zwingli.cygnus.com> (raw)
In-Reply-To: <15680.37429.703834.710341@jackfruit.Stanford.EDU>


david carlton <carlton@math.stanford.edu> writes:
> When debugging GDB, if I'm looking at a function in corefile.c, it
> finds the one in bfd/corefile.c rather than the one in gdb/corefile.c.
> This is because, in the .gdbinit that is created in the gdb directory,
> the 'dir ./../bfd' command comes later than the 'dir .' command.  This
> seems to me to be undesirable behavior; the accompanying patch to
> gdbinit.in changes that.
> 
> I've moved both 'dir @srcdir@' and 'dir .' to the end of the dir
> list.  Certainly I want 'dir @srccdir@' to be towards the end.  I
> don't really have a strong opinion about where 'dir .' should be
> - honestly, it's not entirely clear to me why it's there at all.
> (@srcdir@ is . when I'm configuring this, so I don't see the
> difference.)

The directory list maintained by the `dir' command only helps GDB find
source files for code listings.  It doesn't affect the order in which
GDB searches the symtabs for a source file of a given name.  In the
example below, note that, no matter how I have my dir list set up, I
always get the breakpoint in BFD.

$ cat .gdbinit
echo Setting up the environment for debugging gdb.\n

set complaints 1

b internal_error

b info_command
commands
        silent
        return
end

dir /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb
dir .
dir /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/../mmalloc
dir /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/../libiberty
dir /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/../bfd
set prompt (top-gdb) 
$ gdb -nw gdb
GNU gdb 2002-07-16-cvs
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Setting up the environment for debugging gdb.
Breakpoint 1 at 0x80f5e74: file /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/utils.c, line 747.
Breakpoint 2 at 0x8176e08: file /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/cli/cli-cmds.c, line 184.
(top-gdb) break corefile.c:68
Breakpoint 3 at 0x81809a0: file /home/jimb/cygnus/src/sourceware/gdb/main/src/bfd/corefile.c, line 68.
(top-gdb) $ 
$ cat .gdbinit
echo Setting up the environment for debugging gdb.\n

set complaints 1

b internal_error

b info_command
commands
        silent
        return
end

dir /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/../mmalloc
dir /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/../libiberty
dir /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/../bfd
dir /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb
dir .
set prompt (top-gdb) 
$ gdb -nw gdb
GNU gdb 2002-07-16-cvs
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Setting up the environment for debugging gdb.
Breakpoint 1 at 0x80f5e74: file /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/utils.c, line 747.
Breakpoint 2 at 0x8176e08: file /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/cli/cli-cmds.c, line 184.
(top-gdb) break corefile.c:68
Breakpoint 3 at 0x81809a0: file /home/jimb/cygnus/src/sourceware/gdb/main/src/bfd/corefile.c, line 68.
(top-gdb) 

I'm not sure how to solve the actual problem you're seeing.  Does it
work to use an absolute path?


  reply	other threads:[~2002-07-26 17:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-25 17:41 gdbinit.in david carlton
2002-07-26 11:17 ` Jim Blandy [this message]
2002-07-26 14:30   ` gdbinit.in david carlton
2002-07-30  5:27     ` gdbinit.in Jim Blandy

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=np3cu6s91g.fsf@zwingli.cygnus.com \
    --to=jimb@redhat.com \
    --cc=carlton@math.stanford.edu \
    --cc=gdb-patches@sources.redhat.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