public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Marc Gonzalez-Sigler <marc.gonzalez-sigler@inria.fr>
To: Michael Elizabeth Chastain <mec@shout.net>
Cc: gdb@sources.redhat.com
Subject: Re: gdb steps into glibc functions
Date: Tue, 21 Oct 2003 14:56:00 -0000	[thread overview]
Message-ID: <3F954934.7080107@inria.fr> (raw)
In-Reply-To: <200310211419.h9LEJluk018502@duracef.shout.net>

Hi,

First of all, I thank you and Daniel for answering my question. 
Daniel's suggestion to set auto-solib-add to 0 proved very useful.

Michael Elizabeth Chastain wrote:
> Hello,
> 
> 
>>GNU gdb 5.0rh-5 Red Hat Linux 7.1
> 
> 
> That is a very old gdb, and a very old Red Hat Linux, too.
> 
> The current releases are: gdb 6.0 and Red Hat Linux 9.

Unfortunately, I have no control over this.

> Look at the value of the environment variable LD_LIBRARY_PATH.
> In particular, see if there is a "/usr/lib/debug" in there.
> Red Hat ships the normal non-debug version of glibc in /lib,
> and the debugging version in /usr/lib/debug.  I don't know if
> it was that way back in 7.1, but it likely was.

$ echo $LD_LIBRARY_PATH
/usr/lib:/orc-2.1/usr/ia64-orc-linux/lib/gcc-lib/ia64-orc-linux/2.1

$ ls /usr/lib/debug
ls: /usr/lib/debug: No such file or directory

> Also try "ldd program" on your program and see how the glibc
> reference is getting resolved.

$ ldd /orc-2.1/usr/ia64-orc-linux/bin/ir_b2a
	libm.so.6 => /lib/libm.so.6 (0x40028000)
	libc.so.6 => /lib/libc.so.6 (0x4004a000)
	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

$ ls -l /lib/libc.*
lrwxrwxrwx    1 root     root           13 Mar 13  2002 
/lib/libc.so.6 -> libc-2.2.4.so

$ ls -l /lib/libc-2.2.4.so
-rwxr-xr-x    1 root     root      5723311 Dec  8  2001 
/lib/libc-2.2.4.so

> You can probably strip the library with "strip --strip-debug"
> but it's tricky to do *anything* to glibc on a running system,
> because all the processes on the system have mmap'ed that file.
> If you could boot from a CD-ROM then it would be safer to modify
> glibc.  And for your sake, make a backup of the original glibc in
> another directory before you touch glibc.

I think I will stick with Daniel's solution :-)

> Also, use "next" instead of "step".  "next" always skips over the
> function.  That would give you the behavior you want, without having
> to change anything.

Not really. I do want to step into my code, not the glibc code.

Marc

  reply	other threads:[~2003-10-21 14:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-21 14:19 Michael Elizabeth Chastain
2003-10-21 14:56 ` Marc Gonzalez-Sigler [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-10-21 15:40 Michael Elizabeth Chastain
2003-10-21 10:48 Marc Gonzalez-Sigler
2003-10-21 12:52 ` Daniel Jacobowitz

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=3F954934.7080107@inria.fr \
    --to=marc.gonzalez-sigler@inria.fr \
    --cc=gdb@sources.redhat.com \
    --cc=mec@shout.net \
    /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).