From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id hP8HDviWC2guKgUAWB0awg (envelope-from ) for ; Fri, 25 Apr 2025 10:06:48 -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=HfjYCAt0; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 2BE2E1E10E; Fri, 25 Apr 2025 10:06:48 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A6F2A1E0C0 for ; Fri, 25 Apr 2025 10:06:47 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 02D29385781A for ; Fri, 25 Apr 2025 14:06:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02D29385781A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1745590007; bh=Q9JAUI1GzfNB+/tl0TLcxH68Q6NxdBYDZsKXnGxdrjg=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=HfjYCAt0wf6WnVC2PcBpSnKMAP88iaBro/KG2N1oCvtfAoE+l4Pt4kT6WAmyPWoPk oQ/eZvY4B7W0j1elJjL76Y3RQnfvVD7dJOS/m4IFf9TN5cC2gtniCpCMse9qtiM105 hy0TeBxyZdBovvxQpxzS6qSQaeBW9zt6sfh5/Q0U= Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by sourceware.org (Postfix) with ESMTPS id 4FC093858D38 for ; Fri, 25 Apr 2025 14:06:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4FC093858D38 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4FC093858D38 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1745589962; cv=none; b=uYBZzFHdCbDncj2Qe1V53DqN1GwZGTWZCmbM6ckjk3taBqnHxE96mO4dMIHvyC0p3RfBZpu3j6Kh5MQ2cEkftfgOHWvNSm5BVUZVNU1L6XNxRJdlR4CpkiXlxplZfVd4rFg3wh3EI2jOu9qzMgwoeGo4asvpvORN4/ysqHRKlJA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1745589962; c=relaxed/simple; bh=odkNzsYvW9k9YszheF5TppOBjhYG/AJWw5pOOB9VOJE=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=h8ZEj1jf0CL+7jwKutYkB9qovl8Wcz8YRMTnIzFAma94bdXcXaZlGE0qrTRWd5WiyV9eFRmg7B5Xt5HC9SucdQnVxj8pNjL9enFPTMNcGIEw0mLYxMm1wlJ+JJYYE8jmwzWswhMR6t2Y+OgVSwpov/QDGJC4WQOi2+sIs9UapBE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FC093858D38 Received: by mail-yb1-xb34.google.com with SMTP id 3f1490d57ef6-e730b8d934aso1444069276.2 for ; Fri, 25 Apr 2025 07:06:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745589961; x=1746194761; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/aoXHeRAtL+kVLYKbycB7gtaslbn4dxQd+A2bKtzh0Q=; b=EOAC8C2pIOzqyGxaZ2R0r2jekQY/EanvL1XeUT3TOd7aE4u57K+AjzpXPuyic6KV8Q ftmxrtu1PSjxbqdqOp0Bs+bIafodT1ChbjRbOWI2HK1iTzNNEklKfitzpmaoc8EmjlLb fK3FEAZJi/Rso698lCdGrnePSTgjnVJ2AWpgGzapCAsLjZ8oM0Ap/VfxIqpPtwPnFmq6 6LjZwCXrYxOUJVr2Er5FDby+tEVSwfOhlYelCCH/UHiqoMZDxiwEeKfx1uy6jQ28RnN/ 4oObqaxWyRF/68P01w15QWzeLD9czmZ/mM7ZHZEwrA4sI/A94ZRI6GyES7LE5SnpmSSZ mIqA== X-Gm-Message-State: AOJu0YyEXRnl4mj22Y/poR5NtwHItzPPhxXr2hgt/024rxs9GUNoKV78 l7Id2ZZG6NHDbFIGWrFrVGd43Q1QqEs92ayXx8NhAwXCRVDYWU+6A1KU28hBZGu2kfjWdl/JBu4 5QDUglGyCjG5LcIZDZY1TvODopG7Cjw5ZUhY= X-Gm-Gg: ASbGnctYfNQU6hZLGgQIFUGPCwY/ZszL/ZM/Emq6k62H+30579Xxbcn1SjRo2+0llic RnNDgEvkwzcErwqd6t9L2k4kGkNR1gJVPHi/0P409FWPnphb2d2BSkgsyXRS9qtk0yU1ekCLqnA ReTY5goqKuLRq3mAH24VTigQ== X-Google-Smtp-Source: AGHT+IEF+uFYIr+QS3SU5JZB1rkc9C3Ejf4Y8SrzwHTRZaMr2u4OFq+rb/HUX+9Us/3N43AaGKk/6JzQr9uj1QMVq0E= X-Received: by 2002:a05:6902:6c0e:b0:e73:1807:f38e with SMTP id 3f1490d57ef6-e731807f4f8mr2451680276.43.1745589961599; Fri, 25 Apr 2025 07:06:01 -0700 (PDT) MIME-Version: 1.0 References: <8b81ad7c-0866-40c9-a81a-db9a51326fef@arm.com> In-Reply-To: <8b81ad7c-0866-40c9-a81a-db9a51326fef@arm.com> Date: Fri, 25 Apr 2025 18:04:26 +0200 X-Gm-Features: ATxdqUHNd16F0mRFpkRHUfd1Hj9lPm3EKl6wChDj1ZShtMtanNuhiUBOPc9cdeQ Message-ID: Subject: Re: gdb behaviour change under software watchpoints? To: gdb Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.30 X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: K via Gdb Reply-To: K Errors-To: gdb-bounces~public-inbox=simark.ca@sourceware.org Sender: "Gdb" trying to set a hw watchpoint I get this: ``` (gdb) watch *0x550195e010 Hardware watchpoint 1: *0x550195e010 (gdb) c Continuing. Warning: Could not insert hardware watchpoint 1. Could not insert hardware breakpoints: You may have requested too many hardware breakpoints/watchpoints. Command aborted. ``` so I switched to s/w watchpoint: set can-use-hw-watchpoints 0 here's the output when I don't use an expression to look for a specific value (which didn't show up) but self examine the value at an address and just continue on until the abort(): ``` gdb-multiarch -q -x gdbinit ../_build/cross/bin/ocamljitlinker Reading symbols from ../_build/cross/bin/ocamljitlinker... The target architecture is set to "aarch64". warning: remote target does not support file transfer, attempting to access files from local filesystem. 0x0000005504303300 in ?? () from /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 Watchpoint 1: *0x550195e010 c Watchpoint 1: *0x550195e010 Old value = New value = 0x0 0x0000005504519a40 in brk () from /usr/aarch64-linux-gnu/lib/libc.so.6 (gdb) Continuing. Watchpoint 1: *0x550195e010 Old value = 0x0 New value = 0x4a20001 caml_page_table_modify (page=page@entry=0x5504a20000, toclear=toclear@entry=0x0, toset=toset@entry=0x1) at memory.c:176 176 caml_page_table.occupancy++; (gdb) c Continuing. Watchpoint 1: *0x550195e010 Old value = 0x4a20001 New value = 0x9100a021 0x00000055044d91c4 in ?? () from /usr/aarch64-linux-gnu/lib/libc.so.6 (gdb) c Continuing. [Inferior 1 (process 1) exited with code 02] ``` what I see at this point without any watchpoint: ``` Program received signal SIGABRT, Aborted. 0x00000055044bf5e8 in ?? () from /usr/aarch64-linux-gnu/lib/libc.so.6 ``` On Fri, 25 Apr 2025 at 15:09, Luis Machado wrote: > On 4/24/25 17:54, K via Gdb wrote: > > A bug in my software is revealed by a debug build which eventually calls > > abort(). gdb sees and reports this and I can do a backtrace and find a > > memory location I need to investigate. > > then I make a run with a watchpoint on said memory location which has to > be > > software since it's a non-host binary running under qemu. > > not only does the watchpoint not get triggered despite ensuring binary is > > being loaded to the same address, but gdb only reports that the process > has > > exitted with an error code - no memory to examine, no backtrace. > > > > the former is mysterious but the latter is annoying - is this behaviour > > necessitated by setting watchpoints? > > I have remote access to a machine of the target variety but I would ask > > first whether I can expect the behaviour to return to normal when using a > > hardware watchpoint. No point is going down a dead end... > > Thanks. > > qemu should know how do do hardware breakpoints. Do you have some logging > output > from when the watchpoint gets set until gdb runs until the program exits? >