From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: FYI: use SYMBOL_SYMTAB accessor
Date: Mon, 26 Nov 2012 15:54:00 -0000 [thread overview]
Message-ID: <87r4ngicmg.fsf@fleche.redhat.com> (raw)
While working on a different patch I noticed a few spots that were not
using the SYMBOL_SYMTAB accessor macro.
This patch fixes these places. I'm checking it in as obvious.
Tested by rebuilding.
Tom
2012-11-26 Tom Tromey <tromey@redhat.com>
* ada-lang.c (user_select_syms): Use SYMBOL_SYMTAB.
* dwarf2read.c (dw2_find_symbol_file, fixup_go_packaging): Use
SYMBOL_SYMTAB.
* skip.c (skip_info): Use SYMBOL_SYMTAB.
Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.380
diff -u -r1.380 ada-lang.c
--- ada-lang.c 12 Nov 2012 17:14:54 -0000 1.380
+++ ada-lang.c 26 Nov 2012 15:51:01 -0000
@@ -3583,7 +3583,7 @@
(SYMBOL_CLASS (syms[i].sym) == LOC_CONST
&& SYMBOL_TYPE (syms[i].sym) != NULL
&& TYPE_CODE (SYMBOL_TYPE (syms[i].sym)) == TYPE_CODE_ENUM);
- struct symtab *symtab = syms[i].sym->symtab;
+ struct symtab *symtab = SYMBOL_SYMTAB (syms[i].sym);
if (SYMBOL_LINE (syms[i].sym) != 0 && symtab != NULL)
printf_unfiltered (_("[%d] %s at %s:%d\n"),
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.713
diff -u -r1.713 dwarf2read.c
--- dwarf2read.c 20 Nov 2012 22:51:04 -0000 1.713
+++ dwarf2read.c 26 Nov 2012 15:51:06 -0000
@@ -3402,7 +3402,7 @@
struct symbol *sym = lookup_block_symbol (block, name, VAR_DOMAIN);
if (sym)
- return sym->symtab->filename;
+ return SYMBOL_SYMTAB (sym)->filename;
}
return NULL;
}
@@ -6754,8 +6754,9 @@
if (strcmp (package_name, this_package_name) != 0)
complaint (&symfile_complaints,
_("Symtab %s has objects from two different Go packages: %s and %s"),
- (sym->symtab && sym->symtab->filename
- ? sym->symtab->filename
+ (SYMBOL_SYMTAB (sym)
+ && SYMBOL_SYMTAB (sym)->filename
+ ? SYMBOL_SYMTAB (sym)->filename
: cu->objfile->name),
this_package_name, package_name);
xfree (this_package_name);
Index: skip.c
===================================================================
RCS file: /cvs/src/src/gdb/skip.c,v
retrieving revision 1.8
diff -u -r1.8 skip.c
--- skip.c 9 Aug 2012 06:48:21 -0000 1.8
+++ skip.c 26 Nov 2012 15:51:06 -0000
@@ -304,7 +304,7 @@
if (sym)
ui_out_field_fmt (current_uiout, "what", "%s at %s:%d",
sym->ginfo.name,
- sym->symtab->filename,
+ SYMBOL_SYMTAB (sym)->filename,
sym->line);
else
ui_out_field_string (current_uiout, "what", "?");
next reply other threads:[~2012-11-26 15:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-26 15:54 Tom Tromey [this message]
2012-11-26 16:37 ` Joel Brobecker
2012-11-26 18:32 ` Tom Tromey
2012-11-26 20:43 ` 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=87r4ngicmg.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.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