This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: how to search for a global type?
- From: Gary Funck <gary at intrepid dot com>
- To: GDB List <gdb at sources dot redhat dot com>
- Date: Tue, 1 Jan 2008 21:16:26 -0800
- Subject: Re: how to search for a global type?
- References: <20071231042844.GA18814@intrepid.com> <20080102031750.GA27872@caradoc.them.org>
On 01/01/08 22:17:50, Daniel Jacobowitz wrote:
> On Sun, Dec 30, 2007 at 08:28:44PM -0800, Gary Funck wrote:
>
> Are types global, or do they usually end up in the file's static
> block? I'd guess the latter. Check maint print symbols.
Not sure (excerpt from maint print symbols follows). The typedef
is defined in the runtime, not in the main source file. Thus,
if I run up until "main" and try "maint print symbols", I don't
see the typedef at all. If I position to one of the runtime
source files, then the typedef appears in the maint print
symbols output as below:
Symtab for file /upc/gcc-upc-4/src/libupc/smp/upc_access.c
Read from object file /upc/gdb-upc/wrk/a.out (0x954630)
Language: c++
[...]
block #000, object at 0xb40a30, 9 syms/buckets in 0x4015d8..0x4022bf, compiled with gcc2
float __getsf2(upc_shared_ptr_t); block object 0xb363c0, 0x4017ff..0x401836
void __putblk3(upc_shared_ptr_t, void *, size_t); block object 0xb3b0a0, 0x401b40..0x401b75
[...]
int THREADS; unresolved
long unsigned int __upc_page1_ref; unresolved
void *__upc_page1_base; unresolved
block #001, object at 0xb40990 under 0xb40a30, 6 syms/buckets in 0x4015d8..0x4022bf, compiled with gcc2
typedef long unsigned int size_t;
typedef signed char signed char;
typedef long int long int;
[...]
typedef short unsigned int short unsigned int;
typedef struct shared_ptr_struct {
long unsigned int phase : 48;
short unsigned int thread : 16;
void *vaddr;
} upc_shared_ptr_t;
^^^^^^^^^^^^^^^^^ typedef we're looking for
The typedef appears to be in inner block. Does that make it static?