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

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.

> Does it mean that glibc was compiled with debugging information on 
> this Redhat system? And gdb complains because it cannot find the 
> source code?

Yes, it looks like that is happening.  Your gdb mentions the
source file name and line number for the glibc function,
which means that the source file name must be in glibc.

> If this is the case, then I would obtain the behavior I am used to 
> as soon as I use a version of glibc which was compiled without 
> debugging information, no? Could I just strip the library?

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.

The solution to your problem might be as easy as taking
"/usr/lib/debug" out of LD_LIBRARY_PATH.

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

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.

> One last question: once I enter a function, say, strcmp(), is finish 
> the correct command to jump out of the function?

Yes.

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.

Hope this helps,

Michael C

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-21 14:19 Michael Elizabeth Chastain [this message]
2003-10-21 14:56 ` Marc Gonzalez-Sigler
  -- 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=200310211419.h9LEJluk018502@duracef.shout.net \
    --to=mec@shout.net \
    --cc=gdb@sources.redhat.com \
    --cc=marc.gonzalez-sigler@inria.fr \
    /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).