Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: duane@duaneellis.com
Cc: Tim Newsome <tim@sifive.com>, gdb <gdb@sourceware.org>
Subject: Re: can target code change architecture setting?
Date: Tue, 11 Oct 2016 11:48:00 -0000	[thread overview]
Message-ID: <CAH=s-PMXhOcr5EhK0RShxqgurtV99NHvgBUOBWZocmkMttoCLg@mail.gmail.com> (raw)
In-Reply-To: <20161010094844.5c1bb9f86d671edec44bb378f25c04cc.aef8a9655c.wbe@email03.godaddy.com>

On Mon, Oct 10, 2016 at 5:48 PM,  <duane@duaneellis.com> wrote:
>
> However in the bare metal case, I have a question about RISCV (and
> arm-arch64)
>
> In Arm-ARCH64 - you can have both 32bit application, and 64bit kernel.
> I'm not sure about the x86_64 case - because I am not familiar with bare
> metal debug there.
>

I am not sure GDB is able to unwind from kernel code to user space app.

> As a result, when a "jtag-halt" (aka: Bare metal halt) the CPU may halt
> in either mode.
>
> Described another way:
>
>       You are stepping through 32bit user space code.
>       Set a breakpoint.
>       Click RUN
>
> Option 1:
>       The 64bit kernel crashes, and the jtag debugger reports HALT
>       but the registers are 100% wrong.
>
> Option 2:
>       A hardware read/write breakpoint is configured
>       And that hardware break point is triggered.
>       maybe you are debugging memory corruption issues, these things
> happen
>
> Option 3:
>       The program is taking a long time, the human hits "control-C"
>       GDB sends a stop/halt packet
>       And the CPU stops/halts in 64bit mode
>
> Question #1 Is this dual mode possible in RISCV?
>

There is nothing special about RISCV.  In GDB, each frame has an
instance of gdbarch, and they can be different in the frames in the
backtrace.  PPC/SPU debugging is supported this way, IIUC.  That
is, frame #0 and frame #1 is of gdbarch1, and frame #2, and frame #3
is of gdbarch2.  It is possible in GDB nowadays.

> 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.

-- 
Yao (齐尧)


  parent reply	other threads:[~2016-10-11 11:48 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 [this message]
2016-10-11 14:30   ` Duane Ellis
2016-11-03 19:47     ` Doug Evans
  -- 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='CAH=s-PMXhOcr5EhK0RShxqgurtV99NHvgBUOBWZocmkMttoCLg@mail.gmail.com' \
    --to=qiyaoltc@gmail.com \
    --cc=duane@duaneellis.com \
    --cc=gdb@sourceware.org \
    --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