aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/cp-namespace.c5
-rw-r--r--gdb/elfread.c7
-rw-r--r--gdb/testsuite/ChangeLog8
-rw-r--r--gdb/testsuite/gdb.cp/m-static.cc4
-rw-r--r--gdb/testsuite/gdb.cp/m-static.exp5
6 files changed, 36 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4d608f5..2d911aa 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,13 @@
+2013-03-14 Keith Seitz <keiths@redhat.com>
+ Alan Matsuoka <alanm@redhat.com>
+
+ PR c++/15203
+ PR c++/15210
+ * cp-namespace.c (cp_lookup_nested_symbol): Handle TYPE_CODE_FUNC and
+ TYPE_CODE_METHOD.
+ * elfread.c (elf_symtab_read): Handle BSF_GNU_UNIQUE for certain
+ symbols.
+
2013-03-14 Yao Qi <yao@codesourcery.com>
* tracepoint.c (tfile_write_status): Write 'stop_desc' of trace
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 279021e..add4ccb 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -812,6 +812,11 @@ cp_lookup_nested_symbol (struct type *parent_type,
base classes. */
return find_symbol_in_baseclass (parent_type, nested_name, block);
}
+
+ case TYPE_CODE_FUNC:
+ case TYPE_CODE_METHOD:
+ return NULL;
+
default:
internal_error (__FILE__, __LINE__,
_("cp_lookup_nested_symbol called "
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 6ab3a6a..14952b8 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -357,7 +357,8 @@ elf_symtab_read (struct objfile *objfile, int type,
}
else if (sym->flags & BSF_SECTION_SYM)
continue;
- else if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK))
+ else if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK
+ | BSF_GNU_UNIQUE))
{
struct minimal_symbol *msym;
@@ -413,7 +414,7 @@ elf_symtab_read (struct objfile *objfile, int type,
}
else if (sym->section->flags & SEC_CODE)
{
- if (sym->flags & (BSF_GLOBAL | BSF_WEAK))
+ if (sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_GNU_UNIQUE))
{
if (sym->flags & BSF_GNU_INDIRECT_FUNCTION)
ms_type = mst_text_gnu_ifunc;
@@ -443,7 +444,7 @@ elf_symtab_read (struct objfile *objfile, int type,
}
else if (sym->section->flags & SEC_ALLOC)
{
- if (sym->flags & (BSF_GLOBAL | BSF_WEAK))
+ if (sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_GNU_UNIQUE))
{
if (sym->section->flags & SEC_LOAD)
{
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index f4863a1..8dac760 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2013-03-14 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ PR c++/15203
+ PR c++/15210
+ * gdb.cp/m-static.cc (keepalive_int): New function.
+ (gnu_obj_1::method): New variable `sintvar', call `keepalive_int'.
+ * gdb.cp/m-static.exp: New test for `sintvar'.
+
2013-03-14 Yao Qi <yao@codesourcery.com>
* gdb.trace/tstatus.exp (run_trace_experiment): Save the output
diff --git a/gdb/testsuite/gdb.cp/m-static.cc b/gdb/testsuite/gdb.cp/m-static.cc
index 8472988..eadbdfc 100644
--- a/gdb/testsuite/gdb.cp/m-static.cc
+++ b/gdb/testsuite/gdb.cp/m-static.cc
@@ -3,6 +3,7 @@
enum region { oriental, egyptian, greek, etruscan, roman };
void keepalive(bool *var) { }
+void keepalive_int (int *var) { }
// Test one.
class gnu_obj_1
@@ -21,8 +22,11 @@ public:
long method ()
{
+ static int sintvar = 4;
static bool svar = true;
+
keepalive (&svar);
+ keepalive_int (&sintvar);
return key2;
}
};
diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp
index ae4b2ad..5d1cb8b 100644
--- a/gdb/testsuite/gdb.cp/m-static.exp
+++ b/gdb/testsuite/gdb.cp/m-static.exp
@@ -52,6 +52,11 @@ gdb_continue_to_breakpoint "end of constructors"
# One.
+# simple object, static const int, accessing via 'class::method::variable'
+# Regression test for PR c++/15203 and PR c++/15210
+gdb_test "print 'gnu_obj_1::method()::sintvar'" "\\$\[0-9\]+ = 4" \
+ "simple object, static const int, accessing via 'class::method::variable"
+
# simple object, static const bool
gdb_test "print test1.test" "\\$\[0-9\]* = true" "simple object, static const bool"