diff options
author | Daniel Jacobowitz <drow@false.org> | 2006-11-28 16:53:54 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2006-11-28 16:53:54 +0000 |
commit | fbcebcb1cea20cfda8a5f7b8fe48555c83a48160 (patch) | |
tree | be3964815f8d9816c7ff13cd6e922ac7d2de556a /gdb | |
parent | e86e87f77fd5d8afb3e714f1d9e09e0ff5b4e6ff (diff) | |
download | gdb-fbcebcb1cea20cfda8a5f7b8fe48555c83a48160.zip gdb-fbcebcb1cea20cfda8a5f7b8fe48555c83a48160.tar.gz gdb-fbcebcb1cea20cfda8a5f7b8fe48555c83a48160.tar.bz2 |
2006-11-28 Pedro Alves <pedro_alves@portugalmail.pt>
* coffread.c (cs_to_bfd_section): New function.
(cs_to_section): Use cs_to_bfd_section.
(record_minimal_symbol): Take the coff_symbol* parameter instead
of the symbol's name as a char*.
Add 'int section' parameter. Call prim_record_minimal_symbol_and_info
instead of prim_record_minimal_symbol_and_info.
Change return type to struct minimal_symbol *.
(coff_symtab_read): Adapt to new record_minimal_symbol's signature.
Make all minimal symbol creations go through record_minimal_symbol.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 12 | ||||
-rw-r--r-- | gdb/coffread.c | 51 |
2 files changed, 43 insertions, 20 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5497f17..e420332 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2006-11-28 Pedro Alves <pedro_alves@portugalmail.pt> + + * coffread.c (cs_to_bfd_section): New function. + (cs_to_section): Use cs_to_bfd_section. + (record_minimal_symbol): Take the coff_symbol* parameter instead + of the symbol's name as a char*. + Add 'int section' parameter. Call prim_record_minimal_symbol_and_info + instead of prim_record_minimal_symbol_and_info. + Change return type to struct minimal_symbol *. + (coff_symtab_read): Adapt to new record_minimal_symbol's signature. + Make all minimal symbol creations go through record_minimal_symbol. + 2006-11-28 Daniel Jacobowitz <dan@codesourcery.com> * symtab.c (find_pc_sect_line): Do not return a line before diff --git a/gdb/coffread.c b/gdb/coffread.c index 9742cd7..669e33d 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -259,17 +259,25 @@ find_targ_sec (bfd *abfd, asection *sect, void *obj) *args->resultp = sect; } -/* Return the section number (SECT_OFF_*) that CS points to. */ -static int -cs_to_section (struct coff_symbol *cs, struct objfile *objfile) +/* Return the bfd_section that CS points to. */ +static struct bfd_section* +cs_to_bfd_section (struct coff_symbol *cs, struct objfile *objfile) { asection *sect = NULL; struct find_targ_sec_arg args; - int off = SECT_OFF_TEXT (objfile); args.targ_index = cs->c_secnum; args.resultp = § bfd_map_over_sections (objfile->obfd, find_targ_sec, &args); + return sect; +} + +/* Return the section number (SECT_OFF_*) that CS points to. */ +static int +cs_to_section (struct coff_symbol *cs, struct objfile *objfile) +{ + asection *sect = cs_to_bfd_section (cs, objfile); + int off = SECT_OFF_TEXT (objfile); if (sect != NULL) { /* This is the section. Figure out what SECT_OFF_* code it is. */ @@ -408,15 +416,19 @@ coff_end_symtab (struct objfile *objfile) last_source_file = NULL; } -static void -record_minimal_symbol (char *name, CORE_ADDR address, - enum minimal_symbol_type type, struct objfile *objfile) +static struct minimal_symbol * +record_minimal_symbol (struct coff_symbol *cs, CORE_ADDR address, + enum minimal_symbol_type type, int section, + struct objfile *objfile) { + struct bfd_section *bfd_section; /* We don't want TDESC entry points in the minimal symbol table */ - if (name[0] == '@') - return; + if (cs->c_name[0] == '@') + return NULL; - prim_record_minimal_symbol (name, address, type, objfile); + bfd_section = cs_to_bfd_section (cs, objfile); + return prim_record_minimal_symbol_and_info (cs->c_name, address, type, + NULL, section, bfd_section, objfile); } /* coff_symfile_init () @@ -762,8 +774,9 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, if (ISFCN (cs->c_type) && cs->c_sclass != C_TPDEF) { /* Record all functions -- external and static -- in minsyms. */ + int section = cs_to_section (cs, objfile); tmpaddr = cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); - record_minimal_symbol (cs->c_name, tmpaddr, mst_text, objfile); + record_minimal_symbol (cs, tmpaddr, mst_text, section, objfile); fcn_line_ptr = main_aux.x_sym.x_fcnary.x_fcn.x_lnnoptr; fcn_start_addr = tmpaddr; @@ -923,15 +936,13 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, ms_type = mst_unknown; } - if (cs->c_name[0] != '@' /* Skip tdesc symbols */ ) - { - struct minimal_symbol *msym; - msym = prim_record_minimal_symbol_and_info - (cs->c_name, tmpaddr, ms_type, NULL, - sec, NULL, objfile); - if (msym) - COFF_MAKE_MSYMBOL_SPECIAL (cs->c_sclass, msym); - } + { + struct minimal_symbol *msym; + msym = record_minimal_symbol (cs, tmpaddr, ms_type, sec, objfile); + if (msym) + COFF_MAKE_MSYMBOL_SPECIAL (cs->c_sclass, msym); + } + if (SDB_TYPE (cs->c_type)) { struct symbol *sym; |