Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Duane Ellis <duane@duaneellis.com>
Cc: Yao Qi <qiyaoltc@gmail.com>, Tim Newsome <tim@sifive.com>,
	gdb <gdb@sourceware.org>
Subject: Re: can target code change architecture setting?
Date: Thu, 03 Nov 2016 19:47:00 -0000	[thread overview]
Message-ID: <CADPb22TgJvjVNQeRH54K0Vs8RC5Qf=FvauB3MNbpndXBAomW8g@mail.gmail.com> (raw)
In-Reply-To: <FA6120EE-A298-4B95-B037-C461A3443561@duaneellis.com>

On Tue, Oct 11, 2016 at 7:29 AM, Duane Ellis <duane@duaneellis.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.

Agreed.

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.


  reply	other threads:[~2016-11-03 19:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10 16:48 duane
2016-10-10 19:46 ` Tim Newsome
2016-10-11 11:48 ` Yao Qi
2016-10-11 14:30   ` Duane Ellis
2016-11-03 19:47     ` Doug Evans [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-10-07 17:38 Tim Newsome
2016-10-10  9:26 ` Yao Qi
2016-10-10 15:39   ` Tim Newsome

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADPb22TgJvjVNQeRH54K0Vs8RC5Qf=FvauB3MNbpndXBAomW8g@mail.gmail.com' \
    --to=dje@google.com \
    --cc=duane@duaneellis.com \
    --cc=gdb@sourceware.org \
    --cc=qiyaoltc@gmail.com \
    --cc=tim@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox