Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Michael Snyder <msnyder@cygnus.com>
Cc: gdb-patches@sources.redhat.com, jimb@redhat.com
Subject: Re: symtab.c change breaks assembly lang debugging
Date: Wed, 07 Nov 2001 08:02:00 -0000	[thread overview]
Message-ID: <20011116171933.A32310@nevyn.them.org> (raw)
In-Reply-To: <3BF58D22.6CA0AFF9@cygnus.com>

On Fri, Nov 16, 2001 at 02:03:14PM -0800, Michael Snyder wrote:
> Daniel Jacobowitz wrote:
> > 
> > On Fri, Nov 16, 2001 at 12:15:07PM -0800, Michael Snyder wrote:
> > >
> > > Jim,
> > >
> > > I presume the change below was meant as an optimization, but it's
> > > based on a false assumption -- that you can't have line numbers
> > > if you don't have block symbols.  That premise is untrue if you
> > > are debugging assembly language source, where the assembler emits
> > > line syms but not block syms.  This change breaks the test case
> > > for assembly source debugging, gdb.asm/asm-source.exp.
> > >
> > > You would not have noticed, because that test only works on a few
> > > targets right now (d10v being one of them).
> > >
> > >       Patch from Peter Schauer:
> > >
> > >       * symtab.c (find_pc_sect_line): If we can't find the function
> > >       containing PC, we certainly won't have line number information for
> > >       that location, so return zero immediately.
> > 
> > <sigh>
> > 
> > OK, I should have thought of that.  The problem is that this almost
> > always indicates a lack of debugging information, and GDB historically
> > copes very badly with not having any debugging information available.
> > Aside from Jim's address range cleanups, which are certainly a good
> > solution for the cases they can handle, I don't know what to do about
> > this.
> 
> What need are you trying to address?  Is it, as I surmised, an optimization?
> And if so, can we take it out until we think of a better way to do it?

No, it isn't an optimization.  It was meant to be a sanity check.

In the presence of stabs, and multiple code sections, the address
ranges for a symtab become invalid.  Suppose that you have libstdc++
with stabs, and a program with no debug info.  Suppose you try to
breakpoint at main.  Libstdc++'s objects have a start address before
main, because it is linked first, but the code is not in that location. 
It's up in the linkonce sections, after main, because *(.text) is first
in the linker script.

We call find_pc_sect_line, and it tells us that the "line" for main is
in libstdc++.  So the breakpoint gets set at the beginning of that
"line" - in libstdc++!  Not useful.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


      reply	other threads:[~2001-11-16 22:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-07  4:59 Michael Snyder
2001-11-07  6:24 ` Daniel Jacobowitz
2001-11-07  7:59   ` Michael Snyder
2001-11-07  8:02     ` Daniel Jacobowitz [this message]

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=20011116171933.A32310@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@redhat.com \
    --cc=msnyder@cygnus.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