GDB support for thread-local storage

Jim Blandy
Wed Jun 19 12:20:00 GMT 2002

Daniel Berlin <> writes:
> > Unfortunately, Dwarf 2 location expressions cannot perform function
> > calls in the inferior. 
> Errr, buzz.
> See DW_OP_call_*  in dwarf3

(As I wrote that sentence, I was wondering whether I should clarify
this point.)

The function one may need to invoke to find thread-local storage,
__tls_get_addr, is an actual native code function, in the dynamic
linker.  The DW_OP_call_* operations allow a Dwarf expression to call
another Dwarf expression like a function.  But you can't use the
DW_OP_call_* operations to invoke machine-language functions in the

> It's not just turing complete anymore, one could probably write useful 
> application extensions in dwarf3.
> Scary.

I thought so too, but then I noticed that there are no memory store
operations.  You can do stuff on the stack, but you can't modify
memory, or do any I/O.  Grave omissions, which should be rectified

More information about the Gdb mailing list