]> git.baikalelectronics.ru Git - kernel.git/commit
kgdb: fix gdb serial thread queries
authorJason Wessel <jason.wessel@windriver.com>
Fri, 1 Aug 2008 13:39:35 +0000 (08:39 -0500)
committerJason Wessel <jason.wessel@windriver.com>
Fri, 1 Aug 2008 13:39:35 +0000 (08:39 -0500)
commitd4b8c1e0c171b0c838eb0032836bb720e48bd1c4
tree2785851665dccc753e9e6cf0de650be72e56d7de
parent69bb17e8b44149754b7372bf74f98b9712f2d938
kgdb: fix gdb serial thread queries

The command "info threads" did not work correctly with kgdb.  It would
result in a silent kernel hang if used.

This patach addresses several problems.
 - Fix use of deprecated NR_CPUS
 - Fix kgdb to not walk linearly through the pid space
 - Correctly implement shadow pids
 - Change the threads per query to a #define
 - Fix kgdb_hex2long to work with negated values

The threads 0 and -1 are reserved to represent the current task.  That
means that CPU 0 will start with a shadow thread id of -2, and CPU 1
will have a shadow thread id of -3, etc...

From the debugger you can switch to a shadow thread to see what one of
the other cpus was doing, however it is not possible to execute run
control operations on any other cpu execept the cpu executing the
kgdb_handle_exception().

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
kernel/kgdb.c