RFC GDB Linux Awareness analysis

Yao Qi qiyaoltc@gmail.com
Thu Oct 1 09:25:00 GMT 2015


Peter Griffin <peter.griffin@linaro.org> writes:

> Does anyone have experience / thoughts on how often the existing threading
> implementations that are already inside GDB break? Presumably these are also
> tightly coupled to parsing out of tree data structures (or the libraries which
> GDB relies on to do this).

It shouldn't break in any case.  There are some conventions in these
thread libraries to make it debuggable.  In glibc NPTL,
__nptl_create_event should be called after a thread is created.  GDB
relies on this, and set a breakpoint on it to monitor the thread
creation.  In AIX thread lib, GDB replies on the symbol name returned by
pthdb_session_pthreaded, and set a breakpoint on it similarly.

We need linux kernel to have such convention with GDB, that is, a
function is called after a thread is created, and the function name
shouldn't be changed across different version of kernels.

-- 
Yao (齐尧)



More information about the Gdb mailing list