From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 94B76385E836 for ; Thu, 2 May 2024 22:07:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 94B76385E836 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 94B76385E836 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=45.83.234.184 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714687672; cv=none; b=ZfY5XB8ptZWxljVGIOk/uL/FJXF/GnmNc6wj4V2OeQquAK38dj4R6LHOavjeNRGh4HzHBWYO1yOJzhOJ/UMwzwiHn17yHIEUCI85TBWT6o2MpFCFOM4UyRyeJ29LmAGla7sgpDbadQcPmY96b/0BdcIgg1pMj+yy/OlLIGJvs4E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714687672; c=relaxed/simple; bh=MABzcBLOR1pyUUMUPf4s3S3Lv8r6trVxlq9YxKZRsKU=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=kehxLlts349vOz13184BwSI52iWjJr3EkqZHf6WhK9eS5EBgLAHCiGiQfnbCTxxtuViEAF7sWsBmqdgKsPMku+3luqcaSZuN9OcLz2ait5mTbzibmOGMlzLnvws35vzZ2tWjfUisJWrffDKwGfPDQS9fzZUAy6FyNyvVOdX0S9s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from csb.redhat.com (deer0x03.wildebeest.org [172.31.17.133]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 5C87A3000472; Fri, 3 May 2024 00:07:47 +0200 (CEST) Received: by csb.redhat.com (Postfix, from userid 10916) id 3B31EE016A; Fri, 3 May 2024 00:07:47 +0200 (CEST) Date: Fri, 3 May 2024 00:07:47 +0200 From: Mark Wielaard To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix regression on aarch64-linux gdbserver Message-ID: References: <20240422135149.921896-1-tromey@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="sDo3MGbsonKgH8Us" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240422135149.921896-1-tromey@adacore.com> X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,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: --sDo3MGbsonKgH8Us Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On Mon, Apr 22, 2024 at 07:51:49AM -0600, Tom Tromey wrote: > diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc > index 5df67fccd08..da5c1fd0629 100644 > --- a/gdbserver/linux-aarch64-low.cc > +++ b/gdbserver/linux-aarch64-low.cc > @@ -576,41 +576,9 @@ aarch64_target::low_stopped_data_address () > > /* Check if the address matches any watched address. */ > state = aarch64_get_debug_reg_state (pid_of (current_thread)); > - for (i = aarch64_num_wp_regs - 1; i >= 0; --i) > - { > - const unsigned int offset > - = aarch64_watchpoint_offset (state->dr_ctrl_wp[i]); > - const unsigned int len = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); > - const CORE_ADDR addr_watch = state->dr_addr_wp[i] + offset; > - const CORE_ADDR addr_watch_aligned = align_down (state->dr_addr_wp[i], 8); > - const CORE_ADDR addr_orig = state->dr_addr_orig_wp[i]; > - > - if (state->dr_ref_count_wp[i] > - && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i]) > - && addr_trap >= addr_watch_aligned > - && addr_trap < addr_watch + len) > - { > - /* ADDR_TRAP reports the first address of the memory range > - accessed by the CPU, regardless of what was the memory > - range watched. Thus, a large CPU access that straddles > - the ADDR_WATCH..ADDR_WATCH+LEN range may result in an > - ADDR_TRAP that is lower than the > - ADDR_WATCH..ADDR_WATCH+LEN range. E.g.: > - > - addr: | 4 | 5 | 6 | 7 | 8 | > - |---- range watched ----| > - |----------- range accessed ------------| > - > - In this case, ADDR_TRAP will be 4. > - > - To match a watchpoint known to GDB core, we must never > - report *ADDR_P outside of any ADDR_WATCH..ADDR_WATCH+LEN > - range. ADDR_WATCH <= ADDR_TRAP < ADDR_ORIG is a false > - positive on kernels older than 4.10. See PR > - external/20207. */ > - return addr_orig; > - } > - } > + CORE_ADDR result; > + if (aarch64_stopped_data_address (state, addr_trap, &result)) > + return result; > > return (CORE_ADDR) 0; > } This broke the build on the gdb-fedora-arm64 buildbot: https://builder.sourceware.org/buildbot/#/builders/181/builds/6402 Fix attached. Cheers, Mark --sDo3MGbsonKgH8Us Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0001-Fix-gdbserver-linux-aarch64-low.cc-build.patch" Content-Transfer-Encoding: 8bit >From f27b8de72a42650a948fef0adc17e82517c14c2a Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 2 May 2024 23:58:20 +0200 Subject: [PATCH] Fix gdbserver/linux-aarch64-low.cc build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 0ee25f97d21e ("Fix regression on aarch64-linux gdbserver") removed the last use of i in gdbserver/linux-aarch64-low.cc (aarch64_target::low_stopped_data_address). Breaking the build on aarch64 with: gdbserver/linux-aarch64-low.cc: In member function ‘virtual CORE_ADDR aarch64_target::low_stopped_data_address()’: gdbserver/linux-aarch64-low.cc:557:12: error: unused variable ‘i’ [-Werror=unused-variable] 557 | int pid, i; | ^ cc1plus: all warnings being treated as errors Fix this by removing the variable i completely. Fixes: 0ee25f97d21e ("Fix regression on aarch64-linux gdbserver") --- gdbserver/linux-aarch64-low.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc index da5c1fd06298..eb30c31f8f80 100644 --- a/gdbserver/linux-aarch64-low.cc +++ b/gdbserver/linux-aarch64-low.cc @@ -554,7 +554,7 @@ CORE_ADDR aarch64_target::low_stopped_data_address () { siginfo_t siginfo; - int pid, i; + int pid; struct aarch64_debug_reg_state *state; pid = lwpid_of (current_thread); -- 2.39.3 --sDo3MGbsonKgH8Us--