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.129.124]) by sourceware.org (Postfix) with ESMTPS id D0DC43858D32 for ; Sun, 12 Feb 2023 07:23:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D0DC43858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676186606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CHDZ8DYqsY4WeAoVV5n1Bm1St0EW7IMV8H7LUetVISI=; b=BgKFNcfSWZmzbgvN7P/+wdhwOP1bYohG6vTJeOxXn/X5suDXubdr+oQPK+ZjgjejI8Qr60 wFtZ3gT/j4N9vFhZ5a6FmbuB+ibJNf4txt7JIRdhMRFq03GK2q3U2aTVTO+OiPA2jWFgiR 5sevWkJreix0WySK2ZSzmT7wjexrmPk= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-575-2oL5f202P7C3IMHVPdrnug-1; Sun, 12 Feb 2023 02:23:23 -0500 X-MC-Unique: 2oL5f202P7C3IMHVPdrnug-1 Received: by mail-qk1-f200.google.com with SMTP id z40-20020a05620a262800b0073b344eb74dso160092qko.10 for ; Sat, 11 Feb 2023 23:23:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CHDZ8DYqsY4WeAoVV5n1Bm1St0EW7IMV8H7LUetVISI=; b=4HnZluq4HAwTo5abonJTirBbJArcmhbvJDoYdLQnsT9qP1s8V7lfRcb6VkHumf2QBB RB0EdpY0jypgNzu9B2hrvdfurdhh/xvT6vsjIf8nVeCXlAXEoL+YEnuCSlFp4QIjlzY3 TqKafMEEJAz57+O+3qCICZ8ZUwzKH1N0skIQB8sbCfDYQz2zBwy7hfx6SzoQnq1kOS6Y 6GauQicPDGAa8zonaUoXD0ZB5DpsRtRNZXeYzBuN1aL0yGCSlzi/57BBmICu3CKd/gmq tbXqDE3qq44S+Oz53xA5hTKH+iOnoPoVO5FZEZNhUZMib8j/n1HJcOV+uzSOwedEo41g +Lpw== X-Gm-Message-State: AO0yUKUhx4MEn47cQ5EThTSIBRRUJrSH9NTs3alPY61EH3MEGnJ+RMLC TvC3+Ak/E0eMWn7Ioyx5v42WcDG4/jbofBcasQIr3Cus5pN3IzK11SNAtUaH1Ku4+2lpVBD4fbu BqJdJCX4nWj8QvJchpDfVIqyDa6o= X-Received: by 2002:a05:622a:287:b0:3b8:2cf6:4bd6 with SMTP id z7-20020a05622a028700b003b82cf64bd6mr37961448qtw.57.1676186602862; Sat, 11 Feb 2023 23:23:22 -0800 (PST) X-Google-Smtp-Source: AK7set8bpPAeBvBH7gx6kReBWrbPF1ZQ3+OF2MAbdsi/nMGD810L9BBRAXVZzCClZsr0IHuy8kB8eQ== X-Received: by 2002:a05:622a:287:b0:3b8:2cf6:4bd6 with SMTP id z7-20020a05622a028700b003b82cf64bd6mr37961438qtw.57.1676186602660; Sat, 11 Feb 2023 23:23:22 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id l188-20020a3789c5000000b0070531c5d655sm7156717qkd.90.2023.02.11.23.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Feb 2023 23:23:22 -0800 (PST) From: Andrew Burgess To: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [PATCH 2/2] gdb: use -1 for breakpoint::task default value In-Reply-To: <0aec159e-085d-5e4b-636f-c46c287d2ddb@palves.net> References: <6ab8502906e90c53dbb2a758f2e02acab05da4ee.1675869267.git.aburgess@redhat.com> <0aec159e-085d-5e4b-636f-c46c287d2ddb@palves.net> Date: Sun, 12 Feb 2023 07:23:20 +0000 Message-ID: <87357buz2v.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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 List-Id: Pedro Alves writes: > On 2023-02-08 3:16 p.m., Andrew Burgess via Gdb-patches wrote: >> Within the breakpoint struct we have two fields ::thread and ::task >> which are used for thread or task specific breakpoints. When a >> breakpoint doesn't have a specific thread or task then these fields >> have the values -1 and 0 respectively. >> >> There's no particular reason (as far as I can tell) why these two >> "default" values are different, and I find the difference a little >> confusing. Long term I'd like to potentially fold these two fields >> into a single field, but that isn't what this commit does. >> >> What this commit does is switch to using -1 as the "default" value for >> both fields, this means that the default for breakpoint::task has >> changed from 0 to -1. I've updated all the code I can find that >> relied on the value of 0, and I see no test regressions, especially in >> gdb.ada/tasks.exp, which still fully passes. >> >> There should be no user visible changes after this commit. > > This bothered me before as well. Thanks for doing this. > > Approved-By: Pedro Alves I pushed this. Then realised I'd forgotten to update it to take account of another patch that added a new comparison to 0, so I then pushed the patch below as a fix. Sorry for the temporary breakage. Thanks, Andrew --- commit 8282ad74c302a8e0db7a588e500ae117a1df68c5 Author: Andrew Burgess Date: Sun Feb 12 07:14:31 2023 +0000 gdb: fix describe_other_breakpoints for default task being -1 Commit: commit 2ecee236752932672fb3d6cd63c6976927f747d8 CommitDate: Sun Feb 12 05:46:44 2023 +0000 gdb: use -1 for breakpoint::task default value Failed to take account of an earlier commit: commit f1f517e81039f6aa673b7d87a66bfbd25a66e3d3 CommitDate: Sat Feb 11 17:36:24 2023 +0000 gdb: show task number in describe_other_breakpoints That both of these are my own commits is only more embarrassing. This small fix updates describe_other_breakpoints to take account of the default task number now being -1. This fixes regressions in gdb.base/break.exp, gdb.base/break-always.exp, and many other tests. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 4b0a909d60c..97dee5cd0fe 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -7057,7 +7057,7 @@ describe_other_breakpoints (struct gdbarch *gdbarch, struct thread_info *thr = find_thread_global_id (b->thread); gdb_printf (" (thread %s)", print_thread_id (thr)); } - else if (b->task != 0) + else if (b->task != -1) gdb_printf (" (task %d)", b->task); gdb_printf ("%s%s ", ((b->enable_state == bp_disabled