Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: William Tambe <tambewilliam@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Target sim crashes when recording for reverse debugging; find_inferior_ptid returns null
Date: Sun, 24 May 2020 11:40:46 +0100	[thread overview]
Message-ID: <20200524104046.GH2242921@embecosm.com> (raw)
In-Reply-To: <CAF8i9mN-Ga29jg2hh2LT8EGVkUZw9JvX2aGgHDp6LfK-17k7AA@mail.gmail.com>

* William Tambe <tambewilliam@gmail.com> [2020-05-17 12:49:21 -0400]:

> On Sun, May 17, 2020 at 10:09 AM William Tambe <tambewilliam@gmail.com> wrote:
> >
> > On Sun, May 17, 2020 at 4:12 AM Andrew Burgess
> > <andrew.burgess@embecosm.com> wrote:
> > >
> > > * William Tambe via Gdb <gdb@sourceware.org> [2020-05-16 08:56:20 -0400]:
> > >
> > > > ../../iron-toolchain/binutils/gdb/process-stratum-target.c:47:
> > > > internal-error: virtual gdbarch*
> > > > process_stratum_target::thread_architecture(ptid_t): Assertion `inf !=
> > > > NULL' failed.
> > > >
> > > > Above is the crash that occur after issuing following gdb commands:
> > > > target sim
> > > > load
> > > > record
> > > > si
> > > >
> > > > The crash occurs because find_inferior_ptid() returns NULL.
> > > > From below backtrace, is it possible to determine what could be the
> > > > cause of find_inferior_ptid() returning NULL ?
> > >
> > > I've been running with the patch below in place for doing reverse
> > > debugging on a simulator.
> >
> > Should I revert this change if I need to use "target exec" ?
> 
> In other words, is this change ok for both "target sim" and "target
> exec" ?

It should be fine for all targets.

Thanks,
Andrew



> 
> >
> > >
> > > I need to clean this up and get it merged at some point.
> > >
> > > Hope this helps,
> > > Thanks,
> > > Andrew
> > >
> > >
> > > ---
> > >
> > > commit ecc84c55f926c5a3d7c0dd16b8f46df597ed3f5f
> > > Author: Andrew Burgess <andrew.burgess@embecosm.com>
> > > Date:   Mon Oct 21 21:17:00 2019 +0100
> > >
> > >     gdb: Avoid target_thread_architecture
> > >
> > >     Don't call target_thread_architecture, get gdbarch from regcache
> > >     instead.
> > >
> > > diff --git a/gdb/record-full.c b/gdb/record-full.c
> > > index 51b7beabf66..8c83b017b26 100644
> > > --- a/gdb/record-full.c
> > > +++ b/gdb/record-full.c
> > > @@ -1074,9 +1074,10 @@ record_full_target::resume (ptid_t ptid, int step, enum gdb_signal signal)
> > >
> > >    if (!RECORD_FULL_IS_REPLAY)
> > >      {
> > > -      struct gdbarch *gdbarch = target_thread_architecture (ptid);
> > > +      struct regcache *regcache = get_current_regcache ();
> > > +      struct gdbarch *gdbarch = regcache->arch ();
> > >
> > > -      record_full_message (get_current_regcache (), signal);
> > > +      record_full_message (regcache, signal);
> > >
> > >        if (!step)
> > >          {
> > >
> > >
> > >


  reply	other threads:[~2020-05-24 10:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-16 12:56 William Tambe
2020-05-17  8:12 ` Andrew Burgess
2020-05-17 14:09   ` William Tambe
2020-05-17 16:49     ` William Tambe
2020-05-24 10:40       ` Andrew Burgess [this message]
2020-05-24 14:00         ` William Tambe

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=20200524104046.GH2242921@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb@sourceware.org \
    --cc=tambewilliam@gmail.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