From: Jim Wilson <wilson@cygnus.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] Re: gdb null ptr
Date: Fri, 03 Nov 2000 21:42:57 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590678205652@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590678205647@msgid-missing>
>...ia64-linux gdb core dumps on SGI F90 compiler output in tag_type_to_type
>in dwarf2read.c because a NULL nameoftype is passed to strcmp...
The SGI compiler emitted debug info for an array type with the name ".array.".
Gdb ignores DW_AT_name attributes attached to array types. So we see the
name, try to use the name to index into our type cache, and then fail the
check to weed out hash collisions because we did not save the name in the
type info.
I see 4 ways to fix this:
1) Handle DW_AT_name when attached to an array type.
2) Only cache types that we expect to have names, presumably enums, structures,
unions, and typedefs.
3) Check for a null string before doing the hash collision check.
4) Use something other than the type name to check for hash collisions.
1 doesn't solve all possible problems, since arrays may not be the only types
with unexpected names. 2 seems like a good choice to me. 3 is inefficient,
because we are storing a value in the cache that we will never be able to use.
I think 4 would require changing struct type to have a pointer back to the
original die, so that we can use a die check for the hash collision check.
This seems like the best choice to me, though it is more work.
Unfortunately, the problem gets a little more complicated. I looked at the
debug info emitted by the SGI F90 compiler using readelf -w. The type names
it is using aren't distinct, and hence it is unsafe to use type names for the
hash collision check. I think there is some sort of C++ template like
expansion going on here (I don't know F90), and instead of using mangled names
for the expanded types it is using the base type name. I see the same problem
with structure type names. This may be a problem with the SGI compiler.
Or perhaps it is a problem with gdb not having F90 support yet.
In any case, this is something the gdb developers will have to look at.
Jim
next prev parent reply other threads:[~2000-11-03 21:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-03 2:19 [Linux-ia64] Re: gdb null ptr Jim Wilson
2000-11-03 13:32 ` Pete Wyckoff
2000-11-03 21:32 ` Kevin Buettner
2000-11-03 21:42 ` Jim Wilson [this message]
2000-11-03 23:02 ` Kevin Buettner
2000-11-04 3:20 ` Daniel Berlin
2000-11-07 22:28 ` Jim Blandy
2000-11-07 23:38 ` Daniel Berlin
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=marc-linux-ia64-105590678205652@msgid-missing \
--to=wilson@cygnus.com \
--cc=linux-ia64@vger.kernel.org \
/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