mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2024-12-17 17:17:19 +00:00
Fix PR 11992: C++ 'this' scope sometimes does not work
2010-09-13 Sami Wagiaalla <swagiaal@redhat.com> PR symtab/11992: * c-exp.y (classify_name): Check is_a_member_of_this before returning UNKNOWN_CPP_NAME. 2010-09-13 Sami Wagiaalla <swagiaal@redhat.com> * gdb.cp/koenig.cc: created class for testing member lookup. * gdb.cp/koenig.exp: Added test for member lookup.
This commit is contained in:
parent
1aee700988
commit
450ca57cac
@ -1,3 +1,9 @@
|
||||
2010-09-13 Sami Wagiaalla <swagiaal@redhat.com>
|
||||
|
||||
PR symtab/11992:
|
||||
* c-exp.y (classify_name): Check is_a_member_of_this before returning
|
||||
UNKNOWN_CPP_NAME.
|
||||
|
||||
2010-09-13 Joel Brobecker <brobecker@adacore.com>
|
||||
|
||||
* NEWS: Add x86-lynxos to the list of platforms supported by
|
||||
|
@ -2389,6 +2389,7 @@ classify_name (struct block *block)
|
||||
|
||||
if (sym == NULL
|
||||
&& parse_language->la_language == language_cplus
|
||||
&& !is_a_field_of_this
|
||||
&& !lookup_minimal_symbol (copy, NULL, NULL))
|
||||
return UNKNOWN_CPP_NAME;
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
2010-09-13 Sami Wagiaalla <swagiaal@redhat.com>
|
||||
|
||||
* gdb.cp/koenig.cc: created class for testing member lookup.
|
||||
* gdb.cp/koenig.exp: Added test for member lookup.
|
||||
|
||||
2010-09-13 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Fix false FAILs on sourcetree topdir directory containing "kill".
|
||||
|
@ -226,6 +226,16 @@ namespace P {
|
||||
|
||||
//------------
|
||||
|
||||
class R {
|
||||
public:
|
||||
int rfoo(){ return 31; }
|
||||
int rbar(){
|
||||
return 1; // marker1
|
||||
}
|
||||
};
|
||||
|
||||
//------------
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
@ -299,6 +309,10 @@ main ()
|
||||
|
||||
++q;
|
||||
|
||||
R r;
|
||||
r.rbar();
|
||||
r.rfoo();
|
||||
|
||||
return first (0, c) + foo (eo) +
|
||||
foo (eo, eo) + foo (eo, eo, 1) +
|
||||
foo (fo, eo) + foo (1 ,fo, eo) +
|
||||
|
@ -115,3 +115,14 @@ gdb_test "p q + 5" "= 29"
|
||||
# some unary operators for good measure
|
||||
# Cannot resolve function operator++ to any overloaded instance
|
||||
gdb_test "p ++q" "= 30"
|
||||
|
||||
# Test that koening lookup does not affect
|
||||
# member variable lookup.
|
||||
gdb_test "p r.rfoo()" "= 31"
|
||||
|
||||
# Do the same from inside class R.
|
||||
gdb_breakpoint [gdb_get_line_number "marker1"]
|
||||
gdb_continue_to_breakpoint "marker1"
|
||||
|
||||
gdb_test "p rfoo()" "= 31"
|
||||
gdb_test "p this->rfoo()" "= 31"
|
||||
|
Loading…
Reference in New Issue
Block a user