This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [test] Skip watchpoint tests on NetBSD if userdbregs is disabled
ClosedPublic

Authored by mgorny on Jun 15 2019, 10:57 AM.

Details

Summary

Skip watchpoint tests if security.models.extensions.user_set_dbregs
is disabled. This indicates that unprivileged processes are not allowed
to write to debug registers which is a prerequisite for using hardware
watchpoints.

Diff Detail

Repository
rL LLVM

Event Timeline

mgorny created this revision.Jun 15 2019, 10:57 AM

This definitely aren't all of our watchpoint tests. What's the reason for picking this particular bunch? Are they the only ones enabled on NetBSD right now?

Anyway, given that all of the watchpoint tests are already annotated with the "watchpoint" category, I think it would be better to handle this similar to how we handle other category-based skips (debug info flavours, c++ library types, etc.). This would also enable us to get rid of the "expectedFailure(windows)" decorator on all of these tests by implementing the skip centrally (though you don't have to do that right now). The category-based skipping happens around here: https://github.com/llvm-mirror/lldb/blob/master/packages/Python/lldbsuite/test/dotest.py#L1143

This definitely aren't all of our watchpoint tests. What's the reason for picking this particular bunch? Are they the only ones enabled on NetBSD right now?

Buildbot was down at the moment, so I went only for those that I was sure started failing once I fixed dbreg error reporting.

Anyway, given that all of the watchpoint tests are already annotated with the "watchpoint" category, I think it would be better to handle this similar to how we handle other category-based skips (debug info flavours, c++ library types, etc.). This would also enable us to get rid of the "expectedFailure(windows)" decorator on all of these tests by implementing the skip centrally (though you don't have to do that right now). The category-based skipping happens around here: https://github.com/llvm-mirror/lldb/blob/master/packages/Python/lldbsuite/test/dotest.py#L1143

Will do that.

mgorny updated this revision to Diff 204995.Jun 17 2019, 12:51 AM

Updated as suggested above.

mgorny updated this revision to Diff 204996.Jun 17 2019, 12:52 AM

Removed stale decorator.

labath accepted this revision.Jun 17 2019, 1:14 AM
labath added inline comments.
lldb/packages/Python/lldbsuite/test/dotest.py
1197 ↗(On Diff #204996)

The string isn't used anywhere, but I'd use a slightly more generic value here, because there are a number of reasons watchpoints can/cannot work on a given platform...

This revision is now accepted and ready to land.Jun 17 2019, 1:14 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2019, 2:45 AM

This check should contain additional check for uid==root. If we are root we can read and write to DB registers.

This check should contain additional check for uid==root. If we are root we can read and write to DB registers.

Will do.

ormris removed a subscriber: ormris.Jun 17 2019, 9:30 AM