This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Typedef support for linespecs


Hi,

CVS HEAD currently fails if a user does something like:

class foo
{
public:
  void a_function (void) { }
};
typedef MyFoo foo;
MyFoo instance;

(gdb) list MyFoo::a_function

This happens because when we lookup "MyFoo", lookup_prefix_sym will only search STRUCT_DOMAIN, and it won't find "MyFoo", since typedefs live in VAR_DOMAIN.

The attached patch attempts to address this issue by searching VAR_DOMAIN if the search through STRUCT_DOMAIN fails.

[In case I am not always explicit: This patch introduces no regressions or failures/errors of any kind with the test suite on x86 linux.]

Comments/Questions/Concerns?
Keith

ChangeLog
2009-11-11  Keith Seitz  <keiths@redhat.com>

	* linespec.c (lookup_prefix_sym): Lookup the symbol
	in both STRUCT_DOMAIN and VAR_DOMAIN.

testsuite/ChangeLog
2009-11-11  Keith Seitz  <keiths@redhat.com>

	* gdb.cp/classes.cc (ByAnyOtherName): Add typedef and
	use it instead of "Foo".
	* gdb.cp/classes.exp (do_tests): Add a test to access
	a method through a typedef'd class name.

Attachment: linespec-typedef.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]