Message ID | 2793a93ca9aa228f432650743674cb481881e9db.1682724005.git.aburgess@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E63A93858C20 for <patchwork@sourceware.org>; Fri, 28 Apr 2023 23:42:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E63A93858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682725340; bh=7GnuDq4rXJVkxVOA5UewHQhxSAIm/UqY73V7l2PM4Vk=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=QKWQEqYGS2mdiH9V2KDmFCYf1kFTjw+9j129T91nPvElWrLy9+eBXAFPF+JyIvuEc XH+saMFI0oNM6FoCne1SZhtya/RP5nbsbx5S0Sja9KiI+LcuE13JL1OFr10dQDsUxR JzO/DWqIh4ESdszRx4BDiUxfLiEC3Xxr06IO5j9U= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 A6635385783F for <gdb-patches@sourceware.org>; Fri, 28 Apr 2023 23:35:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A6635385783F Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-44-glzGUgGQNHSHVPvZPImdCQ-1; Fri, 28 Apr 2023 19:35:53 -0400 X-MC-Unique: glzGUgGQNHSHVPvZPImdCQ-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-302cdf5d034so183121f8f.0 for <gdb-patches@sourceware.org>; Fri, 28 Apr 2023 16:35:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682724952; x=1685316952; 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=7GnuDq4rXJVkxVOA5UewHQhxSAIm/UqY73V7l2PM4Vk=; b=RAvdHcaabXXwjH7cIpIDEs1tRh3+sp1EHpuI4TdKOUAZojcK9dXgkaqgD0gVfCBvul mdZysdtzC7MiDSgbPdRWEzT1/FbVL+xeW9WeZDfclMz/+qggKW5X51sv3Z3OW9ec/hvE XbonzAVQum6X/wE7BYAt7J/IKLHaq4wqlIFwNHD3YIbvcnpI43bzJubnBmDFUuyqax4l bF3uFP190bnFgc+4xEZ48jpia6+k/eYBbYM0U2bmBcyygsQAJ33rPMJRIsGl2iTdU8QB iR/0A0hrjkT73iN9b/bdfMyG4t0lfsFQwxH2FwDJCW5T4OwjOyk1hoY5NBpgbcRRcvBZ jAaQ== X-Gm-Message-State: AC+VfDzwnxGvciuVoHUkYgIYme0rJp0SbrmS5FQ2gIUT4vdG0jv+z0SV jMrRUmicKePG+infonShlevq/AabGBpc1fJEJNR2xocM6cKHmfqTRsYmlJwOcsbiQzyfancbKjg HlHgnlzXbTvFUhQhEGOSegCYmbGkKe9qd/vG4UA7BsO3aGAU0X6mmyftTWq4zw5AUHc7mnBXqbi zIE1CrYQ== X-Received: by 2002:adf:f805:0:b0:2f0:833:6acc with SMTP id s5-20020adff805000000b002f008336accmr5311282wrp.61.1682724952449; Fri, 28 Apr 2023 16:35:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4jUGkdPuTS6rzfVLzleSD0Zjk9lYSCxjOancXfBXwQm9Ri0sEJVM1+OWwxxI7bI2kI76C3/w== X-Received: by 2002:adf:f805:0:b0:2f0:833:6acc with SMTP id s5-20020adff805000000b002f008336accmr5311276wrp.61.1682724952268; Fri, 28 Apr 2023 16:35:52 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id t15-20020adfe44f000000b002f00793bd7asm22069302wrm.27.2023.04.28.16.35.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Apr 2023 16:35:51 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Andrew Burgess <aburgess@redhat.com> Subject: [PATCH 3/9] gdb: change 'if' to gdb_assert in update_dprintf_command_list Date: Sat, 29 Apr 2023 00:35:39 +0100 Message-Id: <2793a93ca9aa228f432650743674cb481881e9db.1682724005.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <cover.1682724005.git.aburgess@redhat.com> References: <cover.1682724005.git.aburgess@redhat.com> 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=-11.6 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, T_SCC_BODY_TEXT_LINE 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Andrew Burgess <aburgess@redhat.com> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
thread-specific breakpoints in just some inferiors
|
|
Commit Message
Andrew Burgess
April 28, 2023, 11:35 p.m. UTC
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. --- gdb/breakpoint.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 350fa495319..b75990963ca 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -8382,8 +8382,9 @@ update_dprintf_command_list (struct breakpoint *b) const char *dprintf_args = b->extra_string.get (); gdb::unique_xmalloc_ptr<char> printf_line = nullptr; - if (!dprintf_args) - return; + /* Trying to create a dprintf breakpoint without a format and args + string should be detected at creation time. */ + gdb_assert (dprintf_args != nullptr); dprintf_args = skip_spaces (dprintf_args);