Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas De Schampheleire <patrickdepinguin@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCHv2 0/3] Fix gdb pretty printers for libstdcxx
Date: Tue,  8 Jun 2021 17:18:36 +0200	[thread overview]
Message-ID: <20210608151840.20917-1-patrickdepinguin@gmail.com> (raw)

From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>

Hello,

This series fixes the gdb pretty printers for libstdcxx, provided by gcc.

Patch 1 fixes a segfault in gdb 9.2 when Python 3 support is enabled. The fix is
already present in gdb 10.1+.

Patch 2 makes sure that the auto-load file provided by gcc for libstdcxx
pretty-printers, is using valid paths, rather than the paths the external
toolchain was built with.

Finally, patch 3 makes sure that gdb will actually load the fixed auto-load
file, by adding the buildroot sysroot as a 'safe path' in gdbinit.


After this series, it suffices to start up gdb, load the buildroot-provided
gdbinit file, and start debugging a binary. From the moment libstdcxx.so is
loaded, gdb will automatically load the pretty-printer file. Printing C++ STL
objects like std::map, std::vector, etc. will now be shown in the 'pretty'
manner. In order to show the 'raw' object without pretty-printing, use the '/r'
modifier to the 'print' command.

Note: the pretty-printing logic is written in Python, so Python support for
host-gdb needs to be enabled.

Best regards,
Thomas

---
v2:
- handle cases with more than one loadfile and more than one pythondir
- make command silent with $(Q)

Thomas De Schampheleire (3):
  package/gdb: fix gdb 9.2 segfault with Python 3.9 support
  toolchain/toolchain-external: fixup gdb pretty-printer loader for
    libstdcxx
  toolchain: mark sysroot as 'safe' path for gdb auto-load

 ...x-Python3.9-related-runtime-problems.patch | 227 ++++++++++++++++++
 toolchain/helpers.mk                          |   3 +-
 .../pkg-toolchain-external.mk                 |  21 ++
 3 files changed, 250 insertions(+), 1 deletion(-)
 create mode 100644 package/gdb/9.2/0007-Fix-Python3.9-related-runtime-problems.patch

-- 
2.26.3

             reply	other threads:[~2021-06-08 15:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 15:18 Thomas De Schampheleire [this message]
2021-06-08 15:18 ` [Buildroot] [PATCHv2 1/3] package/gdb: fix gdb 9.2 segfault with Python 3.9 support Thomas De Schampheleire
2021-07-25 21:21   ` Thomas Petazzoni
2021-08-05 11:10   ` Peter Korsgaard
2021-06-08 15:18 ` [Buildroot] [PATCHv2 2/3] toolchain/toolchain-external: fixup gdb pretty-printer loader for libstdcxx Thomas De Schampheleire
2021-07-25 21:23   ` Thomas Petazzoni
2021-06-08 15:18 ` [Buildroot] [PATCHv2 3/3] toolchain: mark sysroot as 'safe' path for gdb auto-load Thomas De Schampheleire
2021-07-25 21:23   ` Thomas Petazzoni

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=20210608151840.20917-1-patrickdepinguin@gmail.com \
    --to=patrickdepinguin@gmail.com \
    --cc=buildroot@busybox.net \
    /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