aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/dbxread.c27
-rw-r--r--gdb/dwarf2read.c23
-rw-r--r--gdb/mdebugread.c38
-rw-r--r--gdb/psympriv.h2
-rw-r--r--gdb/psymtab.c20
-rw-r--r--gdb/xcoffread.c21
7 files changed, 59 insertions, 78 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8f6ced9..c6a6872 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2015-08-15 Doug Evans <xdje42@gmail.com>
+ * psymtab.c (add_psymbol_to_bcache): Remove "val" arg. All callers
+ updated.
+ (add_psymbol_to_list): Ditto.
+
+2015-08-15 Doug Evans <xdje42@gmail.com>
+
* dbxread.c (dbx_end_psymtab): Renamed from end_psymtab. All callers
updated. Call end_psymtab_common.
* dwarf2read.c (process_psymtab_comp_unit_reader): Call
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index dc2eda2..1d00432 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -1705,8 +1705,7 @@ read_dbx_symtab (struct objfile *objfile)
add_psymbol_to_list (sym_name, sym_len, 1,
VAR_DOMAIN, LOC_STATIC,
&objfile->static_psymbols,
- 0, nlist.n_value,
- psymtab_language, objfile);
+ nlist.n_value, psymtab_language, objfile);
continue;
case 'G':
@@ -1717,8 +1716,7 @@ read_dbx_symtab (struct objfile *objfile)
add_psymbol_to_list (sym_name, sym_len, 1,
VAR_DOMAIN, LOC_STATIC,
&objfile->global_psymbols,
- 0, nlist.n_value,
- psymtab_language, objfile);
+ nlist.n_value, psymtab_language, objfile);
continue;
case 'T':
@@ -1735,16 +1733,14 @@ read_dbx_symtab (struct objfile *objfile)
add_psymbol_to_list (sym_name, sym_len, 1,
STRUCT_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
- nlist.n_value, 0,
- psymtab_language, objfile);
+ 0, psymtab_language, objfile);
if (p[2] == 't')
{
/* Also a typedef with the same name. */
add_psymbol_to_list (sym_name, sym_len, 1,
VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
- nlist.n_value, 0,
- psymtab_language, objfile);
+ 0, psymtab_language, objfile);
p += 1;
}
}
@@ -1756,8 +1752,7 @@ read_dbx_symtab (struct objfile *objfile)
add_psymbol_to_list (sym_name, sym_len, 1,
VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
- nlist.n_value, 0,
- psymtab_language, objfile);
+ 0, psymtab_language, objfile);
}
check_enum:
/* If this is an enumerated type, we need to
@@ -1818,7 +1813,7 @@ read_dbx_symtab (struct objfile *objfile)
add_psymbol_to_list (p, q - p, 1,
VAR_DOMAIN, LOC_CONST,
&objfile->static_psymbols, 0,
- 0, psymtab_language, objfile);
+ psymtab_language, objfile);
/* Point past the name. */
p = q;
/* Skip over the value. */
@@ -1835,8 +1830,8 @@ read_dbx_symtab (struct objfile *objfile)
/* Constant, e.g. from "const" in Pascal. */
add_psymbol_to_list (sym_name, sym_len, 1,
VAR_DOMAIN, LOC_CONST,
- &objfile->static_psymbols, nlist.n_value,
- 0, psymtab_language, objfile);
+ &objfile->static_psymbols, 0,
+ psymtab_language, objfile);
continue;
case 'f':
@@ -1902,8 +1897,7 @@ read_dbx_symtab (struct objfile *objfile)
add_psymbol_to_list (sym_name, sym_len, 1,
VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols,
- 0, nlist.n_value,
- psymtab_language, objfile);
+ nlist.n_value, psymtab_language, objfile);
continue;
/* Global functions were ignored here, but now they
@@ -1972,8 +1966,7 @@ read_dbx_symtab (struct objfile *objfile)
add_psymbol_to_list (sym_name, sym_len, 1,
VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols,
- 0, nlist.n_value,
- psymtab_language, objfile);
+ nlist.n_value, psymtab_language, objfile);
continue;
/* Two things show up here (hopefully); static symbols of
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 7a7fb93e..445ad86 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -6903,7 +6903,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
built_actual_name != NULL,
VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols,
- 0, addr, cu->language, objfile);
+ addr, cu->language, objfile);
}
else
{
@@ -6913,7 +6913,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
built_actual_name != NULL,
VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols,
- 0, addr, cu->language, objfile);
+ addr, cu->language, objfile);
}
break;
case DW_TAG_constant:
@@ -6926,7 +6926,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
list = &objfile->static_psymbols;
add_psymbol_to_list (actual_name, strlen (actual_name),
built_actual_name != NULL, VAR_DOMAIN, LOC_STATIC,
- list, 0, 0, cu->language, objfile);
+ list, 0, cu->language, objfile);
}
break;
case DW_TAG_variable:
@@ -6962,7 +6962,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
built_actual_name != NULL,
VAR_DOMAIN, LOC_STATIC,
&objfile->global_psymbols,
- 0, addr + baseaddr,
+ addr + baseaddr,
cu->language, objfile);
}
else
@@ -6983,7 +6983,6 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
built_actual_name != NULL,
VAR_DOMAIN, LOC_STATIC,
&objfile->static_psymbols,
- 0,
has_loc ? addr + baseaddr : (CORE_ADDR) 0,
cu->language, objfile);
}
@@ -6995,7 +6994,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
built_actual_name != NULL,
VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
- 0, (CORE_ADDR) 0, cu->language, objfile);
+ 0, cu->language, objfile);
break;
case DW_TAG_imported_declaration:
case DW_TAG_namespace:
@@ -7003,14 +7002,14 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
built_actual_name != NULL,
VAR_DOMAIN, LOC_TYPEDEF,
&objfile->global_psymbols,
- 0, (CORE_ADDR) 0, cu->language, objfile);
+ 0, cu->language, objfile);
break;
case DW_TAG_module:
add_psymbol_to_list (actual_name, strlen (actual_name),
built_actual_name != NULL,
MODULE_DOMAIN, LOC_TYPEDEF,
&objfile->global_psymbols,
- 0, (CORE_ADDR) 0, cu->language, objfile);
+ 0, cu->language, objfile);
break;
case DW_TAG_class_type:
case DW_TAG_interface_type:
@@ -7037,7 +7036,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
|| cu->language == language_java)
? &objfile->global_psymbols
: &objfile->static_psymbols,
- 0, (CORE_ADDR) 0, cu->language, objfile);
+ 0, cu->language, objfile);
break;
case DW_TAG_enumerator:
@@ -7048,7 +7047,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
|| cu->language == language_java)
? &objfile->global_psymbols
: &objfile->static_psymbols,
- 0, (CORE_ADDR) 0, cu->language, objfile);
+ 0, cu->language, objfile);
break;
default:
break;
@@ -15636,7 +15635,7 @@ load_partial_dies (const struct die_reader_specs *reader,
add_psymbol_to_list (part_die->name, strlen (part_die->name), 0,
VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
- 0, (CORE_ADDR) 0, cu->language, objfile);
+ 0, cu->language, objfile);
info_ptr = locate_pdi_sibling (reader, part_die, info_ptr);
continue;
}
@@ -15675,7 +15674,7 @@ load_partial_dies (const struct die_reader_specs *reader,
|| cu->language == language_java)
? &objfile->global_psymbols
: &objfile->static_psymbols,
- 0, (CORE_ADDR) 0, cu->language, objfile);
+ 0, cu->language, objfile);
info_ptr = locate_pdi_sibling (reader, part_die, info_ptr);
continue;
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 5344d2f..fc39ce5 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -3110,7 +3110,7 @@ parse_partial_symbols (struct objfile *objfile)
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_STATIC,
&objfile->static_psymbols,
- 0, sh.value,
+ sh.value,
psymtab_language, objfile);
continue;
case 'G':
@@ -3122,7 +3122,7 @@ parse_partial_symbols (struct objfile *objfile)
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_STATIC,
&objfile->global_psymbols,
- 0, sh.value,
+ sh.value,
psymtab_language, objfile);
continue;
@@ -3140,8 +3140,7 @@ parse_partial_symbols (struct objfile *objfile)
add_psymbol_to_list (namestring, p - namestring, 1,
STRUCT_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
- sh.value, 0,
- psymtab_language, objfile);
+ 0, psymtab_language, objfile);
if (p[2] == 't')
{
/* Also a typedef with the same name. */
@@ -3149,8 +3148,7 @@ parse_partial_symbols (struct objfile *objfile)
p - namestring, 1,
VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
- sh.value, 0,
- psymtab_language,
+ 0, psymtab_language,
objfile);
p += 1;
}
@@ -3163,8 +3161,7 @@ parse_partial_symbols (struct objfile *objfile)
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
- sh.value, 0,
- psymtab_language, objfile);
+ 0, psymtab_language, objfile);
}
check_enum:
/* If this is an enumerated type, we need to add
@@ -3228,7 +3225,7 @@ parse_partial_symbols (struct objfile *objfile)
add_psymbol_to_list (p, q - p, 1,
VAR_DOMAIN, LOC_CONST,
&objfile->static_psymbols,
- 0, 0, psymtab_language,
+ 0, psymtab_language,
objfile);
/* Point past the name. */
p = q;
@@ -3246,8 +3243,7 @@ parse_partial_symbols (struct objfile *objfile)
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_CONST,
&objfile->static_psymbols,
- sh.value, 0, psymtab_language,
- objfile);
+ 0, psymtab_language, objfile);
continue;
case 'f':
@@ -3266,7 +3262,7 @@ parse_partial_symbols (struct objfile *objfile)
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols,
- 0, sh.value,
+ sh.value,
psymtab_language, objfile);
continue;
@@ -3290,7 +3286,7 @@ parse_partial_symbols (struct objfile *objfile)
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols,
- 0, sh.value,
+ sh.value,
psymtab_language, objfile);
continue;
@@ -3533,12 +3529,12 @@ parse_partial_symbols (struct objfile *objfile)
add_psymbol_to_list (name, strlen (name), 1,
VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols,
- 0, sh.value, psymtab_language, objfile);
+ sh.value, psymtab_language, objfile);
else
add_psymbol_to_list (name, strlen (name), 1,
VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols,
- 0, sh.value, psymtab_language, objfile);
+ sh.value, psymtab_language, objfile);
procaddr = sh.value;
@@ -3605,8 +3601,7 @@ parse_partial_symbols (struct objfile *objfile)
add_psymbol_to_list (name, strlen (name), 1,
STRUCT_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
- 0, (CORE_ADDR) 0,
- psymtab_language, objfile);
+ 0, psymtab_language, objfile);
}
handle_psymbol_enumerators (objfile, fh, sh.st, sh.value);
@@ -3646,7 +3641,7 @@ parse_partial_symbols (struct objfile *objfile)
add_psymbol_to_list (name, strlen (name), 1,
VAR_DOMAIN, theclass,
&objfile->static_psymbols,
- 0, sh.value, psymtab_language, objfile);
+ sh.value, psymtab_language, objfile);
skip:
cur_sdx++; /* Go to next file symbol. */
}
@@ -3726,8 +3721,7 @@ parse_partial_symbols (struct objfile *objfile)
add_psymbol_to_list (name, strlen (name), 1,
VAR_DOMAIN, theclass,
&objfile->global_psymbols,
- 0, svalue,
- psymtab_language, objfile);
+ svalue, psymtab_language, objfile);
}
}
@@ -3891,8 +3885,8 @@ handle_psymbol_enumerators (struct objfile *objfile, FDR *fh, int stype,
in psymtabs, just in symtabs. */
add_psymbol_to_list (name, strlen (name), 1,
VAR_DOMAIN, LOC_CONST,
- &objfile->static_psymbols, 0,
- (CORE_ADDR) 0, psymtab_language, objfile);
+ &objfile->static_psymbols,
+ 0, psymtab_language, objfile);
ext_sym += external_sym_size;
}
}
diff --git a/gdb/psympriv.h b/gdb/psympriv.h
index 2cf3190..0d8112e 100644
--- a/gdb/psympriv.h
+++ b/gdb/psympriv.h
@@ -207,7 +207,7 @@ extern void add_psymbol_to_list (const char *, int,
int, domain_enum,
enum address_class,
struct psymbol_allocation_list *,
- long, CORE_ADDR,
+ CORE_ADDR,
enum language, struct objfile *);
extern void init_psymbol_list (struct objfile *, int);
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 5d0aa1c..3c9f5ac 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1640,8 +1640,7 @@ static const struct partial_symbol *
add_psymbol_to_bcache (const char *name, int namelength, int copy_name,
domain_enum domain,
enum address_class theclass,
- long val, /* Value as a long */
- CORE_ADDR coreaddr, /* Value as a CORE_ADDR */
+ CORE_ADDR coreaddr,
enum language language, struct objfile *objfile,
int *added)
{
@@ -1652,15 +1651,7 @@ add_psymbol_to_bcache (const char *name, int namelength, int copy_name,
holes. */
memset (&psymbol, 0, sizeof (psymbol));
- /* val and coreaddr are mutually exclusive, one of them *will* be zero. */
- if (val != 0)
- {
- SYMBOL_VALUE (&psymbol) = val;
- }
- else
- {
- SYMBOL_VALUE_ADDRESS (&psymbol) = coreaddr;
- }
+ SYMBOL_VALUE_ADDRESS (&psymbol) = coreaddr;
SYMBOL_SECTION (&psymbol) = -1;
SYMBOL_SET_LANGUAGE (&psymbol, language, &objfile->objfile_obstack);
PSYMBOL_DOMAIN (&psymbol) = domain;
@@ -1716,6 +1707,8 @@ append_psymbol_to_list (struct psymbol_allocation_list *list,
/* Add a symbol with a long value to a psymtab.
Since one arg is a struct, we pass in a ptr and deref it (sigh).
+ The only value we need to store for psyms is an address.
+ For all other psyms pass zero for COREADDR.
Return the partial symbol that has been added. */
void
@@ -1723,8 +1716,7 @@ add_psymbol_to_list (const char *name, int namelength, int copy_name,
domain_enum domain,
enum address_class theclass,
struct psymbol_allocation_list *list,
- long val, /* Value as a long */
- CORE_ADDR coreaddr, /* Value as a CORE_ADDR */
+ CORE_ADDR coreaddr,
enum language language, struct objfile *objfile)
{
const struct partial_symbol *psym;
@@ -1733,7 +1725,7 @@ add_psymbol_to_list (const char *name, int namelength, int copy_name,
/* Stash the partial symbol away in the cache. */
psym = add_psymbol_to_bcache (name, namelength, copy_name, domain, theclass,
- val, coreaddr, language, objfile, &added);
+ coreaddr, language, objfile, &added);
/* Do not duplicate global partial symbols. */
if (list == &objfile->global_psymbols
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 5940ec9..2edf8bd 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -2660,7 +2660,7 @@ scan_xcoff_symtab (struct objfile *objfile)
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_STATIC,
&objfile->static_psymbols,
- 0, symbol.n_value,
+ symbol.n_value,
psymtab_language, objfile);
continue;
@@ -2672,7 +2672,7 @@ scan_xcoff_symtab (struct objfile *objfile)
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_STATIC,
&objfile->global_psymbols,
- 0, symbol.n_value,
+ symbol.n_value,
psymtab_language, objfile);
continue;
@@ -2690,16 +2690,14 @@ scan_xcoff_symtab (struct objfile *objfile)
add_psymbol_to_list (namestring, p - namestring, 1,
STRUCT_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
- symbol.n_value, 0,
- psymtab_language, objfile);
+ 0, psymtab_language, objfile);
if (p[2] == 't')
{
/* Also a typedef with the same name. */
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
- symbol.n_value, 0,
- psymtab_language, objfile);
+ 0, psymtab_language, objfile);
p += 1;
}
}
@@ -2711,8 +2709,7 @@ scan_xcoff_symtab (struct objfile *objfile)
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
- symbol.n_value, 0,
- psymtab_language, objfile);
+ 0, psymtab_language, objfile);
}
check_enum:
/* If this is an enumerated type, we need to
@@ -2773,7 +2770,7 @@ scan_xcoff_symtab (struct objfile *objfile)
enum constants in psymtabs, just in symtabs. */
add_psymbol_to_list (p, q - p, 1,
VAR_DOMAIN, LOC_CONST,
- &objfile->static_psymbols, 0,
+ &objfile->static_psymbols,
0, psymtab_language, objfile);
/* Point past the name. */
p = q;
@@ -2791,7 +2788,7 @@ scan_xcoff_symtab (struct objfile *objfile)
/* Constant, e.g. from "const" in Pascal. */
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_CONST,
- &objfile->static_psymbols, symbol.n_value,
+ &objfile->static_psymbols,
0, psymtab_language, objfile);
continue;
@@ -2811,7 +2808,7 @@ scan_xcoff_symtab (struct objfile *objfile)
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols,
- 0, symbol.n_value,
+ symbol.n_value,
psymtab_language, objfile);
continue;
@@ -2842,7 +2839,7 @@ scan_xcoff_symtab (struct objfile *objfile)
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols,
- 0, symbol.n_value,
+ symbol.n_value,
psymtab_language, objfile);
continue;