aboutsummaryrefslogtreecommitdiff
path: root/gdb/minsyms.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1994-03-24 00:20:53 +0000
committerStu Grossman <grossman@cygnus>1994-03-24 00:20:53 +0000
commitad15bea9df8294fe18f69b43f0aba5582a44e807 (patch)
tree6767b0a283b8356cf473db8c761444ec831427f8 /gdb/minsyms.c
parentd12a71cabb31811a87433623176446b63a02e119 (diff)
downloadgdb-ad15bea9df8294fe18f69b43f0aba5582a44e807.zip
gdb-ad15bea9df8294fe18f69b43f0aba5582a44e807.tar.gz
gdb-ad15bea9df8294fe18f69b43f0aba5582a44e807.tar.bz2
* minsyms.c (prim_record_minimal_symbol): Move section deduction
code from prim_record_minimal_symbol_and_info() to here. Callers of the latter can legitimately supply a section number of -1.
Diffstat (limited to 'gdb/minsyms.c')
-rw-r--r--gdb/minsyms.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index ff31f73..73562cb 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -279,8 +279,29 @@ prim_record_minimal_symbol (name, address, ms_type, objfile)
enum minimal_symbol_type ms_type;
struct objfile *objfile;
{
+ int section;
+
+ switch (ms_type)
+ {
+ case mst_text:
+ case mst_file_text:
+ case mst_solib_trampoline:
+ section = SECT_OFF_TEXT;
+ break;
+ case mst_data:
+ case mst_file_data:
+ section = SECT_OFF_DATA;
+ break;
+ case mst_bss:
+ case mst_file_bss:
+ section = SECT_OFF_BSS;
+ break;
+ default:
+ section = -1;
+ }
+
prim_record_minimal_symbol_and_info (name, address, ms_type,
- NULL, -1, objfile);
+ NULL, section, objfile);
}
void
@@ -328,26 +349,7 @@ prim_record_minimal_symbol_and_info (name, address, ms_type, info, section,
SYMBOL_NAME (msymbol) = (char *) name;
SYMBOL_INIT_LANGUAGE_SPECIFIC (msymbol, language_unknown);
SYMBOL_VALUE_ADDRESS (msymbol) = address;
- if (section == -1)
- switch (ms_type)
- {
- case mst_text:
- case mst_file_text:
- SYMBOL_SECTION (msymbol) = SECT_OFF_TEXT;
- break;
- case mst_data:
- case mst_file_data:
- SYMBOL_SECTION (msymbol) = SECT_OFF_DATA;
- break;
- case mst_bss:
- case mst_file_bss:
- SYMBOL_SECTION (msymbol) = SECT_OFF_BSS;
- break;
- default:
- SYMBOL_SECTION (msymbol) = -1;
- }
- else
- SYMBOL_SECTION (msymbol) = section;
+ SYMBOL_SECTION (msymbol) = section;
MSYMBOL_TYPE (msymbol) = ms_type;
/* FIXME: This info, if it remains, needs its own field. */