From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id BAE633858D1E for ; Mon, 22 Apr 2024 00:24:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BAE633858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BAE633858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::433 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713745489; cv=none; b=mSG1mLGmjQQ7eVIDNrL5rkT215U/pn9GXdmqL7hEovoeowIdkCX1XOHYtk2zh6BJNn8I7HVEjIycjPaW4WX/azsPZPyPrfWHonmYI1SpQx/ADa3YmBKlTu3AHlas6pvuwlF+rThQi/D6+Lldx0tOfUCAyHNXqVyg1ECCTRQHTwo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713745489; c=relaxed/simple; bh=y70lMecFJoU3U6hMIdcec7UpGvKLazqUMFNOmotDgwk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=lfwURe73MTXlIyckcJYCdVwnnbJhq3cxCfQ77xiB/XpT3WdrMNsYrTrsJxlRWguc48+HOPGogILwpad54ZPjLziI/Zy4D9IPTfz9aQJPt/qlMjMmubkNUoyov1ojD+HQwU0CBjQiGvfk+r3fA7d5nAa/GWQlwji9poo4Iy9OdjQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6ecff9df447so3712164b3a.1 for ; Sun, 21 Apr 2024 17:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713745486; x=1714350286; darn=sourceware.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=S4OIbOgNowvXMkBWUZj7UIw1CPSshXJpUrmze+3IOdA=; b=mNg4Ag7YCW4osLFTSxLekG3wadkfkbjfbWKN+s8kmVK7vACCH3PbfmYA6KPVjBzNjh yvNYcZnA/WZihO2/oKdzFgwJLQDDTF+1pDlEMiffigu7ZdDLe3c3lWOCD7RX1qAV89jj 3oj/dInlCqS7C7r2NT3p6A4Ay9L7Qv6VmxyPK+rP62HobkyVaXxt7L3a3ti3E4NrOFB7 BCIjeYWOivQGqDNxn6kpbRRUKnDa7YUu0axJm9cRWICsGZRcuG+qqXwGTPEi3P/j8U9h jY2H3/znWYZsBePBgJYb6axQMmOVZaWkm+On0bnlEc/vcmMSAMuUPprNkf3kmLQQxnSv 0t/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713745486; x=1714350286; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=S4OIbOgNowvXMkBWUZj7UIw1CPSshXJpUrmze+3IOdA=; b=VuhV2PdaEUsp2txCMRBSmdLwwJvhW2EtMN5j5xJ59fBxLN1U/ddPJZ+GBM1vYbGQS3 kzdKcSbINhn3nJRYH7DdV/dd5gXFnn4voz3iofwNAbvsaR9aw7NhUGhBVX9/VVlnScaG fdV1gfDiYz44vGHe3gzXLl0qe32juKZ7ggChSqZ/erbpyEGd7RXZ13selrqsCwdk0jLh SqQ0EY2NPGBGMQT8ILmSAmcmmw29Y3sJGD+5iUdx8VjRcR+tVVPjYGZwz/GtU3kLppTd eaAMLjA8p+a6wVT3/uRPsd8HoThu7H0nFl8A/xklQ+lNiPv2fSDPXpH1pvNbAi+zbVlW TFig== X-Gm-Message-State: AOJu0YwPNEgMmTbHHg7qutIMl3D51PF20hFWSVeE5n3CuW6I50QFh9TS rrSSYOXuwqgHco+dJ7uZyNgZStkXALWkPR9rixm0OD9ZUBJY5acMZU/Eo/dI450rN2XYrKfTpqI C X-Google-Smtp-Source: AGHT+IFgUelbwgYC7m86FmAbcpZsqopCVuKTT8Xt8TRw6SFgUYROpEE0DtK+e62itlaOvK+JUMz1Lg== X-Received: by 2002:a05:6a00:2295:b0:6ed:4a97:5dec with SMTP id f21-20020a056a00229500b006ed4a975decmr13348286pfe.20.1713745484949; Sun, 21 Apr 2024 17:24:44 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:3224:7231:e42f:1da5]) by smtp.gmail.com with ESMTPSA id kq12-20020a056a004b0c00b006e6c81b6055sm6670880pfb.6.2024.04.21.17.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 17:24:44 -0700 (PDT) From: Thiago Jung Bauermann To: Kevin Buettner Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 2/2] gdb/testsuite: Add gdb.base/memops-watchpoint.exp In-Reply-To: <20240421142019.0f6d75d0@f39-zbm-amd> (Kevin Buettner's message of "Sun, 21 Apr 2024 14:20:19 -0700") References: <20240420213307.976401-1-thiago.bauermann@linaro.org> <20240420213307.976401-3-thiago.bauermann@linaro.org> <20240421142019.0f6d75d0@f39-zbm-amd> User-Agent: mu4e 1.12.4; emacs 29.3 Date: Sun, 21 Apr 2024 21:24:42 -0300 Message-ID: <87wmoq2qid.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: Thank you for your review! Kevin Buettner writes: > On Sat, 20 Apr 2024 18:33:07 -0300 > Thiago Jung Bauermann wrote: > >> diff --git a/gdb/testsuite/gdb.base/memops-watchpoint.exp >> b/gdb/testsuite/gdb.base/memops-watchpoint.exp >> new file mode 100644 >> index 000000000000..6fc84eb469c4 >> --- /dev/null >> +++ b/gdb/testsuite/gdb.base/memops-watchpoint.exp >> @@ -0,0 +1,83 @@ >> +# Copyright 2024 Free Software Foundation, Inc. >> + >> +# This program is free software; you can redistribute it and/or modify >> +# it under the terms of the GNU General Public License as published by >> +# the Free Software Foundation; either version 3 of the License, or >> +# (at your option) any later version. >> +# >> +# This program is distributed in the hope that it will be useful, >> +# but WITHOUT ANY WARRANTY; without even the implied warranty of >> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> +# GNU General Public License for more details. >> +# >> +# You should have received a copy of the GNU General Public License >> +# along with this program. If not, see . >> + >> +# Test a binary that uses standard libc memory operation functions. They are >> +# frequently optimized with specialized instructions, so make sure GDB behaves >> +# correctly in their presence. >> + >> +# It's not possible to check in which libc function the watchpoint triggers >> +# without its debug info. >> +require libc_has_debug_info > > I'm wondering about the need for this requirement. When I comment it > out and run it on a machine without libc debuginfo, I do see 3 FAILs, > but it seems to me that those could be turned into PASSes by changing > the regular expressions for the "continue until..." tests. > > E.g. for the first one, with libc debuginfo, I see: > > continue > Continuing. > > Hardware watchpoint 2: -location a[31] > > Old value = 101 'e' > New value = 0 '\000' > __memset_avx2_unaligned () at ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:146 > 146 VMOVU %VMM(0), (%rdi) > (gdb) PASS: gdb.base/memops-watchpoint.exp: continue until memset watchpoint hits > > But, without libc debuginfo, the watchpoint still works: > > continue > Continuing. > > Hardware watchpoint 2: -location a[31] > > Old value = 101 'e' > New value = 0 '\000' > 0x00007ffff7e3553a in __memset_avx2_unaligned () from /lib64/libc.so.6 > (gdb) FAIL: gdb.base/memops-watchpoint.exp: continue until memset watchpoint hits > > As stated earlier, this could be turned into a PASS by tweaking the RE. > > In both cases, we know that it's in a "memset" function. (The presence > of minimal symbols provides GDB with this information.) I added the requirement because in my aarch64-linux system without libc6 debug info I get: continue Continuing. Hardware watchpoint 2: -location a[28] Old value = 104 'h' New value = 0 '\000' 0x0000fffff7e90664 in ?? () from /lib/aarch64-linux-gnu/libc.so.6 (gdb) FAIL: gdb.base/memops-watchpoint.exp: continue until memset watchpoint hits And I just tested removing libc6-dbg from my x86_64-linux laptop: continue Continuing. Hardware watchpoint 2: -location a[28] Old value = 104 'h' New value = 0 '\000' 0x00007ffff7d8e05f in ?? () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) FAIL: gdb.base/memops-watchpoint.exp: continue until memset watchpoint hits So it depends on the system. One alternative would be to not use the require statement and run the test until the watchpoint hits, and have a case in gdb_test_multiple to mark as UNRESOLVED if the function name is '??'. -- Thiago