mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* Re: [ptxdist] Regenerating debug files for debugging a core dump
       [not found] <CABDcavZWsuJ8tRfr7iWMRuqZfnCFHAhwbaftf182UsCd7Yao5g@mail.gmail.com>
@ 2021-05-26  9:31 ` Michael Olbrich
  2021-05-26 20:32   ` Roland Hieber
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Olbrich @ 2021-05-26  9:31 UTC (permalink / raw)
  To: ptxdist

Hi,

On Tue, May 25, 2021 at 04:43:54PM +0200, Guillermo Rodriguez Garcia wrote:
> I am trying to debug a core dump from a system based on ptxdist-2018.05.0.
> 
> I see that the debug symbols are generated in
> platform-xxx/root/usr/lib/debug.
> 
> The thing is that I don't have the original debug files anymore.
> If I regenerate the root fs and everything else from the same sources
> (ptxdist clean + ptxdist go), will the generated debug files be valid for
> debugging the core dump?

It may or may not work. PTXdist tries to make builds reproducible. But
there are cases where it does not work and the resulting binaries are
different.
So it's worth a try if you don't have the debug files any more, but it's
better to keep them to avoid relying on this.

> I guess the general question is: should we be storing debug files for each
> release, or can we rely on regenerating these from scratch when needed?

I would not rely on it. I would either just package the whole
platform-xxx/root and save that. Or you could enable
PTXCONF_DEBUG_PACKAGES. In this case PTXdist will create a debug ipkg for
each package that contains the debug files. You can den archive all ipgk
files (regular and debug) and extract those as needed.

Michael

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


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

* Re: [ptxdist] Regenerating debug files for debugging a core dump
  2021-05-26  9:31 ` [ptxdist] Regenerating debug files for debugging a core dump Michael Olbrich
@ 2021-05-26 20:32   ` Roland Hieber
  2021-05-26 20:41     ` Michael Olbrich
  0 siblings, 1 reply; 3+ messages in thread
From: Roland Hieber @ 2021-05-26 20:32 UTC (permalink / raw)
  To: ptxdist

On Wed, May 26, 2021 at 11:31:56AM +0200, Michael Olbrich wrote:
> Hi,
> 
> On Tue, May 25, 2021 at 04:43:54PM +0200, Guillermo Rodriguez Garcia wrote:
> > I am trying to debug a core dump from a system based on ptxdist-2018.05.0.
> > 
> > I see that the debug symbols are generated in
> > platform-xxx/root/usr/lib/debug.
> > 
> > The thing is that I don't have the original debug files anymore.
> > If I regenerate the root fs and everything else from the same sources
> > (ptxdist clean + ptxdist go), will the generated debug files be valid for
> > debugging the core dump?
> 
> It may or may not work. PTXdist tries to make builds reproducible. But
> there are cases where it does not work and the resulting binaries are
> different.
> So it's worth a try if you don't have the debug files any more, but it's
> better to keep them to avoid relying on this.

Hmm, if the package does not build reproducibly, its build ID will
change, so gdb won't find the debug symbols automatically. But does that
also mean that the debug symbols cannot be loaded into gdb manually? If
the BSP was built from exactly the same sources (even without
reproducibility) most other data layouts, file names and line numbers
should still be the same, right?

 - Roland

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


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

* Re: [ptxdist] Regenerating debug files for debugging a core dump
  2021-05-26 20:32   ` Roland Hieber
@ 2021-05-26 20:41     ` Michael Olbrich
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Olbrich @ 2021-05-26 20:41 UTC (permalink / raw)
  To: ptxdist

On Wed, May 26, 2021 at 10:32:03PM +0200, Roland Hieber wrote:
> On Wed, May 26, 2021 at 11:31:56AM +0200, Michael Olbrich wrote:
> > Hi,
> > 
> > On Tue, May 25, 2021 at 04:43:54PM +0200, Guillermo Rodriguez Garcia wrote:
> > > I am trying to debug a core dump from a system based on ptxdist-2018.05.0.
> > > 
> > > I see that the debug symbols are generated in
> > > platform-xxx/root/usr/lib/debug.
> > > 
> > > The thing is that I don't have the original debug files anymore.
> > > If I regenerate the root fs and everything else from the same sources
> > > (ptxdist clean + ptxdist go), will the generated debug files be valid for
> > > debugging the core dump?
> > 
> > It may or may not work. PTXdist tries to make builds reproducible. But
> > there are cases where it does not work and the resulting binaries are
> > different.
> > So it's worth a try if you don't have the debug files any more, but it's
> > better to keep them to avoid relying on this.
> 
> Hmm, if the package does not build reproducibly, its build ID will
> change, so gdb won't find the debug symbols automatically. But does that
> also mean that the debug symbols cannot be loaded into gdb manually? If

No, gdb gets the build ID from the newly built binary, not the core dump.
So it finds the debug data, but if that does not match the original binary
it may not help.

> the BSP was built from exactly the same sources (even without
> reproducibility) most other data layouts, file names and line numbers
> should still be the same, right?

It depends on what's different. A small change often means that the rest of
the code is shifted a bit and then the addresses won't match any more.

Michael

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


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

end of thread, other threads:[~2021-05-26 20:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CABDcavZWsuJ8tRfr7iWMRuqZfnCFHAhwbaftf182UsCd7Yao5g@mail.gmail.com>
2021-05-26  9:31 ` [ptxdist] Regenerating debug files for debugging a core dump Michael Olbrich
2021-05-26 20:32   ` Roland Hieber
2021-05-26 20:41     ` Michael Olbrich

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