public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Displaying variables from namespace with strange DWARF info
@ 2020-09-08 15:13 Stas Perepelitsa
  2020-09-11 14:49 ` Simon Marchi
  0 siblings, 1 reply; 2+ messages in thread
From: Stas Perepelitsa @ 2020-09-08 15:13 UTC (permalink / raw)
  To: gdb

Hi All,

I've got an ELF file compiled with a proprietary C/C++ compiler, where the
project contains namespaces.

I’ve parsed DWARF info and it reveals that variables sitting in namespace
have their names fully qualified, like AAA::BBB::name.

Another point, the compilation unit marked as C89 source regardless of C++
source file taken as input file.

And there are no attributes ’ DW_AT_namespace’ found in DWARF info.
(Checked same project with ARM compiler and yes, there are those attributes)
As a result, the variables from namespaces are neither displayed as
variables nor as expressions. Is there any chance to teach gdb how to
process such names?

Regards,
Stanislav.

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

* Re: Displaying variables from namespace with strange DWARF info
  2020-09-08 15:13 Displaying variables from namespace with strange DWARF info Stas Perepelitsa
@ 2020-09-11 14:49 ` Simon Marchi
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2020-09-11 14:49 UTC (permalink / raw)
  To: Stas Perepelitsa, gdb

On 2020-09-08 11:13 a.m., Stas Perepelitsa via Gdb wrote:
> Hi All,
> 
> I've got an ELF file compiled with a proprietary C/C++ compiler, where the
> project contains namespaces.
> 
> I’ve parsed DWARF info and it reveals that variables sitting in namespace
> have their names fully qualified, like AAA::BBB::name.
> 
> Another point, the compilation unit marked as C89 source regardless of C++
> source file taken as input file.
> 
> And there are no attributes ’ DW_AT_namespace’ found in DWARF info.

You mean DW_TAG_namespace?

> (Checked same project with ARM compiler and yes, there are those attributes)
> As a result, the variables from namespaces are neither displayed as
> variables nor as expressions. Is there any chance to teach gdb how to
> process such names?

Yes, it would be by hacking in dwarf2/read.c.  I don't know how easy or difficult
this particular change would be though.

Simon

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

end of thread, other threads:[~2020-09-11 14:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-08 15:13 Displaying variables from namespace with strange DWARF info Stas Perepelitsa
2020-09-11 14:49 ` Simon Marchi

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