From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id ECEFD385BF81 for ; Sun, 17 May 2020 14:10:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ECEFD385BF81 Received: by mail-lj1-x235.google.com with SMTP id k5so444226lji.11 for ; Sun, 17 May 2020 07:10:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DuLbModjz5h64PPtyxtiltBj2mAIqKZqILfp0M9Kum0=; b=G85Ao5H8JJAK5TmoZSS1fANB3ZtzyC7LsIDE/euArakKN77d4Jo1CUqzINOspwkYj2 aQBtW4pQmSNh9wBRIfsxbEZt6zpUlguXYHH5tRMHLWDhTn6O4e16Ue3zJp2m7gZpHGW/ 1yRnNaRmZ9gycs9u4LFC7+5v160sEfBBE94yycUIFZ6lEjTp+BkuddNhlkVIflxRtApN qjtObw5o6IWOG4LAKIdl3pKBCNvaE6B0zIluWErpd1Dz7Fqj5DQa6qn1TGqYyivTB+CX w0DRZlDQLTINHWDi4SR+cBZKEvc/0YADknXMsOOQkligJ1x1eAlmNyl/zI4OfZSjgJy/ 3Yog== X-Gm-Message-State: AOAM5310F/uyUDf5KBrUgPR+rrH8GjIZ0QJCbQYeFjpEqX52GN0t6SL9 GvZi9cuAy5abPi+WwcWnqLP8DIRlDfgQfEoq48qOArju X-Google-Smtp-Source: ABdhPJyJlnc7NUE3UvlsF4dXdvi2lykexo6I16zUumeWsVxmtYAMyIGSusk4iD3TcnxcqOmw7+24L/pkUo+E8JP0b38= X-Received: by 2002:a2e:844f:: with SMTP id u15mr1737287ljh.67.1589724609739; Sun, 17 May 2020 07:10:09 -0700 (PDT) MIME-Version: 1.0 References: <20200517081205.GE2242921@embecosm.com> In-Reply-To: <20200517081205.GE2242921@embecosm.com> From: William Tambe Date: Sun, 17 May 2020 10:09:58 -0400 Message-ID: Subject: Re: Target sim crashes when recording for reverse debugging; find_inferior_ptid returns null To: Andrew Burgess Cc: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 14:10:12 -0000 On Sun, May 17, 2020 at 4:12 AM Andrew Burgess wrote: > > * William Tambe via Gdb [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" ? > > I need to clean this up and get it merged at some point. > > Hope this helps, > Thanks, > Andrew > > > --- > > commit ecc84c55f926c5a3d7c0dd16b8f46df597ed3f5f > Author: Andrew Burgess > 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) > { > > >