Use bool in require_partial_symbols
authorTom Tromey <tom@tromey.com>
Sun, 24 Nov 2019 18:12:20 +0000 (11:12 -0700)
committerTom Tromey <tom@tromey.com>
Sun, 24 Nov 2019 18:12:20 +0000 (11:12 -0700)
This changes require_partial_symbols to use bool as its parameter
type.

gdb/ChangeLog
2019-11-24  Tom Tromey  <tom@tromey.com>

* symfile.c (read_symbols): Update.
* psymtab.c (require_partial_symbols): Change type of "verbose" to
bool.
(psym_map_symtabs_matching_filename, find_pc_sect_psymtab)
(psym_lookup_symbol, psym_find_last_source_symtab)
(psym_forget_cached_source_info, psym_print_stats)
(psym_expand_symtabs_for_function, psym_expand_all_symtabs)
(psym_expand_symtabs_with_fullname, psym_map_symbol_filenames)
(psym_map_matching_symbols, psym_expand_symtabs_matching)
(psym_find_compunit_symtab_by_address)
(maintenance_print_psymbols, maintenance_info_psymtabs)
(maintenance_check_psymtabs): Update.
* psymtab.h (require_partial_symbols): Change type of "verbose" to
bool.

Change-Id: Iae87aa5e4590706bb9e90a33adb86f1fe0fbf3c7

gdb/ChangeLog
gdb/psymtab.c
gdb/psymtab.h
gdb/symfile.c

index 65da2ffe3c6288b5c35bb7a4356e6505b3934429..63a1508c49ba3be9436c0798017f3e5ce05ffdf9 100644 (file)
@@ -1,3 +1,20 @@
+2019-11-24  Tom Tromey  <tom@tromey.com>
+
+       * symfile.c (read_symbols): Update.
+       * psymtab.c (require_partial_symbols): Change type of "verbose" to
+       bool.
+       (psym_map_symtabs_matching_filename, find_pc_sect_psymtab)
+       (psym_lookup_symbol, psym_find_last_source_symtab)
+       (psym_forget_cached_source_info, psym_print_stats)
+       (psym_expand_symtabs_for_function, psym_expand_all_symtabs)
+       (psym_expand_symtabs_with_fullname, psym_map_symbol_filenames)
+       (psym_map_matching_symbols, psym_expand_symtabs_matching)
+       (psym_find_compunit_symtab_by_address)
+       (maintenance_print_psymbols, maintenance_info_psymtabs)
+       (maintenance_check_psymtabs): Update.
+       * psymtab.h (require_partial_symbols): Change type of "verbose" to
+       bool.
+
 2019-11-22  Tom Tromey  <tom@tromey.com>
 
        * observable.h: Update comments.
index c3155007bbd184093e869deca1c94bb43525a46f..7074a32956aada55e3c8a24c5f146bb3c43505e3 100644 (file)
@@ -94,7 +94,7 @@ psymtab_storage::allocate_psymtab ()
 /* See psymtab.h.  */
 
 psymtab_storage::partial_symtab_range
-require_partial_symbols (struct objfile *objfile, int verbose)
+require_partial_symbols (struct objfile *objfile, bool verbose)
 {
   if ((objfile->flags & OBJF_PSYMTABS_READ) == 0)
     {
@@ -161,7 +161,7 @@ psym_map_symtabs_matching_filename
 {
   const char *name_basename = lbasename (name);
 
-  for (partial_symtab *pst : require_partial_symbols (objfile, 1))
+  for (partial_symtab *pst : require_partial_symbols (objfile, true))
     {
       /* We can skip shared psymtabs here, because any file name will be
         attached to the unshared psymtab.  */
@@ -364,7 +364,7 @@ find_pc_sect_psymtab (struct objfile *objfile, CORE_ADDR pc,
      its CUs may be missing in PSYMTABS_ADDRMAP as they may be varying
      debug info type in single OBJFILE.  */
 
-  for (partial_symtab *pst : require_partial_symbols (objfile, 1))
+  for (partial_symtab *pst : require_partial_symbols (objfile, true))
     if (!pst->psymtabs_addrmap_supported
        && pc >= pst->text_low (objfile) && pc < pst->text_high (objfile))
       {
@@ -490,7 +490,7 @@ psym_lookup_symbol (struct objfile *objfile,
 
   lookup_name_info lookup_name (name, symbol_name_match_type::FULL);
 
-  for (partial_symtab *ps : require_partial_symbols (objfile, 1))
+  for (partial_symtab *ps : require_partial_symbols (objfile, true))
     {
       if (!ps->readin && lookup_partial_symbol (objfile, ps, name,
                                                psymtab_index, domain))
@@ -780,7 +780,7 @@ psym_find_last_source_symtab (struct objfile *ofp)
 {
   struct partial_symtab *cs_pst = NULL;
 
-  for (partial_symtab *ps : require_partial_symbols (ofp, 1))
+  for (partial_symtab *ps : require_partial_symbols (ofp, true))
     {
       const char *name = ps->filename;
       int len = strlen (name);
@@ -816,7 +816,7 @@ psym_find_last_source_symtab (struct objfile *ofp)
 static void
 psym_forget_cached_source_info (struct objfile *objfile)
 {
-  for (partial_symtab *pst : require_partial_symbols (objfile, 1))
+  for (partial_symtab *pst : require_partial_symbols (objfile, true))
     {
       if (pst->fullname != NULL)
        {
@@ -1007,7 +1007,7 @@ psym_print_stats (struct objfile *objfile)
   int i;
 
   i = 0;
-  for (partial_symtab *ps : require_partial_symbols (objfile, 1))
+  for (partial_symtab *ps : require_partial_symbols (objfile, true))
     {
       if (ps->readin == 0)
        i++;
@@ -1047,7 +1047,7 @@ static void
 psym_expand_symtabs_for_function (struct objfile *objfile,
                                  const char *func_name)
 {
-  for (partial_symtab *ps : require_partial_symbols (objfile, 1))
+  for (partial_symtab *ps : require_partial_symbols (objfile, true))
     {
       if (ps->readin)
        continue;
@@ -1066,7 +1066,7 @@ psym_expand_symtabs_for_function (struct objfile *objfile,
 static void
 psym_expand_all_symtabs (struct objfile *objfile)
 {
-  for (partial_symtab *psymtab : require_partial_symbols (objfile, 1))
+  for (partial_symtab *psymtab : require_partial_symbols (objfile, true))
     psymtab_to_symtab (objfile, psymtab);
 }
 
@@ -1077,7 +1077,7 @@ static void
 psym_expand_symtabs_with_fullname (struct objfile *objfile,
                                   const char *fullname)
 {
-  for (partial_symtab *p : require_partial_symbols (objfile, 1))
+  for (partial_symtab *p : require_partial_symbols (objfile, true))
     {
       /* Anonymous psymtabs don't have a name of a source file.  */
       if (p->anonymous)
@@ -1100,7 +1100,7 @@ psym_map_symbol_filenames (struct objfile *objfile,
                           symbol_filename_ftype *fun, void *data,
                           int need_fullname)
 {
-  for (partial_symtab *ps : require_partial_symbols (objfile, 1))
+  for (partial_symtab *ps : require_partial_symbols (objfile, true))
     {
       const char *fullname;
 
@@ -1181,7 +1181,7 @@ psym_map_matching_symbols
 {
   const int block_kind = global ? GLOBAL_BLOCK : STATIC_BLOCK;
 
-  for (partial_symtab *ps : require_partial_symbols (objfile, 1))
+  for (partial_symtab *ps : require_partial_symbols (objfile, true))
     {
       QUIT;
       if (ps->readin
@@ -1312,7 +1312,7 @@ psym_expand_symtabs_matching
   lookup_name_info lookup_name = lookup_name_in.make_ignore_params ();
 
   /* Clear the search flags.  */
-  for (partial_symtab *ps : require_partial_symbols (objfile, 1))
+  for (partial_symtab *ps : require_partial_symbols (objfile, true))
     ps->searched_flag = PST_NOT_SEARCHED;
 
   for (partial_symtab *ps : objfile->psymtabs ())
@@ -1406,7 +1406,7 @@ psym_find_compunit_symtab_by_address (struct objfile *objfile,
     {
       std::set<CORE_ADDR> seen_addrs;
 
-      for (partial_symtab *pst : require_partial_symbols (objfile, 1))
+      for (partial_symtab *pst : require_partial_symbols (objfile, true))
        {
          psym_fill_psymbol_map (objfile, pst,
                                 &seen_addrs,
@@ -1901,7 +1901,7 @@ maintenance_print_psymbols (const char *args, int from_tty)
        }
       else
        {
-         for (partial_symtab *ps : require_partial_symbols (objfile, 1))
+         for (partial_symtab *ps : require_partial_symbols (objfile, true))
            {
              int print_for_source = 0;
 
@@ -1966,7 +1966,7 @@ maintenance_info_psymtabs (const char *regexp, int from_tty)
           actually find a symtab whose name matches.  */
        int printed_objfile_start = 0;
 
-       for (partial_symtab *psymtab : require_partial_symbols (objfile, 1))
+       for (partial_symtab *psymtab : require_partial_symbols (objfile, true))
          {
            QUIT;
 
@@ -2072,7 +2072,7 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
   int length;
 
   for (objfile *objfile : current_program_space->objfiles ())
-    for (partial_symtab *ps : require_partial_symbols (objfile, 1))
+    for (partial_symtab *ps : require_partial_symbols (objfile, true))
       {
        struct gdbarch *gdbarch = get_objfile_arch (objfile);
 
index 0ad2b49d9a5c03b9a63a36e16cfacdb3d4b88021..a4ac35a7916b12393ea612043cd1a017554af9d7 100644 (file)
@@ -147,11 +147,11 @@ extern const struct quick_symbol_functions dwarf2_gdb_index_functions;
 extern const struct quick_symbol_functions dwarf2_debug_names_functions;
 
 /* Ensure that the partial symbols for OBJFILE have been loaded.  If
-   VERBOSE is non-zero, then this will print a message when symbols
+   VERBOSE is true, then this will print a message when symbols
    are loaded.  This function returns a range adapter suitable for
    iterating over the psymtabs of OBJFILE.  */
 
 extern psymtab_storage::partial_symtab_range require_partial_symbols
-    (struct objfile *objfile, int verbose);
+    (struct objfile *objfile, bool verbose);
 
 #endif /* PSYMTAB_H */
index e6b34bc6b79deaeaaa1af05d6e88842df65a97da..aec07d7a7abd5d3a788b97c69ce6637707e8b6cc 100644 (file)
@@ -809,7 +809,7 @@ read_symbols (struct objfile *objfile, symfile_add_flags add_flags)
        }
     }
   if ((add_flags & SYMFILE_NO_READ) == 0)
-    require_partial_symbols (objfile, 0);
+    require_partial_symbols (objfile, false);
 }
 
 /* Initialize entry point information for this objfile.  */
This page took 0.035476 seconds and 4 git commands to generate.