public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Is it possible to support gdb command hbreak with target sim ?
@ 2020-09-29  2:29 William Tambe
  2020-09-29  8:46 ` Andrew Burgess
  0 siblings, 1 reply; 4+ messages in thread
From: William Tambe @ 2020-09-29  2:29 UTC (permalink / raw)
  To: gdb

Is it possible to support gdb command hbreak with target sim ?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is it possible to support gdb command hbreak with target sim ?
  2020-09-29  2:29 Is it possible to support gdb command hbreak with target sim ? William Tambe
@ 2020-09-29  8:46 ` Andrew Burgess
  2021-01-13  5:46   ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Burgess @ 2020-09-29  8:46 UTC (permalink / raw)
  To: William Tambe; +Cc: gdb

* William Tambe via Gdb <gdb@sourceware.org> [2020-09-28 21:29:26 -0500]:

> Is it possible to support gdb command hbreak with target sim ?

There's currently no support for hardware breakpoints in the simulator
target, instead only software breakpoints are supported where GDB
takes responsibility for reading and backing up the old memory
contents before writing in a software breakpoint instruction.

This doesn't mean that hardware breakpoint support couldn't be added.

Thanks,
Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is it possible to support gdb command hbreak with target sim ?
  2020-09-29  8:46 ` Andrew Burgess
@ 2021-01-13  5:46   ` Mike Frysinger
  2021-01-13 11:08     ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2021-01-13  5:46 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: William Tambe, gdb

[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]

On 29 Sep 2020 09:46, Andrew Burgess wrote:
> * William Tambe via Gdb <gdb@sourceware.org> [2020-09-28 21:29:26 -0500]:
> > Is it possible to support gdb command hbreak with target sim ?
> 
> There's currently no support for hardware breakpoints in the simulator
> target, instead only software breakpoints are supported where GDB
> takes responsibility for reading and backing up the old memory
> contents before writing in a software breakpoint instruction.
> 
> This doesn't mean that hardware breakpoint support couldn't be added.

this is a bit inaccurate.  i guess "hardware breakpoints" are a bit
confusing when talking about simulators.  and depending on who you
talk to, they might call them "watchpoints" rather than "breakpoints".

there is a sim-watch module that some sim's support.  looks like:
  avr bfin frv iq2000 m32r mips mn10300 moxie v850

so if you're using one of those, it'd be something like:
  $ gdb <prog>
  (gdb) target sim --watch-pc-int 0x1234
  (gdb) load
  (gdb) run

that said, it appears to have a few bugs.  i'm not sure how well it's
tested :).  g'luck!
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is it possible to support gdb command hbreak with target sim ?
  2021-01-13  5:46   ` Mike Frysinger
@ 2021-01-13 11:08     ` Mike Frysinger
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2021-01-13 11:08 UTC (permalink / raw)
  To: Andrew Burgess, William Tambe, gdb

[-- Attachment #1: Type: text/plain, Size: 1547 bytes --]

On 13 Jan 2021 00:46, Mike Frysinger via Gdb wrote:
> On 29 Sep 2020 09:46, Andrew Burgess wrote:
> > * William Tambe via Gdb <gdb@sourceware.org> [2020-09-28 21:29:26 -0500]:
> > > Is it possible to support gdb command hbreak with target sim ?
> > 
> > There's currently no support for hardware breakpoints in the simulator
> > target, instead only software breakpoints are supported where GDB
> > takes responsibility for reading and backing up the old memory
> > contents before writing in a software breakpoint instruction.
> > 
> > This doesn't mean that hardware breakpoint support couldn't be added.
> 
> this is a bit inaccurate.  i guess "hardware breakpoints" are a bit
> confusing when talking about simulators.  and depending on who you
> talk to, they might call them "watchpoints" rather than "breakpoints".
> 
> there is a sim-watch module that some sim's support.  looks like:
>   avr bfin frv iq2000 m32r mips mn10300 moxie v850
> 
> so if you're using one of those, it'd be something like:
>   $ gdb <prog>
>   (gdb) target sim --watch-pc-int 0x1234
>   (gdb) load
>   (gdb) run
> 
> that said, it appears to have a few bugs.  i'm not sure how well it's
> tested :).  g'luck!

i've posted some fixes so things should work much better for gdb-11.

but to your original question, i don't think the sim target integrates
with gdb's "hbreak" command.  i haven't looked at those codepaths in
quite sometime though tbh, and gdb has changed drastically since.

maybe Andrew would know offhand.
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-13 11:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29  2:29 Is it possible to support gdb command hbreak with target sim ? William Tambe
2020-09-29  8:46 ` Andrew Burgess
2021-01-13  5:46   ` Mike Frysinger
2021-01-13 11:08     ` Mike Frysinger

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).