This is the mail archive of the gdb@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]

How to find type when same type name is used more than once?


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


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