Page MenuHomeFreeBSD

amd64: allow gdb(4) to write to most registers
ClosedPublic

Authored by mhorne on Dec 16 2020, 8:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 18, 12:16 AM
Unknown Object (File)
May 18 2024, 3:20 PM
Unknown Object (File)
May 16 2024, 5:38 AM
Unknown Object (File)
May 16 2024, 5:35 AM
Unknown Object (File)
May 16 2024, 5:35 AM
Unknown Object (File)
May 16 2024, 5:34 AM
Unknown Object (File)
May 16 2024, 5:34 AM
Unknown Object (File)
May 16 2024, 5:22 AM
Subscribers

Details

Summary

Similar to the recent patch to arm's gdb stub in rS368414.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 35449
Build 32359: arc lint + arc unit

Event Timeline

Can we lift the condition out and just have two switches? Not sure if that’s any better but it seems sort of ugly as is.

In D27642#617763, @cem wrote:

Can we lift the condition out and just have two switches? Not sure if that’s any better but it seems sort of ugly as is.

I'm not sure which is worse/better. I'm fine with either approach.

This revision is now accepted and ready to land.Dec 17 2020, 5:33 PM

Update to use two switch statements. This version fits vertically on a single screen, and more closely matches the formatting of gdb_cpu_setreg().

This revision now requires review to proceed.Dec 17 2020, 8:10 PM

Fix typo, GDB_REG_RIP -> GDB_REG_PC.

sys/amd64/amd64/gdb_machdep.c
103

I think the two switch statements is fine. I think the style of the case bodies is perhaps atypical for FreeBSD though.

Ah, I see it matches getreg. Oh well.

Changing getreg to use the new constants might be a nice followup as well.

This revision is now accepted and ready to land.Dec 17 2020, 9:01 PM
sys/amd64/amd64/gdb_machdep.c
103

Yeah, this is a bit of a weird construct with no ideal way to format it. With expanded case bodies the function becomes unreasonably long, so this is the best option, to my eye.

I am planning on that follow-up to getreg().

This revision was automatically updated to reflect the committed changes.