aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Evans <xdje42@gmail.com>2014-12-16 22:00:13 -0800
committerDoug Evans <xdje42@gmail.com>2014-12-16 22:00:13 -0800
commitd01060f023ce60fea127b737298a3d4e9bc9404b (patch)
treed799e5f69ab281a48da36fb9410524b9e5f63cfe
parent64f0601bb42fae8cebf8f845a840bf21f14ad125 (diff)
downloadgdb-d01060f023ce60fea127b737298a3d4e9bc9404b.zip
gdb-d01060f023ce60fea127b737298a3d4e9bc9404b.tar.gz
gdb-d01060f023ce60fea127b737298a3d4e9bc9404b.tar.bz2
symtab.h (struct symbol_search) <symtab>: Delete, unnecessary.
gdb/ChangeLog: * symtab.h (struct symbol_search) <symtab>: Delete. All uses updated. * symtab.c (compare_search_syms): Use SYMBOL_SYMTAB accessor. (print_symbol_info): Delete arg symtab. All callers updated. (symtab_symbol_info): Use SYMBOL_SYMTAB accessor.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/symtab.c18
-rw-r--r--gdb/symtab.h4
3 files changed, 17 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7c2e6f3..087c9c9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2014-12-16 Doug Evans <xdje42@gmail.com>
+
+ * symtab.h (struct symbol_search) <symtab>: Delete. All uses updated.
+ * symtab.c (compare_search_syms): Use SYMBOL_SYMTAB accessor.
+ (print_symbol_info): Delete arg symtab. All callers updated.
+ (symtab_symbol_info): Use SYMBOL_SYMTAB accessor.
+
2014-12-16 Andreas Arnez <arnez@vnet.linux.ibm.com>
* user-regs.c (maintenance_print_user_registers): Swap "Nr" and
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 54e4be4..a95234f 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -3406,7 +3406,8 @@ compare_search_syms (const void *sa, const void *sb)
struct symbol_search *sym_b = *(struct symbol_search **) sb;
int c;
- c = FILENAME_CMP (sym_a->symtab->filename, sym_b->symtab->filename);
+ c = FILENAME_CMP (SYMBOL_SYMTAB (sym_a->symbol)->filename,
+ SYMBOL_SYMTAB (sym_b->symbol)->filename);
if (c != 0)
return c;
@@ -3722,7 +3723,6 @@ search_symbols (const char *regexp, enum search_domain kind,
struct symbol_search *psr = (struct symbol_search *)
xmalloc (sizeof (struct symbol_search));
psr->block = i;
- psr->symtab = real_symtab;
psr->symbol = sym;
memset (&psr->msymbol, 0, sizeof (psr->msymbol));
psr->next = NULL;
@@ -3780,7 +3780,6 @@ search_symbols (const char *regexp, enum search_domain kind,
psr->block = i;
psr->msymbol.minsym = msymbol;
psr->msymbol.objfile = objfile;
- psr->symtab = NULL;
psr->symbol = NULL;
psr->next = NULL;
if (tail == NULL)
@@ -3806,9 +3805,10 @@ search_symbols (const char *regexp, enum search_domain kind,
static void
print_symbol_info (enum search_domain kind,
- struct symtab *s, struct symbol *sym,
+ struct symbol *sym,
int block, const char *last)
{
+ struct symtab *s = SYMBOL_SYMTAB (sym);
const char *s_filename = symtab_to_filename_for_display (s);
if (last == NULL || filename_cmp (last, s_filename) != 0)
@@ -3903,11 +3903,11 @@ symtab_symbol_info (char *regexp, enum search_domain kind, int from_tty)
else
{
print_symbol_info (kind,
- p->symtab,
p->symbol,
p->block,
last_filename);
- last_filename = symtab_to_filename_for_display (p->symtab);
+ last_filename
+ = symtab_to_filename_for_display (SYMBOL_SYMTAB (p->symbol));
}
}
@@ -3993,7 +3993,8 @@ rbreak_command (char *regexp, int from_tty)
{
if (p->msymbol.minsym == NULL)
{
- const char *fullname = symtab_to_fullname (p->symtab);
+ struct symtab *symtab = SYMBOL_SYMTAB (p->symbol);
+ const char *fullname = symtab_to_fullname (symtab);
int newlen = (strlen (fullname)
+ strlen (SYMBOL_LINKAGE_NAME (p->symbol))
@@ -4010,10 +4011,9 @@ rbreak_command (char *regexp, int from_tty)
strcat (string, "'");
break_command (string, from_tty);
print_symbol_info (FUNCTIONS_DOMAIN,
- p->symtab,
p->symbol,
p->block,
- symtab_to_filename_for_display (p->symtab));
+ symtab_to_filename_for_display (symtab));
}
else
{
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 4f90140..c9b38d2 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1457,9 +1457,7 @@ struct symbol_search
/* Information describing what was found.
- If symtab and symbol are NOT NULL, then information was found
- for this match. */
- struct symtab *symtab;
+ If symbol is NOT NULL, then information was found for this match. */
struct symbol *symbol;
/* If msymbol is non-null, then a match was made on something for