public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: 庄秋彬 <mark.zhuang@spacemit.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: why gdb try to read address 0x0 when I set $pc,how to suppress this behavior?
Date: Wed, 26 Jul 2023 10:09:17 -0600	[thread overview]
Message-ID: <87bkfyk636.fsf@tromey.com> (raw)
In-Reply-To: <16c8bb4f69de36253945d0fb7891fb770dd49697.5b4244aa.a4ef.425c.9c3b.f2b37af9ec63@feishu.cn> (=?utf-8?B?IuW6hOeni+W9rCIncw==?= message of "Wed, 19 Jul 2023 15:59:24 +0800")

>>>>> 庄秋彬  <mark.zhuang@spacemit.com> writes:

Sorry about the delay on this.

> I use gdb with openocd to debug a riscv board, and found that when set
> $pc=xxx(a non-zero value) in gdb, gdb would first read the address
> 0x0, which caused an error on this riscv device.  Is there any
> documentation or suggestions for reading the source code to solve this
> problem? 


I don't think so.  Reading 0x0 when trying to set $pc is unexpected to
me at least.  I'd normally approach this by debugging gdb to try to
understand why it is happening.

Tom

  parent reply	other threads:[~2023-07-26 16:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19  7:59 庄秋彬
2023-07-19 12:44 ` 庄秋彬
2023-07-26 16:09 ` Tom Tromey [this message]
2023-07-27 15:51   ` 庄秋彬
2023-07-27 17:36     ` Torbjorn SVENSSON

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=87bkfyk636.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb@sourceware.org \
    --cc=mark.zhuang@spacemit.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).