Page MenuHomeFreeBSD

Export a breakpoint() function to userland.
ClosedPublic

Authored by jhb on Apr 25 2018, 2:43 AM.
Tags
None
Referenced Files
F175726295: D15191.id.diff
Mon, Oct 12, 8:07 PM
F175724801: D15191.id44979.diff
Mon, Oct 12, 7:48 PM
F175724789: D15191.id44667.diff
Mon, Oct 12, 7:48 PM
F175724781: D15191.id42636.diff
Mon, Oct 12, 7:48 PM
F175724771: D15191.id41829.diff
Mon, Oct 12, 7:48 PM
Unknown Object (File)
Tue, Sep 29, 12:40 PM
Unknown Object (File)
Mon, Sep 21, 2:27 PM
Unknown Object (File)
Sep 11 2026, 7:19 PM
Subscribers

Details

Summary

As a result, expand coverage of tests using breakpoint() to more
architectures.

Test Plan
  • I have not tested any of these, so testing by others and/or review would be welcome. I would probably commit these separately, but they are glummed together in the branch this is part of so it's a bit easier to solicit review/testing with a combined patch.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/arm/include/cpufunc.h
503 ↗(On Diff #41829)

What instruction is this? You might also be able to use the .inst directive here.

sys/arm/include/cpufunc.h
503 ↗(On Diff #41829)

This matches GDB5_BREAKPOINT from sys/arm/include/trap.h and it is what GDB uses as the default breakpoint instructions for non-thumb arm:

https://github.com/bsdjhb/gdb/blob/master/gdb/arm-tdep.c#L7761

The in-kernel breakpoint() uses .word with the value of KERNEL_BREAKPOINT and I just used that as my template.

sys/arm/include/cpufunc.h
503 ↗(On Diff #41829)

It seems to be udf 0xfdee. udf is an instruction that raises the undefined instruction exception.

sys/arm/include/cpufunc.h
503 ↗(On Diff #41829)

Perhaps a comment with that reference?

This revision is now accepted and ready to land.May 1 2018, 3:29 PM
This revision was automatically updated to reflect the committed changes.
  • Updated to use 'udf' on 32-bit arm and tested on 32-bit arm.
  • Still need to verify arm64.

Have verified via ptrace_test on arm64 as well now, so both arm and arm64 have been runtime tested.

This revision is now accepted and ready to land.Jul 6 2018, 11:40 AM
This revision was automatically updated to reflect the committed changes.