This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC PATCH 0/4] GDB Linux Kernel Thread Awareness


I've wanted to get some actual code out for a while and as such I have
tried to strip down the implementation of LKD to the bare essentials for
implementing thread awareness. I hope to get some feedback on the best ways of
upstreaming this functionality.

This functionality implements the 'possible improvements' Related to Execution
Contexts as mentioned in Andreas' slides on slide 18 [1] and allows a user
to perform 'info threads' and see the currently running and sleeping tasks.
Switching to a specific task, then functions as expected with 'thread NN', and
'bt' to produce a back trace of that thread.

Indeed this patch set hopes to satisfy Andreas' request in [2] to submit a
small patchset of the initial features. In this case, the thread awareness.

Now that I have separated out the LKD code from the ST's internal STMC code,
it could also be possible to publish the larger project if it is of relevance,
though that will be heavier reading than this reduced patch.

This implementation is in C and heavily derived from the implementation
created by ST, as the aim of the upstreaming project is to reuse as much
of the ST implementation as is reasonable.

The python-ic version of this that I've been working on (gdb.Target) hits a
few problems, in guarding against infinite recursion as many of the python
API's end up calling back into the target layer, and exceptions in that layer
tend to make GDB crash in very un-user-friendly ways.

Being already in possesion of a working implementation in C, it seemed natural
to at least post this for review and consideration to discuss the best ways in
moving forwards (i.e. continuing with C, or pursue the Python implementation)

Granted, there is one known nasty bug in this implementation highlighted in
the commit log of the main patch, but I didn't see this bug as a blocker to
discussion!. Knowing which way the community is swaying towards will help me
prioritise and tackle the issues in the preferred implementation :-)

For ease of access/replication, this patch set is also hosted at:

 URL: http://git.linaro.org/people/kieran.bingham/binutils-gdb.git
 TAG: 2016-02-25-LKD-thread-aware-c-gdb-submission

As a final note, I will be attending ELC San Diego, and I have a presentation
slot to discuss this project (I guess I'll have to write some slides). If
anyone is expecting to attend, and would like to discuss this topic more at the
conference please let me know. If there are enough interested parties attending
we can organise some form of BoF to discuss without the usual rush of 5 minutes
Q+A time at the end of a presentation slot.

[1] https://gcc.gnu.org/wiki/cauldron2015?action=AttachFile&do=view&target=Andreas+Arnez_+Debugging+Linux+kernel+dumps+with+GDB.pdf
[2] https://www.sourceware.org/ml/gdb/2015-10/msg00006.html

Kieran Bingham (4):
  gdb/observer: Provide target_thread_changed observer
  gdb/command: Add LKD Command class
  gdb/lkd: Add Linux Kernel Awareness target
  lkd: Add an Architecture Layer for ARMv7 targets

 gdb/Makefile.in       |   26 +-
 gdb/command.h         |    2 +-
 gdb/config.in         |    3 +
 gdb/configure         |   23 +
 gdb/configure.ac      |   15 +
 gdb/configure.tgt     |   12 +
 gdb/doc/observer.texi |    5 +
 gdb/lkd/lkd-arm.c     |  312 +++++++
 gdb/lkd/lkd-main.c    | 2160 +++++++++++++++++++++++++++++++++++++++++++++++++
 gdb/lkd/lkd-process.c |  892 ++++++++++++++++++++
 gdb/lkd/lkd-process.h |   63 ++
 gdb/lkd/lkd.h         |  486 +++++++++++
 gdb/remote.c          |    4 +
 13 files changed, 3999 insertions(+), 4 deletions(-)
 create mode 100644 gdb/lkd/lkd-arm.c
 create mode 100644 gdb/lkd/lkd-main.c
 create mode 100644 gdb/lkd/lkd-process.c
 create mode 100644 gdb/lkd/lkd-process.h
 create mode 100644 gdb/lkd/lkd.h

-- 
2.5.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]