Page MenuHomePhabricator

[lldb] [test] Add a minimal test for x86 dbreg reading
ClosedPublic

Authored by mgorny on Wed, Nov 11, 7:38 AM.

Details

Summary

Add a test verifying that after the 'watchpoint' command, new values
of x86 debug registers can be read back correctly. The primary purpose
of this test is to catch broken DRn reading and help debugging it.

Diff Detail

Event Timeline

mgorny created this revision.Wed, Nov 11, 7:38 AM
mgorny requested review of this revision.Wed, Nov 11, 7:38 AM

I have a feeling we discussed this already, but I don't remember what was the conclusion.

Was exposing debug registers to the user a conscious choice? Other OSes don't actually do that. Neither does gdb, afaict...

In think that allowing the user to see dr contents is a good idea -- allows him to check what the debugger has done. I'm not convinced about the writing aspect though -- seems like an easy way to confuse the debugger and make it crash...

lldb/test/Shell/Register/x86-db-read.test
3

Who sets can-set-dbregs ?

I have a feeling we discussed this already, but I don't remember what was the conclusion.

Was exposing debug registers to the user a conscious choice? Other OSes don't actually do that. Neither does gdb, afaict...

In think that allowing the user to see dr contents is a good idea -- allows him to check what the debugger has done. I'm not convinced about the writing aspect though -- seems like an easy way to confuse the debugger and make it crash...

I agree with this. Hence, I've covered only the reading part. I don't have a strong opinion whether we should ban writes.

lldb/test/Shell/Register/x86-db-read.test
3
lldb/test/Shell/Register/x86-db-read.test
3

The feature name is dbregs-set, is it not ?

mgorny updated this revision to Diff 304751.Thu, Nov 12, 1:48 AM

Corrected REQUIRES.

mgorny added inline comments.Thu, Nov 12, 3:39 AM
lldb/test/Shell/Register/x86-db-read.test
3

Indeed it is. Silly me.

mgorny updated this revision to Diff 304772.Thu, Nov 12, 3:40 AM

Restrict the test to FreeBSD only.

labath accepted this revision.Thu, Nov 12, 4:55 AM
This revision is now accepted and ready to land.Thu, Nov 12, 4:55 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptThu, Nov 12, 5:09 AM