public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Re: C ASSEMBLER_NAME patch
@ 2003-07-26 16:04 Michael Elizabeth Chastain
  2003-07-26 21:51 ` Geoffrey Keating
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Elizabeth Chastain @ 2003-07-26 16:04 UTC (permalink / raw)
  To: geoffk; +Cc: gcc-patches, gdb

Geoff K writes:

> This is supposed to happen under some circumstances.  (Not the 
> circumstances that you're experiencing---I'm fixing that now---but some 
> other circumstances.)
> 
> How should GCC emit stabs so that GDB does the right thing with these 
> symbol names?

I'm not an expert on this, so I hope one of the symtab people
(Daniel J) will correct me if I get this wrong:

Names at file scope should not be qualified with ".number", and names at
function scope can be qualified.

The comment in lhd_set_decl_assembler_name says that is what it's doing
("Can't just use the variable's own name for a variable whose scope is
less than the whole compilation.") so it looks like the test just needs
to be adjusted, to my superficial eyes.

We have a test (gdb.base/scope.exp) with lots of function-scoped and
block-scoped static variables, and they are getting qualified,
and gdb handles them properly.  It's only these file-scope symbols that
are hurting, and that happens just when a prototype is visible.
That is:

  static void f1 ();
  static void f1 () { return; }
  static void f2 () { return; }

f1 is getting qualified (bad) and f2 is not (good).

Thanks,

Michael C

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: C ASSEMBLER_NAME patch
  2003-07-26 16:04 C ASSEMBLER_NAME patch Michael Elizabeth Chastain
@ 2003-07-26 21:51 ` Geoffrey Keating
  0 siblings, 0 replies; 2+ messages in thread
From: Geoffrey Keating @ 2003-07-26 21:51 UTC (permalink / raw)
  To: Michael Elizabeth Chastain; +Cc: gcc-patches, gdb


On Saturday, July 26, 2003, at 09:04  AM, Michael Elizabeth Chastain 
wrote:

> Geoff K writes:
>
>> This is supposed to happen under some circumstances.  (Not the
>> circumstances that you're experiencing---I'm fixing that now---but 
>> some
>> other circumstances.)
>>
>> How should GCC emit stabs so that GDB does the right thing with these
>> symbol names?
>
> I'm not an expert on this, so I hope one of the symtab people
> (Daniel J) will correct me if I get this wrong:
>
> Names at file scope should not be qualified with ".number", and names 
> at
> function scope can be qualified.
>
> The comment in lhd_set_decl_assembler_name says that is what it's doing
> ("Can't just use the variable's own name for a variable whose scope is
> less than the whole compilation.") so it looks like the test just needs
> to be adjusted, to my superficial eyes.

No, 'scope less than the whole compilation' != 'file scope' if you are 
compiling multiple files into one .s file.

I'll look at Daniel's suggestion.  I'm told this works in dwarf-2, so 
it's probably just a bug in the STABS emitter in GCC.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-26 21:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-26 16:04 C ASSEMBLER_NAME patch Michael Elizabeth Chastain
2003-07-26 21:51 ` Geoffrey Keating

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).