From patchwork Sun Apr 21 22:26:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 790693 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp2079624wrm; Sun, 21 Apr 2024 15:27:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUtmZDWkH/g6bYiv6v7bUUI/2adx8HNm+4EQutcltLEfHanW2bpFI1JovYRxrMU5BA+FDIcSd0KdSWabr+6f4H3 X-Google-Smtp-Source: AGHT+IE84osUSROFeNsH/xsq12qfQhawwMbtpguuVb2s5DashefEe2G/67pQRwXDYlmmwxuzem1K X-Received: by 2002:a05:6214:176c:b0:6a0:5a45:5bf5 with SMTP id et12-20020a056214176c00b006a05a455bf5mr8076738qvb.60.1713738457580; Sun, 21 Apr 2024 15:27:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713738457; cv=pass; d=google.com; s=arc-20160816; b=CntBQTBCVYHUtSe6TJhwj0WhBKyHn3rAXhX8SeBT2ezhCspnZoGcMJYoQQR8Vt9Om/ 1eINierKq4xq2v2b/53J6PZ7PGYn1m4XMrAnhwvzkU6z8FFnNb+d+vVbTEjKyfxfJDtR AN3iHf6Sxl8wGNkdRfr1I+K0HSYXfaSU50Q+SRIvnVtP1Z9MwJUC0zDt0EWmNJXQK2xa 0VKPqwqehSBjBt2m2LWvq6w2mIwgqqsR7ncaNI7r3qb/Doq+zjwbr1PNdhO+7y3CVm4Z dHwwzC06J5Z9zFfN4/dtQ17NZdXsWtwAlGPWUaaY7kcl+uS9WaE9KgSbyNhxcrhKBbTA o/nQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=ZubvdS+ASGZ4b3PEfsI6lL4fWXUAfqMrkdtsq0REhfY=; fh=72kqq0iQhigvR9Vv/oqX5ebs3Yyyw7XhzWxOOEPdupI=; b=YDngphL2C1vxC9D6TcN2bLwWXQcz9auZUyzpmJr9GEB7tuSM302fata+j1Jb0t3FqK COsdSP1ws2J/3lrsBhYZnF0qqC1KOJORsWoHH9rR7W/+xd8YIULXcxX49KArYEqBSnp8 gBWinE0ASZpC6MKzHktyblHILRuy0iMStqBO7jgM+TTYqLcifnTmxklWIJ0bmVicrFxW fYOyOs2P7KJ670GAw38Nn40SwMureWYCfWbbQu3NJ6kIDUs70NHuhiOZX6bpiO+gvy4J dTZbrFcV2f46xrI1WfgTYA64EsmpWmSg2a3U1oYStvIVXiilQPMifDMO0dPDeSSuReLR r2NA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t+FYPvgP; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id fv7-20020a056214240700b0069b4c1a50easi6643613qvb.520.2024.04.21.15.27.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 15:27:37 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t+FYPvgP; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3D4B63858C52 for ; Sun, 21 Apr 2024 22:27:37 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id E70113858D1E for ; Sun, 21 Apr 2024 22:27:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E70113858D1E 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 E70113858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713738425; cv=none; b=MzaN9Gmmpk+JCxITUhLhq/F0oTcj71r01ftD5h5502kcROviTW06Pv7o6UsnsxkXQlCaO6oF8kRekoGHavK5Skvw3bc3RtNux6Js2MwN/2FueiiSLcfxc/cTKv1PngnAOiYTjtHEY+3oeX/pPLDaZRqd6rhKC0kgF6zNGplzvgs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713738425; c=relaxed/simple; bh=CjSeLBW/y2tNurryxY6z2opzqtEifSrcRUo4curKwyg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gEE+pJUNi4yHlhTQhZ4heh7NS2wGiRC0UtuoZF4f/hl6Ff1J44vjR+QbAvLNxJwJYtmZNKZRA2j6Zag/c9FaYuBZGbfqU7gesSxiwozKn4hsmUAI0EHiJzXRngndTuJ3XQHSBaor51vqoOIDvnGGdPyb+LCta46xDXQJ7iqt/F4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-5e4f79007ffso2423869a12.2 for ; Sun, 21 Apr 2024 15:27:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713738422; x=1714343222; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=ZubvdS+ASGZ4b3PEfsI6lL4fWXUAfqMrkdtsq0REhfY=; b=t+FYPvgPp997vySfn9PIVc3oUGEIDhQV1wMX6kqsq3IG5d7l/gc0AWfsR0wdI/jZfm kpbVOqwrf/WZpKag8bUBUhazCTD7WXpzEONrWnqEmRvTsbLdDENXUYpEQr4mI2h4bS0Y rTutpM4BpvNtIZQ4e/RDA7itZ1UiztESDVu0DhJ6WeuWMCcUBDygRmMhgyMzd0jhWXG/ /gC9Iqbj4vXww0b9kTlVp7B0Yfcq+/xUZQt818o+SlR5f/uE9Dww9yc7t8HrtXWUMRPQ 3sJLzTmImwew2GtwCLs+FGppsVm0C/B9slf1St+bvoj53ervrA/LWbKRbx4paS8XgEU8 fAQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713738422; x=1714343222; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZubvdS+ASGZ4b3PEfsI6lL4fWXUAfqMrkdtsq0REhfY=; b=uhRzj5j460p1dBDgr2t3LZ11mXlpVo6/dH0HfNYSlzR7Bq4OFZW2fJjuYF1av2M3iJ tsi1HsJY37jcEXHSdb7+MB2SGDojzdNXwNtIRS/mXb/t9INrYYbxIe94T79NsoF0pdKC Rhu7dFq4jLzay0/a589it/37e6BZ8TqTlIVWp9PwaSrm2GGguHdF+PtEC20UC1b8QaXy ji/Qsjc/Q9hTiZ9XSOfcSbBOXpccY0iAXAajLWE886lMc96owkh6Xg2IXYSvgPuheUE9 Al4/5g5XcrQKa+n0qUkRg6Fa0yopbDn1Ic9JwHWQU9K3ZXrq7CuM9qTLJB+F60+OGhmv oWug== X-Gm-Message-State: AOJu0Yw1Ym8F9RhaJACfVHCSd2a5ZuHISQnJNpuWu2ZeXZgxilxtdyOl 4knX9ujePVpxHDmdwpSLa105LnwE49xOl93liUuYaaKf9+XE1aKgKJsV9RimGBZ/+pKODVFkMB5 i X-Received: by 2002:a17:902:e890:b0:1e4:53b6:6cf with SMTP id w16-20020a170902e89000b001e453b606cfmr11370553plg.50.1713738421594; Sun, 21 Apr 2024 15:27:01 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:3224:7231:e42f:1da5]) by smtp.gmail.com with ESMTPSA id g4-20020a170902f74400b001e24988b99asm6760966plw.250.2024.04.21.15.27.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 15:27:01 -0700 (PDT) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Subject: [PATCH v2 0/2] Add testcase for libc memory operations Date: Sun, 21 Apr 2024 19:26:55 -0300 Message-ID: <20240421222657.1052635-1-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patch=linaro.org@sourceware.org Hello, v2 addresses a test failure on armv8l-linux-gnueabihf found by the Linaro CI (I forgot to try the testcase on that platform...). The problem was that the machine used by the CI needs hardware watchpoints to be aligned to 4 bytes, or else GDB fails with: (gdb) watch -location c[31] Hardware watchpoint 4: -location c[31] (gdb) continue Continuing. Unexpected error setting watchpoint: Invalid argument. (gdb) After fixing this problem, the testcase uncovered a real bug, filed as PR breakpoints/31665 and kfailed in the testcase. Patch 1 is the same as v1, only patch 2 has changes. Original cover letter below: In PR testsuite/31484, Tom de Vries suggests adding testcases that excercise memset/memcpy/memmove and set watchpoints. Patch 2 adds such testcase. See its description for a bit more on the motivation. Patch 1 factors out code to check whether libc debug info is available, which is needed for the new testcase. Thiago Jung Bauermann (2): gdb/testsuite: Add libc_has_debug_info require helper gdb/testsuite: Add gdb.base/memops-watchpoint.exp gdb/testsuite/gdb.base/memops-watchpoint.c | 45 ++++++++++ gdb/testsuite/gdb.base/memops-watchpoint.exp | 86 ++++++++++++++++++++ gdb/testsuite/gdb.base/relativedebug.exp | 13 +-- gdb/testsuite/lib/gdb.exp | 54 ++++++++++++ 4 files changed, 186 insertions(+), 12 deletions(-) create mode 100644 gdb/testsuite/gdb.base/memops-watchpoint.c create mode 100644 gdb/testsuite/gdb.base/memops-watchpoint.exp base-commit: 20eee7540b9f2615f7661393756fec0bb62a1495