From patchwork Mon Oct 28 02:03:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 35384 Received: (qmail 69965 invoked by alias); 28 Oct 2019 02:03:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 69749 invoked by uid 89); 28 Oct 2019 02:03:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN autolearn=ham version=3.3.1 spammy=dependencies, packs, cust, sk:build_t X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 28 Oct 2019 02:03:22 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 017DF212F0; Sun, 27 Oct 2019 22:03:20 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id 8FAF820E5E for ; Sun, 27 Oct 2019 22:03:17 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 4D6E420AF6 for ; Sun, 27 Oct 2019 22:03:17 -0400 (EDT) X-Gerrit-PatchSet: 1 Date: Sun, 27 Oct 2019 22:03:17 -0400 From: "Tom Tromey (Code Review)" To: gdb-patches@sourceware.org Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] Change some psymtab fields to bool X-Gerrit-Change-Id: I206761d083493589049ea0bc785ed6542339234d X-Gerrit-Change-Number: 375 X-Gerrit-ChangeURL: X-Gerrit-Commit: 577658874d8ad56c2f1610c6f6c7b46c15f5862d References: Reply-To: tromey@sourceware.org, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-74-g460fb0f7e9 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/375 ...................................................................... Change some psymtab fields to bool This changes a few fields in partial_symtab to have type bool. gdb/ChangeLog 2019-10-27 Tom Tromey * xcoffread.c (xcoff_psymtab_to_symtab_1): Update. * psymtab.c (psym_print_stats): Update. * psympriv.h (struct partial_symtab) : Now bool. * mdebugread.c (psymtab_to_symtab_1): Update. * dwarf2read.c (create_type_unit_group, create_partial_symtab) (build_type_psymtabs_reader, psymtab_to_symtab_1) (process_full_comp_unit, process_full_type_unit): Update. * dbxread.c (dbx_psymtab_to_symtab_1): Update. * ctfread.c (psymtab_to_symtab): Update. Change-Id: I206761d083493589049ea0bc785ed6542339234d --- M gdb/ChangeLog M gdb/ctfread.c M gdb/dbxread.c M gdb/dwarf2read.c M gdb/mdebugread.c M gdb/psympriv.h M gdb/psymtab.c M gdb/xcoffread.c 8 files changed, 30 insertions(+), 17 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3657495..c2831e7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,18 @@ 2019-10-27 Tom Tromey + * xcoffread.c (xcoff_psymtab_to_symtab_1): Update. + * psymtab.c (psym_print_stats): Update. + * psympriv.h (struct partial_symtab) : Now bool. + * mdebugread.c (psymtab_to_symtab_1): Update. + * dwarf2read.c (create_type_unit_group, create_partial_symtab) + (build_type_psymtabs_reader, psymtab_to_symtab_1) + (process_full_comp_unit, process_full_type_unit): Update. + * dbxread.c (dbx_psymtab_to_symtab_1): Update. + * ctfread.c (psymtab_to_symtab): Update. + +2019-10-27 Tom Tromey + * mdebugread.c (parse_partial_symbols): Use discard_psymtab. * psymtab.h (class psymtab_storage) : Remove. * psymtab.c (psymtab_storage): Delete psymtabs. diff --git a/gdb/ctfread.c b/gdb/ctfread.c index 44ccff6..90a1b8c 100644 --- a/gdb/ctfread.c +++ b/gdb/ctfread.c @@ -1233,7 +1233,7 @@ set_symbol_address (ccp->of, sym, SYMBOL_LINKAGE_NAME (sym)); } - pst->readin = 1; + pst->readin = true; } /* Expand partial symbol table PST into a full symbol table. diff --git a/gdb/dbxread.c b/gdb/dbxread.c index bbef372..3f20ba9 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -2110,7 +2110,7 @@ read_ofile_symtab (objfile, pst); } - pst->readin = 1; + pst->readin = true; } /* Read in all of the symbols for a given psymtab for real. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 4372a47..15c6f9d 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -7902,7 +7902,7 @@ name = string_printf ("", line_offset); pst = create_partial_symtab (per_cu, name.c_str ()); - pst->anonymous = 1; + pst->anonymous = true; } tu_group->hash.dwo_unit = cu->dwo_unit; @@ -7986,7 +7986,7 @@ pst = start_psymtab_common (objfile, name, 0); - pst->psymtabs_addrmap_supported = 1; + pst->psymtabs_addrmap_supported = true; /* This is the glue that links PST into GDB's symbol API. */ pst->read_symtab_private = per_cu; @@ -8212,7 +8212,7 @@ prepare_one_comp_unit (cu, type_unit_die, language_minimal); pst = create_partial_symtab (per_cu, ""); - pst->anonymous = 1; + pst->anonymous = true; first_die = load_partial_dies (reader, info_ptr, 1); @@ -9698,7 +9698,7 @@ { /* It's an include file, no symbols to read for it. Everything is in the parent symtab. */ - pst->readin = 1; + pst->readin = true; return; } @@ -10470,7 +10470,7 @@ { struct partial_symtab *pst = per_cu->v.psymtab; pst->compunit_symtab = cust; - pst->readin = 1; + pst->readin = true; } /* Push it for inclusion processing later. */ @@ -10550,7 +10550,7 @@ { struct partial_symtab *pst = per_cu->v.psymtab; pst->compunit_symtab = cust; - pst->readin = 1; + pst->readin = true; } /* Not needed any more. */ diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 08970d1..01eedbd 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -3861,7 +3861,7 @@ if (pst->readin) return; - pst->readin = 1; + pst->readin = true; /* Read in all partial symtabs on which this one is dependent. NOTE that we do have circular dependencies, sigh. We solved diff --git a/gdb/psympriv.h b/gdb/psympriv.h index 87a2928..923d9fa 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -241,21 +241,21 @@ int statics_offset = 0; int n_static_syms = 0; - /* Non-zero if the symtab corresponding to this psymtab has been - readin. This is located here so that this structure packs better - on 64-bit systems. */ + /* True if the symtab corresponding to this psymtab has been readin. + This is located here so that this structure packs better on + 64-bit systems. */ - unsigned char readin = 0; + bool readin = false; /* True iff objfile->psymtabs_addrmap is properly populated for this partial_symtab. For discontiguous overlapping psymtabs is the only usable info in PSYMTABS_ADDRMAP. */ - unsigned char psymtabs_addrmap_supported = 0; + bool psymtabs_addrmap_supported = false; /* True if the name of this partial symtab is not a source file name. */ - unsigned char anonymous = 0; + bool anonymous = false; /* A flag that is temporarily used when searching psymtabs. */ diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 901d7a5..750d350 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1006,7 +1006,7 @@ i = 0; for (partial_symtab *ps : require_partial_symbols (objfile, 1)) { - if (ps->readin == 0) + if (!ps->readin) i++; } printf_filtered (_(" Number of psym tables (not yet expanded): %d\n"), i); diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index bc48773..2d7ff75 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -1864,7 +1864,7 @@ read_xcoff_symtab (objfile, pst); } - pst->readin = 1; + pst->readin = true; } /* Read in all of the symbols for a given psymtab for real.