Page MenuHomeFreeBSD

sys/ddb: Add hardware breakpoint support to ddb
ClosedPublic

Authored by andrew on Oct 30 2019, 12:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 5:48 AM
Unknown Object (File)
Tue, Nov 5, 4:38 PM
Unknown Object (File)
Oct 18 2024, 11:19 PM
Unknown Object (File)
Oct 3 2024, 2:50 PM
Unknown Object (File)
Oct 1 2024, 8:15 PM
Unknown Object (File)
Oct 1 2024, 3:47 PM
Unknown Object (File)
Oct 1 2024, 3:45 PM
Unknown Object (File)
Oct 1 2024, 3:29 PM

Details

Summary

As with hardware watchpoints add support for hardware breakpoints. The
command is only enabled on architectures that report support for them.
Currently no architectures do, however arm64 will add support in a
future change.

Sponsored by: Arm Ltd
Sponsored by: Innovate UK

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 56599
Build 53487: arc lint + arc unit

Event Timeline

All your "stub functions" return (0), when in fact they probably should return an error? Or what happens if someone tries to set a (hw)breakpoint on these architectures?

In D22191#484972, @bz wrote:

All your "stub functions" return (0), when in fact they probably should return an error? Or what happens if someone tries to set a (hw)breakpoint on these architectures?

They are identical to the equivalent watchpoint functions, these also return 0 when not implementing hardware watchpoints.

imp added inline comments.
sys/arm/arm/db_trace.c
141 ↗(On Diff #63789)

Shouldn't the stubs return failure?

sys/arm/arm/db_trace.c
141 ↗(On Diff #63789)

I copied the hardware watchpoint stubs. These all return 0 when not implemented.

andrew retitled this revision from Add hardware breakpoint support to ddb to sys/ddb: Add hardware breakpoint support to ddb.Mar 14 2024, 3:21 PM
andrew edited the summary of this revision. (Show Details)
  • Rebase
  • Split out arm64 changes to new reviews
  • Limit the hw breakpoint commands to architectures that support them
This revision is now accepted and ready to land.Mar 19 2024, 5:28 PM
sys/ddb/db_break.c
261

You don't need the count for removing the breakpoint. The intention in DDB is that the count is the "skip count" similar to 'c 10' or the like in GDB.

andrew added inline comments.
sys/ddb/db_break.c
261

I've reworked the breakpoint handling code to support this correctly

This revision now requires review to proceed.Mar 21 2024, 3:45 PM

Add missing HAS_HW_BREAKPOINT check

This revision was not accepted when it landed; it landed in state Needs Review.Apr 12 2024, 9:38 AM
This revision was automatically updated to reflect the committed changes.