From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 324023846477 for ; Thu, 6 Oct 2022 17:23:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 324023846477 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-546-BchDLAPPMH29Z2fFSXm86Q-1; Thu, 06 Oct 2022 13:23:55 -0400 X-MC-Unique: BchDLAPPMH29Z2fFSXm86Q-1 Received: by mail-wm1-f71.google.com with SMTP id o18-20020a05600c339200b003bf24961658so1332804wmp.6 for ; Thu, 06 Oct 2022 10:23:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PS/EeyIsl5B1csZubONdZK1+FGMetfpfKL88W50Z3oM=; b=GBTQoc8rN7SG1sVpqa1YQxqGuuVon9jkI5V1rzuZjJf0Wp693xfaYKABH8rG9fNhJb Ka285xXi8OoH9rElXPy8C/UXCAXQf67D79CD3zgzHOu263NPL+QB4fRFJ9pFuR8VTLo/ T9/IkOq98t2BHcLWYjnfRxHvNohx19I+SoAlnufYVLlLfHXW3RHxIWqJs2qGGwaPYKrx shgXGp8pYO96bAhZBAED9KPKa1l5HwBn+HcJqRA1XXEf6QFEcdQIauH1QQ50ERLOfty+ Y4RCkI+zEMymj5EZbEgx2z9WKcsR5YUTfdwnCCp23R1zaOVaIhmPlJSq68yPKG7r26LR KfiQ== X-Gm-Message-State: ACrzQf1vjuzQLgzc/IJ0l14vZKUFeNlCWOh+OENqPOQgy588X5Wpzhl1 OnKtp1XR8WrcJPF7RzeUS+ZxAjNJBABD7kDuHWcMqI0yGraDJCWnZP2qfQf3Yg3Seh3somtaEIK jhpo8906xaqa7ir5bxHb3uaypusYYnZQId2Z4zELdyzADefc5zYpqzADP4NNjTOLEHbfC1ukybQ == X-Received: by 2002:a5d:6446:0:b0:22c:df37:4d76 with SMTP id d6-20020a5d6446000000b0022cdf374d76mr673364wrw.247.1665077033868; Thu, 06 Oct 2022 10:23:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6CyS97QJTCXs1q4PdRTIc1iWL3zToAXYNCWevFY4Kda2uTFKa7AzVv8Km1ec3+BefWCbhRlQ== X-Received: by 2002:a5d:6446:0:b0:22c:df37:4d76 with SMTP id d6-20020a5d6446000000b0022cdf374d76mr673353wrw.247.1665077033620; Thu, 06 Oct 2022 10:23:53 -0700 (PDT) Received: from localhost (92.40.178.145.threembb.co.uk. [92.40.178.145]) by smtp.gmail.com with ESMTPSA id z15-20020adfdf8f000000b0022cc895cc11sm18053736wrl.104.2022.10.06.10.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 10:23:53 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: [PATCH 2/3] gdb: extra debug output in thread.c Date: Thu, 6 Oct 2022 18:23:44 +0100 Message-Id: <7c6aea7043ed6eabf93015f215edf6636f565934.1665076921.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2022 17:24:00 -0000 Add some extra 'threads' debug in a couple of places in thread.c. I've also added an additional gdb_assert in one case. --- gdb/thread.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gdb/thread.c b/gdb/thread.c index 378c5ee2d13..349fc01dd48 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -834,6 +834,10 @@ set_running_thread (struct thread_info *tp, bool running) started = true; tp->state = running ? THREAD_RUNNING : THREAD_STOPPED; + threads_debug_printf ("thread: %s, running? %d%s", + tp->ptid.to_string ().c_str (), running, + (started ? " (started" : "")); + if (!running) { /* If the thread is now marked stopped, remove it from @@ -1298,6 +1302,9 @@ info_threads_command_completer (struct cmd_list_element *ignore, void switch_to_thread_no_regs (struct thread_info *thread) { + gdb_assert (thread != nullptr); + threads_debug_printf ("thread = %s", thread->ptid.to_string ().c_str ()); + struct inferior *inf = thread->inf; set_current_program_space (inf->pspace); @@ -1315,6 +1322,8 @@ switch_to_no_thread () if (current_thread_ == nullptr) return; + threads_debug_printf ("thread = NONE"); + current_thread_ = nullptr; inferior_ptid = null_ptid; reinit_frame_cache (); -- 2.25.4