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 BFAB83858D38 for ; Sun, 31 Mar 2024 10:27:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BFAB83858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BFAB83858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711880833; cv=none; b=qbqNEJHhgWDP3yuPZf9DYO6WtknrkOiDhqgagRhtJAyhGDOuVE5NIVvIg+sc9TDWb2UCBeodDp9dci7aEGBuDb5CqkaUTjCI5fLK44YtU9jmRhsOlMc3biBAMZ3Kj4+hoRZwo8lu2QVSt2O5OoIjA4jSaOBd11060N/HxUSbDHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711880833; c=relaxed/simple; bh=txvvoVU29qVWKWnvHaEVKGGB6NdIpAeM/99zbSlEO08=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qcw49XGRr8ciBnMMqLy54tMMIpSdjjRo4EHX1lhZ2iDEXJctgbmWCfAU0JrdpiAkUpDFhWXl/dgKskxmnpZ9ZbBE7GRrhoaXKfLjGeW0LTF8MlKHesHpW68je+f1dEN2vZjRgj6dwRm3LNB00NaaDK0XKYxt658twxFxhWRn8RM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711880831; 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=A0zfl7iD9fah/PxCxg6ENlLweQt/deYtf2BDxFfuepA=; b=K4byco4ZI2EAAfJjwioSxgUwS92NKr1KmAeJ1GOzSTevD8e83YODNkz5b6AY+RpFQxndSo ZDoAbHzoAE0w7j2T3uvrmM/lAw4YBwy3yIBYRVGCzX8bfQP1K64cbZ1eVbT63jweCnNfq4 2MrsCZknmBEV8Q2kWpPVJNY/fFjfRcs= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-681-K4EKchmEM764fQvesqgUnQ-1; Sun, 31 Mar 2024 06:27:09 -0400 X-MC-Unique: K4EKchmEM764fQvesqgUnQ-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a4751d193caso150628566b.1 for ; Sun, 31 Mar 2024 03:27:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711880828; x=1712485628; 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=A0zfl7iD9fah/PxCxg6ENlLweQt/deYtf2BDxFfuepA=; b=e7JVCrHOJoX0TxmFy0gLAgqIwihKrZB3kR5zZVVrlaxTB9pSMp98x13ywO0SOAs57J bGOhlS7PO6gS0PqnzCrUiYn/K7dSZw9k1DNXZJ6wr3kOSZmxx50rg9v59Xrd8svD7xkk 3D2eIpnVtEHVrVMaE/bxyPMZaIkIraPy8z+LawgGSu7mnTgGxe+S7yEyWCbFtltsY5wC T2iYwnai7JZ+3B+hO9mu9wtQ451QBarVCk8hejQ3CRxm52PM6ccH2WGj3uOP2ry6c0v0 T5N88o4zVDvWIDlrB/ZC9g1v+HHgLuWgcZ7+iMvOkhQUGCaooUEOUG259kHBzf7wZ/DJ KxlQ== X-Gm-Message-State: AOJu0YwaGWpp2PO5n5q2T7MqUWtXHSQX0sN9nxEcPOBWoHxaMs6rNy5v cPI69LuLGsMmjuHRG3SFLZPBb5MRq3K61Jt4MmPvQgm15zH4P9z6GXIZxJ74vUVbEZgKXI7gZQ5 oZV4nCrMJPbnWm6qFskES9rlH0pCgzfZzM3aEhzlRgQjzy7c12v3gBl3RaSfTYVdlJphJdzRn2R smC6N0N46By5HbXHkh1zXMldhpLZvfW3z3j7v62Br0qhU= X-Received: by 2002:a17:906:c44d:b0:a4e:5c23:f776 with SMTP id ck13-20020a170906c44d00b00a4e5c23f776mr871590ejb.37.1711880828181; Sun, 31 Mar 2024 03:27:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFu/xgDA/P3ogzjV9DegAQYetcbKSmymCEd431eYDOxmtqOyV2XgEWoKKnxL96UajQrbtV2aQ== X-Received: by 2002:a17:906:c44d:b0:a4e:5c23:f776 with SMTP id ck13-20020a170906c44d00b00a4e5c23f776mr871569ejb.37.1711880827328; Sun, 31 Mar 2024 03:27:07 -0700 (PDT) Received: from localhost (185.223.159.143.dyn.plus.net. [143.159.223.185]) by smtp.gmail.com with ESMTPSA id rv4-20020a17090710c400b00a46cffe6d06sm4053962ejb.42.2024.03.31.03.27.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 03:27:07 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: Re: [PATCHv9 03/14] gdb: change 'if' to gdb_assert in update_dprintf_command_list In-Reply-To: <1b59bf3286719bd63e4cc9caaf66e977fdf49e64.1709651994.git.aburgess@redhat.com> References: <1b59bf3286719bd63e4cc9caaf66e977fdf49e64.1709651994.git.aburgess@redhat.com> Date: Sun, 31 Mar 2024 11:27:06 +0100 Message-ID: <87bk6u4ryd.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=-6.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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: Andrew Burgess writes: > I noticed in update_dprintf_command_list that we handle the case where > the bp_dprintf style breakpoint doesn't have a format and args string. > > However, I don't believe such a situation is possible. The obvious > approach certainly already catches this case: > > (gdb) dprintf main > Format string required > > If it is possible to create a dprintf breakpoint without a format and > args string then I think we should be catching this case and handling > it at creation time, rather than having GDB just ignore the situation > later on. > > And so, I propose that we change the 'if' that ignores the case where > the format/args string is empty, and instead assert that we do always > have a format/args string. The original code, that handled an empty > format/args string has existed since commit e7e0cddfb0d4, which is > when dprintf support was added to GDB. > > If I'm correct and this situation can't ever happen then there should > be no user visible changes after this commit. I've gone ahead and committed this patch. Thanks, Andrew