[lkml]   [2009]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectdebugging threaded apps running under a clone(CLONE_NEWPID)
Hello !

to debug threaded apps, gdb uses a special libthread_db which seeks in the
symbols of the exec the list of running threads. This list contains the glibc
'struct pthread' descriptor with pids and tids which values are relative
to the namespace in which the threads were created.

unless you run gdb in the same pid namespace, gdb will not see any thread
in the debugged app. this is frustrating for some scenarios and some
support from the kernel would be needed to address this issue. Here
are some ideas :

. enter a pid namespace. hard.

. expose the pid numbers of a task in its pid namespaces, through some
ways like /proc/self/stat or /proc/self/pids and modify gdb to make
the conversion.

How would you do it ?



 \ /
  Last update: 2009-02-20 17:59    [W:0.061 / U:0.868 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site