From: Thomas De Schampheleire <patrickdepinguin@gmail.com>
To: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>,
Giulio Benetti <giulio.benetti@benettiengineering.com>,
Romain Naour <romain.naour@gmail.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
buildroot <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH 2/2] toolchain/helpers.mk: gdbinit: set auto-load-safe-path before sysroot
Date: Wed, 22 Sep 2021 11:10:29 +0200 [thread overview]
Message-ID: <CAAXf6LUGQ54q35i8nY9mfTKbEjTUBnObwMSfz5PNXF9wHWSSGw@mail.gmail.com> (raw)
In-Reply-To: <1d202363-484d-cc2a-818f-2b1b4fb7b358@mind.be>
Hi Arnout,
El mar, 21 sept 2021 a las 22:46, Arnout Vandecappelle
(<arnout@mind.be>) escribió:
>
>
>
> On 13/09/2021 09:29, Thomas De Schampheleire wrote:
> > From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> >
> > The gdbinit supplied by Buildroot does two things:
> > A. specify the sysroot where gdb can find shared libraries
> > B. mark the sysroot as a 'safe path' for its auto-load feature, to make sure
> > that pretty printers for libstdc++.so are added automatically (see commit
> > 6fb3216a80c64c08375429d89497eaeec5622150)
> >
> > When debugging a core file, and the gdbinit file is specified via '-x'
> > rather than '-ix', then the order of these settings matters: If you first
> > set the sysroot, then gdb will immediately start finding the shared
> > libraries it needs for the core file, detect libstdc++ and its associated
> > libstdc++-gdb.py file, then give a big warning about safe paths:
> >
> > warning: File ".../i686-buildroot-linux-gnu/sysroot/lib/libstdc++.so.6.0.24-gdb.py"
> > auto-loading has been declined by your `auto-load safe-path' set
> > to "$debugdir:$datadir/auto-load".
> > To enable execution of this file add
> > add-auto-load-safe-path .../i686-buildroot-linux-gnu/sysroot/lib/libstdc++.so.6.0.24-gdb.py
> > line to your configuration file "/home/me/.gdbinit".
> > To completely disable this security protection add
> > set auto-load safe-path /
> > line to your configuration file "/home/me/.gdbinit".
> > For more information about this security protection see the
> > "Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
> > info "(gdb)Auto-loading safe path"
> >
> > and the pretty printing code is not loaded. This is because the second
> > line from the gdbinit file was not yet parsed at this point.
> >
> > By changing the order (first configuring the safe path, then setting the
> > sysroot), this issue does not appear and everything is as expected.
> >
> > Note that when '-ix' were used instead of '-x' to pass the gdbinit file to
> > gdb, then the order would not matter, because the entire gdbinit file would
> > be parsed before considering the core file.
> > However, even though the Buildroot manual now suggests '-ix', users may not
> > have noticed this change and continue to use '-x'.
>
> Whaa, excellent, not content with fixing a bug once, you fix it twice!
Just to clarify: there were two sets of warnings:
1. problems loading shared libraries
2. problems with the auto-load path / pretty printers
Switching from -x to -ix solves both problems.
But if you stick with '-x', this second patch only fixes the second
problem, not the first.
Best regards,
Thomas
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2021-09-22 9:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-13 7:29 [Buildroot] [PATCH 1/2] docs/manual/using-buildroot-debugger: suggest '-ix' iso '-x' when loading gdbinit Thomas De Schampheleire
2021-09-13 7:29 ` [Buildroot] [PATCH 2/2] toolchain/helpers.mk: gdbinit: set auto-load-safe-path before sysroot Thomas De Schampheleire
2021-09-21 20:46 ` Arnout Vandecappelle
2021-09-22 9:10 ` Thomas De Schampheleire [this message]
2021-10-04 20:24 ` Peter Korsgaard
2021-09-21 20:43 ` [Buildroot] [PATCH 1/2] docs/manual/using-buildroot-debugger: suggest '-ix' iso '-x' when loading gdbinit Arnout Vandecappelle
2021-10-04 20:22 ` Peter Korsgaard
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=CAAXf6LUGQ54q35i8nY9mfTKbEjTUBnObwMSfz5PNXF9wHWSSGw@mail.gmail.com \
--to=patrickdepinguin@gmail.com \
--cc=arnout@mind.be \
--cc=buildroot@buildroot.org \
--cc=giulio.benetti@benettiengineering.com \
--cc=romain.naour@gmail.com \
--cc=thomas.de_schampheleire@nokia.com \
--cc=thomas.petazzoni@bootlin.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;
as well as URLs for NNTP newsgroup(s).