public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Changbin Du <changbin.du@gmail.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: Changbin Du <changbin.du@gmail.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/riscv: fix creating breakpoints at invalid addresses
Date: Thu, 25 Mar 2021 09:39:25 +0000	[thread overview]
Message-ID: <20210325093924.ak2xw6nz7jet7hml@mail.google.com> (raw)
In-Reply-To: <20210325091752.GO5520@embecosm.com>

On Thu, Mar 25, 2021 at 09:17:52AM +0000, Andrew Burgess wrote:
> * Changbin Du via Gdb-patches <gdb-patches@sourceware.org> [2021-03-25 08:47:57 +0000]:
> 
> > To allow breakpoints to be created at invalid addresses,
> > target_read_code() is used instead of read_code(). The
> > original read_code() should be removed, otherwise the
> > breakpoint command will fail.
> > 
> > (gdb) hbreak setup_arch
> > Cannot access memory at address 0xffffffe000c036ac
> > 
> > gdb/ChangeLog:
> > 2021-03-24  Changbin Du <changbin.du@gmail.com>
> > 
> >         * riscv-tdep.c (riscv_breakpoint_kind_from_pc): Update.
> 
> Can you change this to 'Remove call to read_code.' or similar.  Just
> saying 'Update.' isn't very helpful.
>
Sure, please checkout in v2. Thanks.
 
> Approved with that change.
> 
> Thanks,
> Andrew
> 
> 
> 
> > ---
> >  gdb/ChangeLog    | 4 ++++
> >  gdb/riscv-tdep.c | 1 -
> >  2 files changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> > index a548c58e8f72..a84299a2cc38 100644
> > --- a/gdb/ChangeLog
> > +++ b/gdb/ChangeLog
> > @@ -1,3 +1,7 @@
> > +2021-03-25  Changbin Du <changbin.du@gmail.com>
> > +
> > +	* riscv-tdep.c (riscv_breakpoint_kind_from_pc): Update.
> > +
> >  2021-03-24  Simon Marchi  <simon.marchi@polymtl.ca>
> >  
> >  	* target.h (current_top_target): Remove, make callers use the
> > diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
> > index ca3efaf71cf8..c17839968465 100644
> > --- a/gdb/riscv-tdep.c
> > +++ b/gdb/riscv-tdep.c
> > @@ -706,7 +706,6 @@ riscv_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
> >  	     user.  */
> >  	  if (target_read_code (*pcptr, buf, 1) == -1)
> >  	    buf[0] = 0;
> > -	  read_code (*pcptr, buf, 1);
> >  	}
> >  
> >        if (riscv_debug_breakpoints)
> > -- 
> > 2.27.0
> > 
> > 

-- 
Cheers,
Changbin Du

      reply	other threads:[~2021-03-25  9:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25  8:47 Changbin Du
2021-03-25  9:17 ` Andrew Burgess
2021-03-25  9:39   ` Changbin Du [this message]

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=20210325093924.ak2xw6nz7jet7hml@mail.google.com \
    --to=changbin.du@gmail.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    /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).