aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2009-11-09 21:39:40 +0000
committerCary Coutant <ccoutant@google.com>2009-11-09 21:39:40 +0000
commitde4affc9ce437b80590f9551fd60d93a16a16e71 (patch)
treee10a0c6a669882e410e38630e5ddec9a4d954c63
parent86c6265d62c78d255c648eb33242ed74ec58772d (diff)
downloadgdb-de4affc9ce437b80590f9551fd60d93a16a16e71.zip
gdb-de4affc9ce437b80590f9551fd60d93a16a16e71.tar.gz
gdb-de4affc9ce437b80590f9551fd60d93a16a16e71.tar.bz2
* dwarf2read.c (read_import_statement): Don't clobber original cu.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/dwarf2read.c8
2 files changed, 9 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1fe42c6..54d557a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2009-11-09 Cary Coutant <ccoutant@google.com>
+
+ * dwarf2read.c (read_import_statement): Don't clobber original cu.
+
2009-11-09 Tom Tromey <tromey@redhat.com>
* python/python.c (execute_gdb_command): Copy the argument text.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index b3bb899..5c9f3b8 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -3372,6 +3372,7 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
{
struct attribute *import_attr;
struct die_info *imported_die;
+ struct dwarf2_cu *imported_cu;
const char *imported_name;
const char *imported_name_prefix;
const char *import_prefix;
@@ -3385,8 +3386,9 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
return;
}
- imported_die = follow_die_ref_or_sig (die, import_attr, &cu);
- imported_name = dwarf2_name (imported_die, cu);
+ imported_cu = cu;
+ imported_die = follow_die_ref_or_sig (die, import_attr, &imported_cu);
+ imported_name = dwarf2_name (imported_die, imported_cu);
if (imported_name == NULL)
{
/* GCC bug: https://bugzilla.redhat.com/show_bug.cgi?id=506524
@@ -3431,7 +3433,7 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
/* Figure out what the scope of the imported die is and prepend it
to the name of the imported die. */
- imported_name_prefix = determine_prefix (imported_die, cu);
+ imported_name_prefix = determine_prefix (imported_die, imported_cu);
if (strlen (imported_name_prefix) > 0)
{