On 17/07/2020 22:02, Mathias Gaunard wrote:
On Fri, 17 Jul 2020 at 15:20, Niall Douglas via Boost
wrote: I am unaware of any similar "silently just works" technique for gdb, sadly. And you might note that on my Linux at least, libstdc++ has no default discovered pretty printers for gdb either.
Of course there are silently-just-works approaches for gdb. You just have to create a section called .debug_gdb_scripts (you can have any number of them)., and gdb will run its content as a Python script when it loads the binary.
In practice though, people only use this to specify how to load scripts that are elsewhere on the filesystem, rather than embedding all the scripts in the object file itself. But I suppose both modes of operation are valid.
The above was very useful, thank you Mathias. I had thought that you could only embed paths to python scripts to load, and those always fall foul of gdb's path whitelisting, so it's useless to me. But the apparent ability to embed arbitrary python scripts, well that's new to me and far more useful looking. I've raised an issue with links to relevant info at: https://github.com/ned14/outcome/issues/233 Many thanks for the tip! Niall