Export a breakpoint() function to userland.
Needs ReviewPublic

Authored by jhb on Wed, Apr 25, 2:43 AM.

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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jhb created this revision.Wed, Apr 25, 2:43 AM
andrew added inline comments.Wed, Apr 25, 9:50 AM
sys/arm/include/cpufunc.h
503 ↗(On Diff #41829)

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

jhb added inline comments.Wed, Apr 25, 4:34 PM
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.

andrew added inline comments.Wed, Apr 25, 5:09 PM
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.

emaste added inline comments.Tue, May 1, 1:55 PM
sys/arm/include/cpufunc.h
503 ↗(On Diff #41829)

Perhaps a comment with that reference?

br accepted this revision as: br.Tue, May 1, 3:29 PM
This revision is now accepted and ready to land.Tue, May 1, 3:29 PM
This revision was automatically updated to reflect the committed changes.
jhb reopened this revision.Wed, May 16, 6:43 PM