RE: [EXTERNAL] Re: Confused by watchpoints on remote protocol

"Denio, Mike via Gdb" <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
ram_table was just a symbol I created in assembly.

Its really odd, and its not the symbol itself. For example:

(gdb) watch (uint32_t)ram_table
Watchpoint 1: (uint32_t)ram_table
(gdb) watch *(uint32_t *)&ram_table
Hardware watchpoint 2: *(uint32_t *)&ram_table
(gdb) i b
Num     Type           Disp Enb Address    What
1       watchpoint     keep y              (uint32_t)ram_table
2       hw watchpoint  keep y              *(uint32_t *)&ram_table

I can see both of these variants "watching" the exact same address.

Maybe you are onto something however. I'll try it with a compiled C program and see if the behavior is any different.

Thanks,
Mike

-----Original Message-----
From: Andreas Schwab <[email protected]> 
Sent: Sunday, August 07, 2022 2:24 AM
To: Denio, Mike via Gdb <[email protected]>
Cc: Denio, Mike <[email protected]>
Subject: [EXTERNAL] Re: Confused by watchpoints on remote protocol

On Aug 07 2022, Denio, Mike via Gdb wrote:

> The only question I have is that when I type:
> "watch *(uint32_t *)(0x80000018)"
> I get a hardware watch point.
>
> And when I type:
> "watch (uint32_t)ram_table"
> I get a software watch point.

What is ram_table?

> Anyone know why? And how to change it to be always hardware?

Try looking at breakpoint.c:can_use_hardware_watchpoint.

-- 
Andreas Schwab, [email protected]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.