This is the mail archive of the
mailing list for the GDB project.
Re: can target code change architecture setting?
- From: Doug Evans <dje at google dot com>
- To: Duane Ellis <duane at duaneellis dot com>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, Tim Newsome <tim at sifive dot com>, gdb <gdb at sourceware dot org>
- Date: Thu, 3 Nov 2016 12:46:15 -0700
- Subject: Re: can target code change architecture setting?
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <CAH=s-PMXhOcr5EhK0RShxqgurtV99NHvgBUOBWZocmkMttoCLg@mail.gmail.com> <FA6120EE-A298-4B95-B037-C461A3443561@duaneellis.com>
On Tue, Oct 11, 2016 at 7:29 AM, Duane Ellis <email@example.com> wrote:
>>> Question #2 - How should the remote debugger respond to GDB?
>>> I don't think there is an "architecture change" packet.
>> Such packet is not needed, because GDB has to determine the gdbarch
>> of each when unwinding.
> I think you are making the assumption that GDB always has access to full debug (i.e.: dwarf) information.
> In bare metal - You don’t always have this, you might have *labels* only (function name vrs address) but no source, no dwarf information.
> The only solution is to *ask* the target “what is your *current* arch.
> Or the target needs to send a “target-arch-change-indication” in some way.
Consider booting some x86 kernel on qemu (e.g., passing -s -S to qemu).
At the start $pc is at the x86 reset location and the architecture is 16-bit.
(gdb) tar ext :1234
Remote debugging using :1234
0x000000000000fff0 in ?? ()
At some later point the o/s will switch to 32 or 64-bit mode but until
then gdb isn't as useful as one might want it to be.