1

Here's my problem:

Trying to debug a C++ program in gdb, but bt won't produce a complete backtrace. It's getting stuck on the Glib shared library, which has been built without any debug info and without -frecord-gcc-switches - this is how it comes as part of the o/s.

I want to build the shared library exactly the same, but with debug info. How can I do this? Building it with Meson shows several other shared libraries and packages that will influence its contents depending on their presence, and there's also of course different compile time flags I can use.

Is there an easy way to ensure the version I build from source produces the same object file as that packaged with linux (plus debug info)?

I've used apt-get source glib2.0-0 and it gives me all the meson files, ninja files and help files I appear to need, but it doesnt quite say this is how it comes as part of Raspberry Pi O/S.

bloogy
  • 11
  • 1
  • 1
    I think your best bet is to compile your version and reproduce issue with this version. If you don't have exact information how this version was built there is high chance that something will differ. But you can try to build it, then strip and binary compare your stripped version with prebuilt version. If there is no difference (or only insignidicant difference like time of build) - then you got what you need. – sklott Jan 21 '23 at 23:14
  • Thanks, this sounds a good method. I will also backup my o/s image before I swap my version into the library, and then return the original after testing. I am a little worried that I might break the o/s boot process. – bloogy Jan 22 '23 at 09:55
  • I'm not familiar with Raspberry, but there probably should be some recovery process for cases when image doesn't boot and you need to rollback to working image. – sklott Jan 22 '23 at 10:08

0 Answers0