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

Mike Frysinger via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <20210113054649.GC6938@vapier>
On 29 Sep 2020 09:46, Andrew Burgess wrote:
> * William Tambe via Gdb <[email protected]> [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
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAl/+iUkACgkQQWM7n+g3
9YEqUBAAqLOoSOep+z1acMeEfEgCNlgURNCoA5p1wjqwJOJCgOmN5YScu073kdNp
6rDPdfjv3ciDqLzoM847QFqlWtYYByqpKMV9oocYCua3Awgkj2hKnPPdwZLiF50w
WWeT5mji1nA/EpO0w9iVe5btKF/zy1ttb9fKvPq+Ru7wpBoSeTfXAWW2lijLDmlh
UIa3a1La3pdeQnivCgnYL8MuW4FgeiSs31tDnnG/Og7IdUCi0RvN/0um40tVZKk3
JQF6fhe8Nft0ph66r9ZLOp74rL4UeyqYxJ/hDg4CZeEjgKiB1ofI84GaIJJxYuN8
Cpg+yg60rHM5xP7tW3O8h9OtuBzxEZ+b7tOQYtJDsfdoNcQ2aFS8pMkMnKQhjMXT
bQqZz96ijZbE+WcF+oOui0LtTs+jXxgFMlI6XPoyrRc7PfInWbge5Ncoa2++UqWA
FBMPa86aF7zCwknybegEFSc1xT3DosZ3bR2B5GCzQKqGVJi2dmq+ELUB/eYFc/ig
MAJPoXVbXusXlGS3NW5Y2dXTSNlgQAEJsMEVvJhoCaEwWsowODns5l7x3u4OZ7Pu
eVH4JxHuwZuZ7iti0V7Z0rSzCZEBzUA8MB7crWOuNHJx5TXJk1RQpB6xEz4JGWdK
cPw/qfX4ibZ7TOzM5J1KquzAMeWP2O2bHXZmHtuMPc8Bl5ImD/c=
=V+Xb
-----END PGP SIGNATURE-----
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.