From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id zCYlIGsik2Qj/QkAWB0awg (envelope-from ) for ; Wed, 21 Jun 2023 12:16:43 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=VBSROf8U; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 727EB1E0BB; Wed, 21 Jun 2023 12:16:43 -0400 (EDT) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5C8721E0AC for ; Wed, 21 Jun 2023 12:16:41 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D3F6F3858005 for ; Wed, 21 Jun 2023 16:16:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D3F6F3858005 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1687364200; bh=bSauNHFvR9HgNnZGEhqLSE8Yp3wPvpAPuawrLRe5s8A=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=VBSROf8UAGqyv8RoK61pozCfO22kL+rXXI9mnHVo4jOkMvJsyXtKe69qR2G/doX2h YsYNbbSKlUTwx/jESWOZENummkzYe42asnW2byo1Dl7hmmIPMFNTzbMTJ3aZS1OVGU sHKzJerovgo56FMV4qPxPEvh8bAblVuL9HyBqKjc= Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 3B99E3858D3C for ; Wed, 21 Jun 2023 16:16:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3B99E3858D3C Received: from [10.0.0.11] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id A10EB1E0AC; Wed, 21 Jun 2023 12:16:20 -0400 (EDT) Message-ID: Date: Wed, 21 Jun 2023 12:16:20 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 3/8] Use std::vector for agent_expr::reg_mask To: Tom Tromey , gdb-patches@sourceware.org References: <20230619-ax-new-v2-0-47638d750dd7@tromey.com> <20230619-ax-new-v2-3-47638d750dd7@tromey.com> Content-Language: en-US In-Reply-To: <20230619-ax-new-v2-3-47638d750dd7@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 6/20/23 13:36, Tom Tromey wrote: > agent_expr::reg_mask implements its own packed boolean vector. This > patch replaces it with a std::vector, simplifying the code. > --- > gdb/ax-general.c | 33 +++++++++------------------------ > gdb/ax.h | 15 +++++---------- > gdb/tracepoint.c | 16 +++++----------- > 3 files changed, 19 insertions(+), 45 deletions(-) Starting with this patch, running gdb.ada/ax-ada.exp, I get (building with -D_GLIBCXX_DEBUG): (gdb) run Starting program: /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.ada/ax-ada/prog [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/../lib/libthread_db.so.1". Breakpoint 1, prog () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.ada/ax-ada/prog.adb:22 22 null; -- START (gdb) maint agent-eval variable = 23 /usr/include/c++/13.1.1/debug/vector:442: In function: std::debug::vector<_Tp, _Allocator>::reference std::debug::vector<_Tp, _Allocator>::operator[](size_type) [with _Tp = bool; _Allocator = std::allocator; reference = std::vector >::reference; size_type = long unsigned int] Error: attempt to subscript container with out-of-bounds index 6, but container only holds 6 elements. Objects involved in the operation: sequence "this" @ 0x60f00000ac30 { type = std::debug::vector >; } Simon