aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@google.com>2019-09-10 15:37:50 -0500
committerChristian Biesinger <cbiesinger@google.com>2019-09-11 12:43:45 -0500
commit67547d896b0593b0fa62e23ac68c483a7e8566e2 (patch)
tree669833e9a12c28896bd0003424a07e1c032a8892 /gdb
parent64b2d4a0a4e4f80d2aa2e52c6eec3186e76fc397 (diff)
downloadfsf-binutils-gdb-67547d896b0593b0fa62e23ac68c483a7e8566e2.zip
fsf-binutils-gdb-67547d896b0593b0fa62e23ac68c483a7e8566e2.tar.gz
fsf-binutils-gdb-67547d896b0593b0fa62e23ac68c483a7e8566e2.tar.bz2
Change the type of copy_names from int to bool
This parameter is really a boolean, so change the type accordingly and update the callers. This is for symbol_set_names, add_psymbol_to_bcache, and add_psymbol_to_list. minimal_symbol_reader::record_full was already passing a bool to symbol_set_names. gdb/ChangeLog: 2019-09-11 Christian Biesinger <cbiesinger@google.com> * dbxread.c (read_dbx_symtab): Update. * dwarf2read.c (load_partial_dies): Update. * mdebugread.c (parse_partial_symbols): Update. (handle_psymbol_enumerators): Update. * psympriv.h (add_psymbol_to_list): Change type of copy_names to bool. * psymtab.c (add_psymbol_to_bcache): Likewise. (add_psymbol_to_list): Likewise. * symtab.c (symbol_set_names): Likewise. * symtab.h (symbol_set_names): Likewise. * xcoffread.c (scan_xcoff_symtab): Update.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog13
-rw-r--r--gdb/dbxread.c18
-rw-r--r--gdb/dwarf2read.c4
-rw-r--r--gdb/mdebugread.c32
-rw-r--r--gdb/psympriv.h2
-rw-r--r--gdb/psymtab.c4
-rw-r--r--gdb/symtab.c2
-rw-r--r--gdb/symtab.h2
-rw-r--r--gdb/xcoffread.c18
9 files changed, 54 insertions, 41 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e4b18fa..3b28884 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,16 @@
+2019-09-11 Christian Biesinger <cbiesinger@google.com>
+
+ * dbxread.c (read_dbx_symtab): Update.
+ * dwarf2read.c (load_partial_dies): Update.
+ * mdebugread.c (parse_partial_symbols): Update.
+ (handle_psymbol_enumerators): Update.
+ * psympriv.h (add_psymbol_to_list): Change type of copy_names to bool.
+ * psymtab.c (add_psymbol_to_bcache): Likewise.
+ (add_psymbol_to_list): Likewise.
+ * symtab.c (symbol_set_names): Likewise.
+ * symtab.h (symbol_set_names): Likewise.
+ * xcoffread.c (scan_xcoff_symtab): Update.
+
2019-09-11 Tom Tromey <tom@tromey.com>
* symfile-mem.c (symbol_file_add_from_memory): Use
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index df3ae58..dc0b2c7 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -1464,7 +1464,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
if (gdbarch_static_transform_name_p (gdbarch))
gdbarch_static_transform_name (gdbarch, namestring);
- add_psymbol_to_list (sym_name, sym_len, 1,
+ add_psymbol_to_list (sym_name, sym_len, true,
VAR_DOMAIN, LOC_STATIC,
data_sect_index,
psymbol_placement::STATIC,
@@ -1474,7 +1474,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
case 'G':
/* The addresses in these entries are reported to be
wrong. See the code that reads 'G's for symtabs. */
- add_psymbol_to_list (sym_name, sym_len, 1,
+ add_psymbol_to_list (sym_name, sym_len, true,
VAR_DOMAIN, LOC_STATIC,
data_sect_index,
psymbol_placement::GLOBAL,
@@ -1492,14 +1492,14 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
|| (p == namestring + 1
&& namestring[0] != ' '))
{
- add_psymbol_to_list (sym_name, sym_len, 1,
+ add_psymbol_to_list (sym_name, sym_len, true,
STRUCT_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
if (p[2] == 't')
{
/* Also a typedef with the same name. */
- add_psymbol_to_list (sym_name, sym_len, 1,
+ add_psymbol_to_list (sym_name, sym_len, true,
VAR_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
@@ -1511,7 +1511,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
case 't':
if (p != namestring) /* a name is there, not just :T... */
{
- add_psymbol_to_list (sym_name, sym_len, 1,
+ add_psymbol_to_list (sym_name, sym_len, true,
VAR_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
@@ -1572,7 +1572,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
;
/* Note that the value doesn't matter for
enum constants in psymtabs, just in symtabs. */
- add_psymbol_to_list (p, q - p, 1,
+ add_psymbol_to_list (p, q - p, true,
VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC, 0,
psymtab_language, objfile);
@@ -1590,7 +1590,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
case 'c':
/* Constant, e.g. from "const" in Pascal. */
- add_psymbol_to_list (sym_name, sym_len, 1,
+ add_psymbol_to_list (sym_name, sym_len, true,
VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC, 0,
psymtab_language, objfile);
@@ -1645,7 +1645,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
pst->set_text_low (nlist.n_value);
textlow_not_set = 0;
}
- add_psymbol_to_list (sym_name, sym_len, 1,
+ add_psymbol_to_list (sym_name, sym_len, true,
VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::STATIC,
@@ -1704,7 +1704,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
pst->set_text_low (nlist.n_value);
textlow_not_set = 0;
}
- add_psymbol_to_list (sym_name, sym_len, 1,
+ add_psymbol_to_list (sym_name, sym_len, true,
VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::GLOBAL,
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index c94fc24..a2b80eb 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -18533,7 +18533,7 @@ load_partial_dies (const struct die_reader_specs *reader,
|| pdi.tag == DW_TAG_subrange_type))
{
if (building_psymtab && pdi.name != NULL)
- add_psymbol_to_list (pdi.name, strlen (pdi.name), 0,
+ add_psymbol_to_list (pdi.name, strlen (pdi.name), false,
VAR_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
0, cu->language, objfile);
@@ -18567,7 +18567,7 @@ load_partial_dies (const struct die_reader_specs *reader,
if (pdi.name == NULL)
complaint (_("malformed enumerator DIE ignored"));
else if (building_psymtab)
- add_psymbol_to_list (pdi.name, strlen (pdi.name), 0,
+ add_psymbol_to_list (pdi.name, strlen (pdi.name), false,
VAR_DOMAIN, LOC_CONST, -1,
cu->language == language_cplus
? psymbol_placement::GLOBAL
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 18c1d1f..dffef8f 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -3048,7 +3048,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
namestring = gdbarch_static_transform_name
(gdbarch, namestring);
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_STATIC,
SECT_OFF_DATA (objfile),
psymbol_placement::STATIC,
@@ -3059,7 +3059,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
/* The addresses in these entries are reported
to be wrong. See the code that reads 'G's
for symtabs. */
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_STATIC,
SECT_OFF_DATA (objfile),
psymbol_placement::GLOBAL,
@@ -3078,7 +3078,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
|| (p == namestring + 1
&& namestring[0] != ' '))
{
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
STRUCT_DOMAIN, LOC_TYPEDEF,
-1,
psymbol_placement::STATIC,
@@ -3087,7 +3087,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
{
/* Also a typedef with the same name. */
add_psymbol_to_list (namestring,
- p - namestring, 1,
+ p - namestring, true,
VAR_DOMAIN, LOC_TYPEDEF,
-1,
psymbol_placement::STATIC,
@@ -3101,8 +3101,8 @@ parse_partial_symbols (minimal_symbol_reader &reader,
if (p != namestring) /* a name is there, not
just :T... */
{
- add_psymbol_to_list (namestring, p - namestring, 1,
- VAR_DOMAIN, LOC_TYPEDEF,
+ add_psymbol_to_list (namestring, p - namestring,
+ true, VAR_DOMAIN, LOC_TYPEDEF,
-1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
@@ -3166,7 +3166,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
/* Note that the value doesn't matter for
enum constants in psymtabs, just in
symtabs. */
- add_psymbol_to_list (p, q - p, 1,
+ add_psymbol_to_list (p, q - p, true,
VAR_DOMAIN, LOC_CONST,
-1,
psymbol_placement::STATIC,
@@ -3185,7 +3185,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
continue;
case 'c':
/* Constant, e.g. from "const" in Pascal. */
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
@@ -3198,7 +3198,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
function_outside_compilation_unit_complaint
(copy.c_str ());
}
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::STATIC,
@@ -3217,7 +3217,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
function_outside_compilation_unit_complaint
(copy.c_str ());
}
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::GLOBAL,
@@ -3452,13 +3452,13 @@ parse_partial_symbols (minimal_symbol_reader &reader,
symbol table, and the MAIN__ symbol via the minimal
symbol table. */
if (sh.st == stProc)
- add_psymbol_to_list (sym_name, strlen (sym_name), 1,
+ add_psymbol_to_list (sym_name, strlen (sym_name), true,
VAR_DOMAIN, LOC_BLOCK,
section,
psymbol_placement::GLOBAL,
sh.value, psymtab_language, objfile);
else
- add_psymbol_to_list (sym_name, strlen (sym_name), 1,
+ add_psymbol_to_list (sym_name, strlen (sym_name), true,
VAR_DOMAIN, LOC_BLOCK,
section,
psymbol_placement::STATIC,
@@ -3525,7 +3525,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
&& sh.iss != 0
&& sh.index != cur_sdx + 2)
{
- add_psymbol_to_list (sym_name, strlen (sym_name), 1,
+ add_psymbol_to_list (sym_name, strlen (sym_name), true,
STRUCT_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
@@ -3565,7 +3565,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
continue;
}
/* Use this gdb symbol. */
- add_psymbol_to_list (sym_name, strlen (sym_name), 1,
+ add_psymbol_to_list (sym_name, strlen (sym_name), true,
VAR_DOMAIN, theclass, section,
psymbol_placement::STATIC,
sh.value, psymtab_language, objfile);
@@ -3644,7 +3644,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
break;
}
char *sym_name = debug_info->ssext + psh->iss;
- add_psymbol_to_list (sym_name, strlen (sym_name), 1,
+ add_psymbol_to_list (sym_name, strlen (sym_name), true,
VAR_DOMAIN, theclass,
section,
psymbol_placement::GLOBAL,
@@ -3807,7 +3807,7 @@ handle_psymbol_enumerators (struct objfile *objfile, FDR *fh, int stype,
/* Note that the value doesn't matter for enum constants
in psymtabs, just in symtabs. */
- add_psymbol_to_list (name, strlen (name), 1,
+ add_psymbol_to_list (name, strlen (name), true,
VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC, 0,
psymtab_language, objfile);
diff --git a/gdb/psympriv.h b/gdb/psympriv.h
index 61d73a3..9d22f5c 100644
--- a/gdb/psympriv.h
+++ b/gdb/psympriv.h
@@ -289,7 +289,7 @@ enum class psymbol_placement
/* Add any kind of symbol to a partial_symbol vector. */
extern void add_psymbol_to_list (const char *, int,
- int, domain_enum,
+ bool, domain_enum,
enum address_class,
short /* section */,
enum psymbol_placement,
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 1f5f492..e9cc8c3 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1558,7 +1558,7 @@ psymbol_compare (const void *addr1, const void *addr2, int length)
different domain (or address) is possible and correct. */
static struct partial_symbol *
-add_psymbol_to_bcache (const char *name, int namelength, int copy_name,
+add_psymbol_to_bcache (const char *name, int namelength, bool copy_name,
domain_enum domain,
enum address_class theclass,
short section,
@@ -1602,7 +1602,7 @@ append_psymbol_to_list (std::vector<partial_symbol *> *list,
Return the partial symbol that has been added. */
void
-add_psymbol_to_list (const char *name, int namelength, int copy_name,
+add_psymbol_to_list (const char *name, int namelength, bool copy_name,
domain_enum domain,
enum address_class theclass,
short section,
diff --git a/gdb/symtab.c b/gdb/symtab.c
index e1bf369..4b528b4 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -811,7 +811,7 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol,
void
symbol_set_names (struct general_symbol_info *gsymbol,
- const char *linkage_name, int len, int copy_name,
+ const char *linkage_name, int len, bool copy_name,
struct objfile_per_bfd_storage *per_bfd)
{
struct demangled_name_entry **slot;
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 4fb00cb..c54b8ee 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -497,7 +497,7 @@ extern void symbol_set_language (struct general_symbol_info *symbol,
symbol_set_names (&(symbol)->ginfo, linkage_name, len, copy_name, \
(objfile)->per_bfd)
extern void symbol_set_names (struct general_symbol_info *symbol,
- const char *linkage_name, int len, int copy_name,
+ const char *linkage_name, int len, bool copy_name,
struct objfile_per_bfd_storage *per_bfd);
/* Now come lots of name accessor macros. Short version as to when to
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 0dacea4..a17031a 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -2644,7 +2644,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
namestring = gdbarch_static_transform_name
(gdbarch, namestring);
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_STATIC,
SECT_OFF_DATA (objfile),
psymbol_placement::STATIC,
@@ -2655,7 +2655,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
case 'G':
/* The addresses in these entries are reported to be
wrong. See the code that reads 'G's for symtabs. */
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_STATIC,
SECT_OFF_DATA (objfile),
psymbol_placement::GLOBAL,
@@ -2674,14 +2674,14 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
|| (p == namestring + 1
&& namestring[0] != ' '))
{
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
STRUCT_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
if (p[2] == 't')
{
/* Also a typedef with the same name. */
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
@@ -2693,7 +2693,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
case 't':
if (p != namestring) /* a name is there, not just :T... */
{
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
@@ -2755,7 +2755,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
;
/* Note that the value doesn't matter for
enum constants in psymtabs, just in symtabs. */
- add_psymbol_to_list (p, q - p, 1,
+ add_psymbol_to_list (p, q - p, true,
VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
@@ -2773,7 +2773,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
case 'c':
/* Constant, e.g. from "const" in Pascal. */
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
@@ -2790,7 +2790,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
function_outside_compilation_unit_complaint (name);
xfree (name);
}
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::STATIC,
@@ -2820,7 +2820,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
if (startswith (namestring, "@FIX"))
continue;
- add_psymbol_to_list (namestring, p - namestring, 1,
+ add_psymbol_to_list (namestring, p - namestring, true,
VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::GLOBAL,