* sysroot and coredump debugging
@ 2025-04-23 13:06 Lluís Batlle i Rossell via Gdb
2025-04-24 14:01 ` Luis Machado via Gdb
0 siblings, 1 reply; 3+ messages in thread
From: Lluís Batlle i Rossell via Gdb @ 2025-04-23 13:06 UTC (permalink / raw)
To: gdb
Hello,
I have an target system, for which I have a sysroot path in my
development computer. Both GNU/Linux.
I expect that I can run this in my development computer, after downloading
the core dump from the target system:
(gdb) set sysroot /mysysroot
(gdb) file myelf # it has debug info
(gdb) core-file core
And this never works; it drops the file with the symbols, thinking it's
unrelated to the core dump:
warning: Can't open file /home/user/myelf during file-backed mapping note
processing
warning: core file may not match specified executable file.
Nothing works with dynamic libs loaded either. The only way I can make gdb
to allow me to debug the core dump with symbols is by copying the elf to
"/mysysroot/home/user/myelf", as it was in the target system.
Is this expected? It is very annoying. Why should the elf of the
executable sit within the sysroot in an exact place, to debug a core dump?
I use gdb 15.2 but this happens at least since gdb 11. Maybe it is fixed
in a newer version?
Thank you,
Lluís.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: sysroot and coredump debugging
2025-04-23 13:06 sysroot and coredump debugging Lluís Batlle i Rossell via Gdb
@ 2025-04-24 14:01 ` Luis Machado via Gdb
2025-04-24 16:23 ` Lluís Batlle i Rossell via Gdb
0 siblings, 1 reply; 3+ messages in thread
From: Luis Machado via Gdb @ 2025-04-24 14:01 UTC (permalink / raw)
To: Lluís Batlle i Rossell, gdb
On 4/23/25 14:06, Lluís Batlle i Rossell via Gdb wrote:
> Hello,
>
> I have an target system, for which I have a sysroot path in my
> development computer. Both GNU/Linux.
>
> I expect that I can run this in my development computer, after downloading
> the core dump from the target system:
> (gdb) set sysroot /mysysroot
> (gdb) file myelf # it has debug info
> (gdb) core-file core
>
> And this never works; it drops the file with the symbols, thinking it's
> unrelated to the core dump:
>
> warning: Can't open file /home/user/myelf during file-backed mapping note
> processing
> warning: core file may not match specified executable file.
>
> Nothing works with dynamic libs loaded either. The only way I can make gdb
> to allow me to debug the core dump with symbols is by copying the elf to
> "/mysysroot/home/user/myelf", as it was in the target system.
>
> Is this expected? It is very annoying. Why should the elf of the
> executable sit within the sysroot in an exact place, to debug a core dump?
>
> I use gdb 15.2 but this happens at least since gdb 11. Maybe it is fixed
> in a newer version?
>
> Thank you,
> Lluís.
Unfortunately I think this is an area where improvements could be made. I know
we have "substitute-path", but that's only for sources. In theory setting sysroot
should work, but it doesn't seem to.
We want gdb to be strict about making sure the core file matches the ELF file, but
we could have some adjustability here.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: sysroot and coredump debugging
2025-04-24 14:01 ` Luis Machado via Gdb
@ 2025-04-24 16:23 ` Lluís Batlle i Rossell via Gdb
0 siblings, 0 replies; 3+ messages in thread
From: Lluís Batlle i Rossell via Gdb @ 2025-04-24 16:23 UTC (permalink / raw)
To: Luis Machado; +Cc: gdb
On Thu, Apr 24, 2025 at 03:01:56PM +0100, Luis Machado wrote:
> On 4/23/25 14:06, Lluís Batlle i Rossell via Gdb wrote:
> > I expect that I can run this in my development computer, after downloading
> > the core dump from the target system:
> > (gdb) set sysroot /mysysroot
> > (gdb) file myelf # it has debug info
> > (gdb) core-file core
> >
> > And this never works; it drops the file with the symbols, thinking it's
> > unrelated to the core dump:
> >
> > warning: Can't open file /home/user/myelf during file-backed mapping note
> > processing
> > warning: core file may not match specified executable file.
>
> Unfortunately I think this is an area where improvements could be made. I know
> we have "substitute-path", but that's only for sources. In theory setting sysroot
> should work, but it doesn't seem to.
>
> We want gdb to be strict about making sure the core file matches the ELF file, but
> we could have some adjustability here.
The "same absolute path" is never required when debugging core dumps
without sysroot, for dump/elf matching. Why does the sysroot introduce
that requirement? It looks like there is a small mistake somewhere, rather
than intended behavior.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-24 16:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-23 13:06 sysroot and coredump debugging Lluís Batlle i Rossell via Gdb
2025-04-24 14:01 ` Luis Machado via Gdb
2025-04-24 16:23 ` Lluís Batlle i Rossell via Gdb
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox