logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

[rfa+5.3] bug in my earlier DW_TAG_namespace patch: msg#00529

gdb.patches

Subject: [rfa+5.3] bug in my earlier DW_TAG_namespace patch

I just noticed that my earlier patch that allowed GDB to accept
DW_TAG_namespace entries had a bug in it. The function
scan_partial_symbols in dwarf2read.c only descends into DIEs that have
a name; but anonymous namespaces can lead to DIEs without names which
have interesting children (where by "interesting" I mean that we want
to add partial symbols corresponding to them). This could result in
us missing some partial symbols.

I've enclosed a patch below: for obvious reasons, it should go into
GDB 5.3 as well. I've run GDB on a copy of GDB with this patch
applied and followed the control flow when GDB runs into various sorts
of DW_TAG_namespace entries, and the control flow seems to behave like
I expect it to. (This is, admittedly, after only a limited amount of
testing.) I'm in the middle of running the testsuite (I'll run it
twice, once on a compiler that doesn't generate DW_TAG_namespace
entries and once on a compiler that does); assuming that there are no
new regressions, is the patch okay?

David Carlton
carlton@xxxxxxxxxxxxxxxxx

2002-11-21 David Carlton <carlton@xxxxxxxxxxxxxxxxx>

* dwarf2read.c (scan_partial_symbols): Descend into namespace
pdi's with no name.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.75
diff -u -p -r1.75 dwarf2read.c
--- dwarf2read.c 11 Nov 2002 00:55:34 -0000 1.75
+++ dwarf2read.c 22 Nov 2002 00:11:49 -0000
@@ -1359,7 +1359,9 @@ scan_partial_symbols (char *info_ptr, st
{
info_ptr = read_partial_die (&pdi, abfd, info_ptr, cu_header);

- if (pdi.name)
+ /* Anonymous namespaces have no name but are interesting. */
+
+ if (pdi.name != NULL || pdi.tag == DW_TAG_namespace)
{
switch (pdi.tag)
{



<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo