This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
How to find type when same type name is used more than once?
- From: Johan Erlandsson <jeoerl at gmail dot com>
- To: gdb at sourceware dot org
- Date: Mon, 7 Nov 2016 20:17:11 +0100
- Subject: How to find type when same type name is used more than once?
- Authentication-results: sourceware.org; auth=none
Hi
I have problem to deterministic find correct type in GDB, since the
same name 'some_type' is used for two different types. The type I am
looking for is only used as parameter and local variable.
I have observed different behavior depending on core file and build.
So when changing (core,build) I can get different result when running:
(gdb) ptype some_type
I can get either of the two types. From 'info types' I always see both.
(gdb) info types some_type
File a.h:
some_type;
File b.cpp:
some_type;
I am aware of this syntax for variables:
(gdb) p 'includefile'::some_global
Now I am looking for something similar but for types.
>From python I tried this function,
gdb.lookup_type (name [, block])
For block I used one of the functions that takes the wanted
'some_type' as a parameter. But this didn't help.
Any ideas how I can find the type that belong to a specific file?
Regards
Johan