public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: daniel.van.gerpen@philips.com
To: gdb@sources.redhat.com
Subject: dwarfread / multiple compilation units
Date: Fri, 25 Jul 2003 22:42:00 -0000	[thread overview]
Message-ID: <OF3315700C.141D20E4-ONC1256D6E.0070E01C-41256D6E.00767415@diamond.philips.com> (raw)

Hi,

I stumbled onto several problems using the Gnu Debugger 5.3 with code
from the Diab Compiler 4.4b.

One problem is the following:

The compiler option -Xsplit-section creates a separate section for each
function to allow the linker to remove it during linking when it is not
used. The option also splits the debug information for types into
different compilation units:

          compilation unit A

          [...] 
00A14E46: TAG_typedef
|         AT_sibling             ref(0x00A14E67)
|         AT_name                "Cfoo"
|         AT_user_def_type       ref(0x00A14E67)
00A14E67: TAG_class_type
          [...]


          compilation unit B

00A160DE: TAG_compile_unit
|         AT_sibling             ref(0x00A16397)
|         AT_name                "../SRC/main.cpp"
|         AT_low_pc              adr(0x41EF5140)
|         AT_high_pc             adr(0x41EF52E8)
|         AT_producer            "Diab Data, Inc:dplus Rel 4.4b:PPC860"
|         AT_language            LANG_C_PLUS_PLUS
|         AT_comp_dir 
|         AT_stmt_list           00 05 7D A6
|         AT_source_file_names   0x00007734
|         AT_source_info         0x00012EF0
|         AT_main_unit           ref(0x00A08C6A)
00A1618D: TAG_global_subroutine
|         AT_sibling             ref(0x00A16393)
|         AT_name                "bar"

          [...]
00A161EB: TAG_lexical_block
|         AT_sibling             ref(0x00A16231)
|         AT_low_pc              adr(0x41EF51E4)
|         AT_high_pc             adr(0x41EF5204)
00A16203: TAG_local_variable
|         AT_sibling             ref(0x00A1622D)
|         AT_name                "foo"
|         AT_user_def_type       ref(0x00A14E46)  /* reference into 
compilation unit A */
          [...]


In dwarfread.c the function lookup_utype() now complains about a bad die
reference, because read_ofile_symtab() only reads the dies from one
compilation unit (unit B). The result is that gdb only shows the variable
"foo" to be of type "int" instead of type "Cfoo".

Maybe someone already has a patch for this?

If not, what would be an appropriate solution? I have been pondering about 
a
possible fix. To read all dies from all compilation units could be a 
problem
for code with a huge amount of debug information.

A better way would be to reload the missing information when it is needed.
But I am not sure how to load dies from other compilation units for 
example
in lookup_utype().

Daniel van Gerpen

             reply	other threads:[~2003-07-25 22:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-25 22:42 daniel.van.gerpen [this message]
2003-07-25 23:08 ` 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=OF3315700C.141D20E4-ONC1256D6E.0070E01C-41256D6E.00767415@diamond.philips.com \
    --to=daniel.van.gerpen@philips.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).