public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: David Carlton <carlton@math.stanford.edu>
To: Brian Ford <ford@vss.fsi.com>
Cc: gdb@sources.redhat.com
Subject: Re: DWARF2 PE/COFF port and parsing ?
Date: Tue, 20 May 2003 21:34:00 -0000	[thread overview]
Message-ID: <ro17k8le1zx.fsf@jackfruit.Stanford.EDU> (raw)
In-Reply-To: <Pine.GSO.4.44.0305201603440.22269-100000@eos>

On Tue, 20 May 2003 16:14:32 -0500 (CDT), Brian Ford <ford@vss.fsi.com> said:

> I'm still slowly trying to add DWARF2 support for PE/COFF targets.  I have
> the following problem that confuses me and I was hoping for some expert
> guidance about how to proceed.  gdb's symbol table code is completely
> foreign to me.

> If I load an executable into gdb that contains one object file with DWARF2
> information (all the rest stabs), I get a segfault here:

> 1431              if (!do_linear_search
> 1432                  && (SYMBOL_LANGUAGE (*center) == language_java))
> 1433                {
> 1434                  do_linear_search = 1;
> 1435                }

The above code really should be deleted from the function in question,
but never mind that; at least it's being a useful canary in the coal
mine.

> (gdb) p *center
> $1 = (struct partial_symbol *) 0x20

That's bad: 0x20 doesn't look like an address.  So the partial symbol
table in question is screwed up.  Unfortunately, by the time you hit
this bug, we've long since built the partial symbol tables.

For an example of building a partial symbol table, see
dwarf2read.c:dwarf2_build_psymtabs_hard.  It gets created with
start_psymtab_common, then some fields get set, then a function gets
called (scan_partial_symbols, in this case) that eventually translates
into a bunch of calls to add_psymbol_to_list to add the actual partial
symbols, then the number of global and static symbols get set, then
sort_pst_symbols gets called.  From your symptoms, maybe the number of
global and/or static symbols got set wrong (or not at all) somewhere.

What does "p *pst" say?  Unfortunately, the bug may have occurred when
another psymtab was being generated: all the psymtabs within one
objfile share one data structure, so an error when generating one
psymtab may corrupt another psymtab's data.  (Sigh.  Partial symbol
tables are a mess.)

If this doesn't help, maybe you could give some more details about
exactly how you've been tinkering with the readers.

David Carlton
carlton@math.stanford.edu

  reply	other threads:[~2003-05-20 21:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-20 21:15 Brian Ford
2003-05-20 21:34 ` David Carlton [this message]
2003-05-20 21:57   ` Brian Ford
2003-05-20 22:05     ` Brian Ford
2003-05-20 22:45       ` David Carlton
2003-05-20 22:17     ` David Carlton
     [not found] <Pine.GSO.4.44.0305201745440.22269-100000@eos>
2003-05-20 23:09 ` Brian Ford
     [not found] <vt2el2st5tj.fsf@zenia.red-bean.com>
2003-05-21 21:11 ` Brian Ford

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=ro17k8le1zx.fsf@jackfruit.Stanford.EDU \
    --to=carlton@math.stanford.edu \
    --cc=ford@vss.fsi.com \
    --cc=gdb@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).