public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Denio, Mike" <miked@ti.com>
To: Andreas Schwab <schwab@linux-m68k.org>,
	"Denio, Mike via Gdb" <gdb@sourceware.org>
Subject: RE: [EXTERNAL] Re: Confused by watchpoints on remote protocol
Date: Sun, 7 Aug 2022 14:43:42 +0000	[thread overview]
Message-ID: <1015b1085fd34dd4bd313e30785beabe@ti.com> (raw)
In-Reply-To: <1c446d6e52484cc8a3ac284726046913@ti.com>

I verified with a compiled C program, the watch always uses a hardware watch.

Not sure what it doesn't like about my assembly, but it obviously has nothing to do with my GDB server, so pressing on ...

Thanks for the suggestion.

Mike

-----Original Message-----
From: Denio, Mike <> 
Sent: Sunday, August 07, 2022 2:34 AM
To: 'Andreas Schwab' <schwab@linux-m68k.org>; Denio, Mike via Gdb <gdb@sourceware.org>
Subject: RE: [EXTERNAL] Re: Confused by watchpoints on remote protocol

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 <schwab@linux-m68k.org> 
Sent: Sunday, August 07, 2022 2:24 AM
To: Denio, Mike via Gdb <gdb@sourceware.org>
Cc: Denio, Mike <miked@ti.com>
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, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

      reply	other threads:[~2022-08-07 14:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-06 20:42 Denio, Mike
2022-08-07  6:25 ` Denio, Mike
2022-08-07  7:23   ` Andreas Schwab
2022-08-07  7:34     ` [EXTERNAL] " Denio, Mike
2022-08-07 14:43       ` Denio, Mike [this message]

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=1015b1085fd34dd4bd313e30785beabe@ti.com \
    --to=miked@ti.com \
    --cc=gdb@sourceware.org \
    --cc=schwab@linux-m68k.org \
    /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).