From: Peter Griffin <peter.griffin@linaro.org>
To: gdb-patches@sourceware.org, palves@redhat.com,
brobecker@adacore.com, kevinb@redhat.com, cagney@gnu.org,
dje@google.com, drow@false.org, kettenis@gnu.org, yao.qi@arm.com,
stanshebs@google.com, Ulrich.Weigand@de.ibm.com,
elena.zannoni@oracle.com, eliz@gnu.org
Cc: peter.griffin@linaro.org, arnez@linux.vnet.ibm.com
Subject: [PATCH] Linux kernel thread runtime support
Date: Thu, 22 Dec 2016 17:34:00 -0000 [thread overview]
Message-ID: <1482427864-4317-1-git-send-email-peter.griffin@linaro.org> (raw)
Hi GDB maintainers,
The following patch implements a Linux kernel thread runtime stratum
which can be used when using GDB to debug a Linux kernel. For example
when connecting to a QEMU GDB stub, or OpenOCD which then communicates
with the target via JTAG or SWD.
This patch is a refactored version based on the 'Linux kernel
debugger' GDB plugin written at STMicroelectronics which used to
be packaged with their JTAG debuggers. There has been some discussion
previously on the list by myself [1], Kieran [2] and one of the original
authors at ST Marc Titinger [3].
This patchset I'm hoping is a lot closer to something which can
be upstreamed to GDB project after some discussion about structure with
Yao Qi at Linaro Connect, the code has been refactored to be structured
much more like the existing upstream thread runtimes (such as
ravenscar-thread.c and sparc-ravenscar-thread etc).
Since the original email [1] various helper commands have also been
migrated into python and merged into the Linux kernel source tree.
The GDB python extensions, combined with the linux-kthread GDB
thread runtime implemented in this patchset provide a powerful
Linux kernel debug solution, and is a working implementation
of what Andreas talked about on slide 17 and 18 of his talk at GNU
Cauldron [4].
I have currently been testing this patchset using mainline GDB debugging
arm-linux kernels in Qemu and via OpenoCD to real hardware. It is straight
forward with the current strructure to add new architecture support, and
I'm looking at adding PowerPC so I can easily validate big endian targets.
What I'm really hoping for now is some patch review on the GDB mailing list
from the GDB maintainers and community with a view to getting this functionality
which has been talked about for quite a few years finally merged to the
upstream GDB project.
All patch review feedback greatfully received :)
kind regards,
Peter.
[1] https://cygwin.com/ml/gdb/2015-09/msg00032.html
[2] https://www.sourceware.org/ml/gdb/2016-01/msg00028.html
[3] https://lists.linaro.org/pipermail/linaro-toolchain/2011-November/001754.html
[4] https://gcc.gnu.org/wiki/cauldron2015?action=AttachFile&do=view&target=Andreas+Arnez_+Debugging+Linux+kernel+dumps+with+GDB.pdf
Peter Griffin (1):
Add Linux kernel thread runtime support.
gdb/ChangeLog | 12 +
gdb/Makefile.in | 8 +-
gdb/arm-linux-kthread.c | 178 +++++
gdb/arm-linux-kthread.h | 27 +
gdb/arm-tdep.c | 4 +
gdb/configure.tgt | 6 +-
gdb/gdbarch.c | 23 +
gdb/gdbarch.h | 5 +
gdb/gdbarch.sh | 3 +
gdb/linux-kthread.c | 1828 +++++++++++++++++++++++++++++++++++++++++++++++
gdb/linux-kthread.h | 223 ++++++
11 files changed, 2311 insertions(+), 6 deletions(-)
create mode 100644 gdb/arm-linux-kthread.c
create mode 100644 gdb/arm-linux-kthread.h
create mode 100644 gdb/linux-kthread.c
create mode 100644 gdb/linux-kthread.h
--
2.7.4
next reply other threads:[~2016-12-22 17:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-22 17:34 Peter Griffin [this message]
2016-12-22 17:34 ` [PATCH] Add " Peter Griffin
[not found] ` <20170111111210.GJ9518@E107787-LIN>
2017-01-20 12:05 ` Peter Griffin
2017-01-03 12:55 ` [PATCH] " Philipp Rudo
2017-01-10 15:56 ` Peter Griffin
2017-01-12 13:02 ` Philipp Rudo
2017-01-25 12:43 ` Peter Griffin
2017-01-26 11:38 ` Philipp Rudo
2017-02-15 16:45 ` Philipp Rudo
2017-02-20 14:48 ` Peter Griffin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1482427864-4317-1-git-send-email-peter.griffin@linaro.org \
--to=peter.griffin@linaro.org \
--cc=Ulrich.Weigand@de.ibm.com \
--cc=arnez@linux.vnet.ibm.com \
--cc=brobecker@adacore.com \
--cc=cagney@gnu.org \
--cc=dje@google.com \
--cc=drow@false.org \
--cc=elena.zannoni@oracle.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=kettenis@gnu.org \
--cc=kevinb@redhat.com \
--cc=palves@redhat.com \
--cc=stanshebs@google.com \
--cc=yao.qi@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox