public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Mark Wielaard <mark@klomp.org>, Tom Tromey <tromey@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix regression on aarch64-linux gdbserver
Date: Fri, 3 May 2024 15:19:33 +0200	[thread overview]
Message-ID: <620860f7-cff9-4407-8611-58bd98c8e667@suse.de> (raw)
In-Reply-To: <ZjQOs8waVQbXM/kq@mwielaar.ams.csb>

On 5/3/24 00:07, Mark Wielaard wrote:
> 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.
> 

Hi Mark,

thanks for the fix.

I ran into the build breaker on an aarch64-linux system, and managed to 
complete the build after applying your fix.

Pushed.

Thanks,
- Tom



  reply	other threads:[~2024-05-03 13:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22 13:51 Tom Tromey
2024-05-02  8:04 ` Luis Machado
2024-05-02 22:07 ` Mark Wielaard
2024-05-03 13:19   ` Tom de Vries [this message]
2024-05-03 20:12   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=620860f7-cff9-4407-8611-58bd98c8e667@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=mark@klomp.org \
    --cc=tromey@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).