From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id E3C61385BF81 for ; Sun, 17 May 2020 08:12:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E3C61385BF81 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wr1-x433.google.com with SMTP id i15so8091825wrx.10 for ; Sun, 17 May 2020 01:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3hTKnqGB5THla8YbG707oswcekeCeQjAZskAzyeoiqY=; b=dh4Doo3QOkYyV41+oyTlQv/D8BQg3W7gPG5uDTTRrHMcB4AjSDluCW6x3aR5TShpvc dg6DpRlKbvW6TALXJI9UmT5hFQ7xyAlOfpWOL07d03GpmxB6elw7z+AsPnrMZUl2LIbo Fx+RdVmkXBRanavWef7491jHfc3K0ZtLcShupgNvLfcOgYgnjaxNPactc7aBK6/HnJlg 7XgNgGVc7PCKqeWdksAF4VgJAP1rqLHsOuy7NtGNvq0/mZSt+NwW7PfyIhgIkkA8J5AU z+jXvcYkexzuCxSn0Ftw3Vgxq9jJ0Om0LrfaXASKHJyZs7rJpqUob+KSjYsfVyAA7bqd iV8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3hTKnqGB5THla8YbG707oswcekeCeQjAZskAzyeoiqY=; b=PkYbX8iR+/MspBvC6VyErDiKgf8y14YQo2v+cm0T0slGwUKlRO6PSsQYQ9fIhcX7yA 2883YqGHC6/0vCWExUd9dN/TLlkJxV31FbPyX5fbu7A4SC8on4wYSywQCjr0v2KPPYh/ ybpu5uYy9x6EPTqB3UlRH6mLoy+ayP7paHwWN1GotQSHxRECtChkdVA34zBpxv91MCYi 9zDM45sXr2ulrRI2Ynu74YHAuyCDKcvPeyt6rTys5gfXG/coY5oL4pVu2hAhRIT/9O8R eSBUarGcEj33Yor6Y67nEZfZGfsuGNSyTZHQxOhsnc3B2tbV9EFeUowNqPG/HOWDV/N7 if6A== X-Gm-Message-State: AOAM530ReVMv3SjPqtXUyDZql/C4oZTfcft8QQB6jMSCGJ/ADbLiAFrV 9gWU5/uTFRzcL+8fobb3RoKiHQ== X-Google-Smtp-Source: ABdhPJxRLw/A3lZHMky7Tjmui7lzvn06XEcWQtiY2uOTvOXOBcpcET12NbFsWPJA8sJ9XGzSrADB+w== X-Received: by 2002:a5d:490d:: with SMTP id x13mr8361571wrq.199.1589703127009; Sun, 17 May 2020 01:12:07 -0700 (PDT) Received: from localhost (host86-128-12-16.range86-128.btcentralplus.com. [86.128.12.16]) by smtp.gmail.com with ESMTPSA id f5sm11373969wro.18.2020.05.17.01.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 May 2020 01:12:06 -0700 (PDT) Date: Sun, 17 May 2020 09:12:05 +0100 From: Andrew Burgess To: William Tambe Cc: gdb@sourceware.org Subject: Re: Target sim crashes when recording for reverse debugging; find_inferior_ptid returns null Message-ID: <20200517081205.GE2242921@embecosm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux/5.5.17-200.fc31.x86_64 (x86_64) X-Uptime: 09:09:20 up 26 days, 21:54, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, 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 08:12:09 -0000 * 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. 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) {