public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Simplify setting of reading_partial_symbols
Date: Mon, 24 Feb 2020 23:00:00 -0000	[thread overview]
Message-ID: <20200224230029.92259.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7693576838f4fe66b2a2380425b5ad950c671b34

commit 7693576838f4fe66b2a2380425b5ad950c671b34
Author: Tom Tromey <tom@tromey.com>
Date:   Mon Feb 24 15:50:57 2020 -0700

    Simplify setting of reading_partial_symbols
    
    This simplifies the setting and clearing of reading_partial_symbols,
    by using scoped_restore in the function that reads partial symbols.
    
    gdb/ChangeLog
    2020-02-24  Tom Tromey  <tom@tromey.com>
    
    	* dwarf2read.c (dwarf2_build_psymtabs_hard): Use
    	make_scoped_restore.
    	(dwarf2_psymtab::read_symtab): Don't clear
    	reading_partial_symbols.

Diff:
---
 gdb/ChangeLog     | 7 +++++++
 gdb/dwarf2/read.c | 6 +++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 43ae8e8..044a192 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2020-02-24  Tom Tromey  <tom@tromey.com>
+
+	* dwarf2read.c (dwarf2_build_psymtabs_hard): Use
+	make_scoped_restore.
+	(dwarf2_psymtab::read_symtab): Don't clear
+	reading_partial_symbols.
+
 2020-02-24  Tom de Vries  <tdevries@suse.de>
 
 	PR gdb/25592
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 46d510e..701d19e 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -7718,7 +7718,9 @@ dwarf2_build_psymtabs_hard (struct dwarf2_per_objfile *dwarf2_per_objfile)
 			  objfile_name (objfile));
     }
 
-  dwarf2_per_objfile->reading_partial_symbols = 1;
+  scoped_restore restore_reading_psyms
+    = make_scoped_restore (&dwarf2_per_objfile->reading_partial_symbols,
+			   true);
 
   dwarf2_per_objfile->info.read (objfile);
 
@@ -8692,8 +8694,6 @@ dwarf2_psymtab::read_symtab (struct objfile *objfile)
 	= dpo_backlink->has_section_at_zero;
     }
 
-  dwarf2_per_objfile->reading_partial_symbols = 0;
-
   expand_psymtab (objfile);
 
   process_cu_includes (dwarf2_per_objfile);


                 reply	other threads:[~2020-02-24 23:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200224230029.92259.qmail@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).