From: Daniel Jacobowitz <drow@mvista.com>
To: Joel Brobecker <brobecker@gnat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] stabs: remember types that cross reference another type
Date: Mon, 03 Nov 2003 18:16:00 -0000 [thread overview]
Message-ID: <20031103181635.GA31356@nevyn.them.org> (raw)
In-Reply-To: <20031031200851.GD1236@gnat.com>
On Fri, Oct 31, 2003 at 12:08:51PM -0800, Joel Brobecker wrote:
> Hello,
>
> We encountered the following problem when using GNAT to compile
> the following pasted at the end of this message. Sorry the program
> is in Ada instead of C, but I couldn't reproduce it with C.
>
> The problem is when the user tries to print the type of My_Str.
> GDB should return a string, but instead we got:
>
> Attempt to take contents of a non-pointer value
>
> After investigating, I found that the stabs generated by the compiler
> contained the following entries:
>
> .stabs "s5:(0,97)=xsstring___XUP:",128,0,5,-476
> .stabs "R6b:(0,97)",128,0,12,-484
>
> (R6b is a variable that GDB ends up using in place of My_Str for reasons
> that are related to the encoding used by GNAT).
>
> So when GDB reads the type information for R6b, it finds that it is
> of type number (0,97), which should mean the same type as s5.
> Unfortunately, GDB forgot to save a reference to the type associated
> to type (0,97) in the type_vector when processing the type of variable
> named "s5". So later on, when GDB tries to compute the type of "R6b",
> it doesn't find type (0,97) and therefore assumes it will be defined
> later, and hence creates a empty type object which it hopes will be
> filled in later.
>
> As a consequence, when the ada mode tries to print the type of R6b,
> it trips over the unexpected symbol type code, and bails out with
> the error message above.
>
> The attached patch fixes this particular case.
>
> 2003-10-31 J. Brobecker <brobecker@gnat.com>
>
> * stabsread.c (read_type): Save a reference to types that are defined
> as cross references to other types.
>
> Tested on x86-linux, no regression.
>
> Ok to apply?
No patch?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-11-03 18:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-31 20:08 Joel Brobecker
2003-11-03 18:16 ` Daniel Jacobowitz [this message]
2003-11-03 22:59 ` Joel Brobecker
2003-12-04 5:20 ` Elena Zannoni
2003-12-05 0:22 ` Joel Brobecker
2003-12-05 0:27 ` Elena Zannoni
2003-12-05 0:47 ` Joel Brobecker
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=20031103181635.GA31356@nevyn.them.org \
--to=drow@mvista.com \
--cc=brobecker@gnat.com \
--cc=gdb-patches@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