From 7cbd4a934e9cf3808e1199c62e65b4c25b24b4e5 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 8 Apr 2013 19:59:09 +0000 Subject: * minsyms.h (struct bound_minimal_symbol): New. (lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol. Remove objfile argument. (lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc): Return bound_minimal_symbol. * minsyms.c (lookup_minimal_symbol_by_pc_1) (lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc): Return bound_minimal_symbol. (in_gnu_ifunc_stub): Update. (lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol. Remove 'objfile_p' argument. (lookup_solib_trampoline_symbol_by_pc): Update. * ada-tasks.c, amd64-windows-tdep.c, arm-tdep.c, arm-wince-tdep.c, block.c, blockframe.c, breakpoint.c, btrace.c, c-valprint.c, dwarf2loc.c, elfread.c, frame.c, frv-tdep.c, glibc-tdep.c, gnu-v2-abi.c, gnu-v3-abi.c, hppa-hpux-tdep.c, i386-tdep.c, ia64-tdep.c, infcall.c, infcmd.c, jit.c, linux-fork.c, m32c-tdep.c, m68hc11-tdep.c, maint.c, mips-tdep.c, p-valprint.c, parse.c, ppc-linux-tdep.c, ppc-sysv-tdep.c, printcmd.c, rs6000-tdep.c, sh64-tdep.c, stack.c, symtab.c, tui/tui-disasm.c: Update. --- gdb/minsyms.h | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'gdb/minsyms.h') diff --git a/gdb/minsyms.h b/gdb/minsyms.h index e3980ea..71670e3 100644 --- a/gdb/minsyms.h +++ b/gdb/minsyms.h @@ -20,6 +20,23 @@ #ifndef MINSYMS_H #define MINSYMS_H +/* Several lookup functions return both a minimal symbol and the + objfile in which it is found. This structure is used in these + cases. */ + +struct bound_minimal_symbol +{ + /* The minimal symbol that was found, or NULL if no minimal symbol + was found. */ + + struct minimal_symbol *minsym; + + /* If MINSYM is not NULL, then this is the objfile in which the + symbol is defined. */ + + struct objfile *objfile; +}; + /* This header declares most of the API for dealing with minimal symbols and minimal symbol tables. A few things are declared elsewhere; see below. @@ -169,12 +186,9 @@ struct minimal_symbol *lookup_minimal_symbol (const char *, struct objfile *); /* Find the minimal symbol named NAME, and return both the minsym - struct and its objfile. This only checks the linkage name. Sets - *OBJFILE_P and returns the minimal symbol, if it is found. If it - is not found, returns NULL. */ + struct and its objfile. This only checks the linkage name. */ -struct minimal_symbol *lookup_minimal_symbol_and_objfile (const char *, - struct objfile **); +struct bound_minimal_symbol lookup_minimal_symbol_and_objfile (const char *); /* Look through all the current minimal symbol tables and find the first minimal symbol that matches NAME and has text type. If OBJF @@ -213,10 +227,10 @@ struct minimal_symbol *lookup_minimal_symbol_by_pc_name If SECTION is NULL, this uses the result of find_pc_section instead. - Returns a pointer to the minimal symbol if such a symbol is found, - or NULL if PC is not in a suitable range. */ + The result has a non-NULL 'minsym' member if such a symbol is + found, or NULL if PC is not in a suitable range. */ -struct minimal_symbol *lookup_minimal_symbol_by_pc_section +struct bound_minimal_symbol lookup_minimal_symbol_by_pc_section (CORE_ADDR, struct obj_section *); @@ -226,7 +240,7 @@ struct minimal_symbol *lookup_minimal_symbol_by_pc_section This is a wrapper that calls lookup_minimal_symbol_by_pc_section with a NULL section argument. */ -struct minimal_symbol *lookup_minimal_symbol_by_pc (CORE_ADDR); +struct bound_minimal_symbol lookup_minimal_symbol_by_pc (CORE_ADDR); /* Iterate over all the minimal symbols in the objfile OBJF which match NAME. Both the ordinary and demangled names of each symbol -- cgit v1.1