This is the mail archive of the
archer-commits@sourceware.org
mailing list for the Archer project.
[SCM] archer-tromey-optional-psymtab: Handle currently_reading_symtab
- From: tromey at sourceware dot org
- To: archer-commits at sourceware dot org
- Date: 23 Nov 2009 18:31:41 -0000
- Subject: [SCM] archer-tromey-optional-psymtab: Handle currently_reading_symtab
The branch, archer-tromey-optional-psymtab has been updated
via 53fe6455c692982567186798cadb0b80763bb4a1 (commit)
from 4c3d8306e0852d49931bb34579baa4206fc258f3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit 53fe6455c692982567186798cadb0b80763bb4a1
Author: Tom Tromey <tromey@redhat.com>
Date: Mon Nov 23 11:31:05 2009 -0700
Handle currently_reading_symtab
-----------------------------------------------------------------------
Summary of changes:
gdb/dwarf2read.c | 1 +
gdb/psymtab.c | 12 +-----------
gdb/symfile.c | 19 +++++++++++++++++++
gdb/symfile.h | 2 ++
4 files changed, 23 insertions(+), 11 deletions(-)
First 500 lines of diff:
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 644a1a2..bcbb30e 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1657,6 +1657,7 @@ dw2_instantiate_symtab (struct objfile *objfile,
if (!per_cu->v.quick->symtab)
{
struct cleanup *back_to = make_cleanup (free_cached_comp_units, NULL);
+ increment_reading_symtab ();
dw2_do_instantiate_symtab (objfile, per_cu);
do_cleanups (back_to);
}
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 0e10889..98c312a 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -526,16 +526,6 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name,
return (NULL);
}
-/* True if we are nested inside psymtab_to_symtab. */
-
-int currently_reading_symtab = 0;
-
-static void
-decrement_reading_symtab (void *dummy)
-{
- currently_reading_symtab--;
-}
-
/* Get the symbol table that corresponds to a partial_symtab.
This is fast after the first time you do it. In fact, there
is an even faster macro PSYMTAB_TO_SYMTAB that does the fast
@@ -551,7 +541,7 @@ psymtab_to_symtab (struct partial_symtab *pst)
/* If it has not yet been read in, read it. */
if (!pst->readin)
{
- struct cleanup *back_to = make_cleanup (decrement_reading_symtab, NULL);
+ struct cleanup *back_to = increment_reading_symtab ();
currently_reading_symtab++;
(*pst->read_symtab) (pst);
do_cleanups (back_to);
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 75fbee6..9ada4bc 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -233,6 +233,25 @@ obconcat (struct obstack *obstackp, const char *s1, const char *s2,
return val;
}
+/* True if we are reading a symbol table. */
+
+int currently_reading_symtab = 0;
+
+static void
+decrement_reading_symtab (void *dummy)
+{
+ currently_reading_symtab--;
+}
+
+/* Increment currently_reading_symtab and return a cleanup that can be
+ used to decrement it. */
+struct cleanup *
+increment_reading_symtab (void)
+{
+ ++currently_reading_symtab;
+ return make_cleanup (decrement_reading_symtab, NULL);
+}
+
/* Remember the lowest-addressed loadable section we've seen.
This function is called via bfd_map_over_sections.
diff --git a/gdb/symfile.h b/gdb/symfile.h
index cf35538..cbea9ca 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -531,6 +531,8 @@ extern int symfile_map_offsets_to_segments (bfd *,
struct symfile_segment_data *get_symfile_segment_data (bfd *abfd);
void free_symfile_segment_data (struct symfile_segment_data *data);
+extern struct cleanup *increment_reading_symtab (void);
+
/* From dwarf2read.c */
extern int dwarf2_has_info (struct objfile *);
hooks/post-receive
--
Repository for Project Archer.