Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Build root location affects debugging on PowerPC
@ 2017-08-25  9:02 Lassi Niemistö
  2017-08-30 12:18 ` Lassi Niemistö
  0 siblings, 1 reply; 2+ messages in thread
From: Lassi Niemistö @ 2017-08-25  9:02 UTC (permalink / raw)
  To: gdb

Hello,
 
I have a 32bit project, which is compiled both for x86 and the PowerPC MPC8309E processor with GCC 4.8.2 and -ggdb3. Debug symbols are splitted into a separate debug file. I have a working setup for debugging both architectures using GDB 7.10.1 (custom build, --enable-target=all), both for regular and core dump analysis scenarios.
 
Recently I discovered a problem: whereas the x86 debugging works regardless where my project's build root is located (typical scenario for core dump analysis, another developer rebuilds the software to get matching symbols), the powerpc debugging shows incorrect crash locations. Sure the source/build paths will be tattooed to the debug information, which changes e.g. the .o file content, but this should not affect debugging, should it? I have tested that recompilation in the _same_ path does not cause the issue.
 
To investigate further, I tried to update to GDB 8.0, but hit a wall right when trying to even open the core file:
 
""
(gdb) core <path to core>
warning: core file may not match specified executable file.
[New LWP ****]
Cannot access memory at address 0x3f4
Cannot access memory at address 0x3f0
gdbarch.c:3355: internal-error: int gdbarch_elf_make_msymbol_special_p(gdbarch*): Assertion `gdbarch != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
""
 
I will file a bug report about the 8.0 but does anyone have a clue what could be the problem with 7.10.1 and why specific to PowerPC? The problem is present both for regular debugging (i.e. let it run and crash) and core dump analysis.
 
-Lassi N.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: Build root location affects debugging on PowerPC
  2017-08-25  9:02 Build root location affects debugging on PowerPC Lassi Niemistö
@ 2017-08-30 12:18 ` Lassi Niemistö
  0 siblings, 0 replies; 2+ messages in thread
From: Lassi Niemistö @ 2017-08-30 12:18 UTC (permalink / raw)
  To: gdb

Answering to myself:

Root cause for debugging to fail on PowerPC were the rpaths auto-planted into my binaries by CMake. After using set(CMAKE_SKIP_BUILD_RPATH TRUE), the debugging started working as it should independent from the build root location. Not sure why it was not an issue on my x86 build, maybe because there I add some rpaths manually and this may stop CMake from autoplanting them.
 
Tried my best to make the build completely deterministic but hitting the bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65015 and thus the CRC part of --add-gnu-debuglink  will still change my binary a little bit every time I build.
Another non-determinism is the LTO I use for some small binaries, but that is another discussion.

I am splitting the debug information to separate debug file using objcopy and thus have used --add-gnu-debuglink. If someone knows a way to allow the debugging without the link, I am interested.  

> will file a bug report about the 8.0 

It existed already, so just posted some material for easy recreation on any PC: https://sourceware.org/bugzilla/show_bug.cgi?id=21603

-Lassi N.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-30 12:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-25  9:02 Build root location affects debugging on PowerPC Lassi Niemistö
2017-08-30 12:18 ` Lassi Niemistö

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox