This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [Process/FreeBSDRemote] Enable watchpoint support
ClosedPublic

Authored by mgorny on Oct 24 2020, 10:54 AM.

Details

Summary

Replace the inline x86 watchpoint handling code with the reusable
NativeRegisterContextWatchpoint_x86. Implement watchpoint support
in NativeThreadFreeBSD and SIGTRAP handling for watchpoints.

Un-skip all concurrent_events tests as they pass with the new plugin.

Diff Detail

Event Timeline

mgorny created this revision.Oct 24 2020, 10:54 AM
mgorny requested review of this revision.Oct 24 2020, 10:54 AM
mgorny planned changes to this revision.Oct 26 2020, 2:52 AM

This patch breaks multithreaded register tests, so I need to look into threading more.

mgorny updated this revision to Diff 300741.Oct 26 2020, 11:02 AM
mgorny edited the summary of this revision. (Show Details)

Ok, should be fixed now.

mgorny updated this revision to Diff 300806.Oct 26 2020, 3:23 PM

Included a fix to respect LLDB_REMOTE_PLUGIN in API tests, and reenabled more tests. FWICS these tests also pass with the old plugin.

labath accepted this revision.Oct 27 2020, 2:30 AM
labath added inline comments.
lldb/source/Plugins/Process/FreeBSDRemote/NativeThreadFreeBSD.cpp
192–193

Are you actually using this state for anything? Should this be an assert? Maybe assert(m_state == eStateStopped) even ?

This revision is now accepted and ready to land.Oct 27 2020, 2:30 AM
mgorny added inline comments.Oct 27 2020, 2:39 AM
lldb/source/Plugins/Process/FreeBSDRemote/NativeThreadFreeBSD.cpp
192–193

I don't know, I am a copy-paste monkey ;-). I've presumed LLDB core controls in which states the method will be called.

labath added inline comments.Oct 27 2020, 3:00 AM
lldb/source/Plugins/Process/FreeBSDRemote/NativeThreadFreeBSD.cpp
192–193

Did you copy this code from the in-process plugin? That one uses more states (including this one), and I am not sure about the kind of controls it has.

lldb-server is much simpler, and and I'm confident that it won't call any of these functions when the process is not stopped (but asserting that doesn't hurt).. It also doesn't use eStateLaunching at all (unless you've added it somewhere in the freebsd code, but I hadn't noticed anything). This last bit is also the reason why I'd like to use a different State enum in lldb-server one day...

mgorny added inline comments.Oct 27 2020, 3:28 AM
lldb/source/Plugins/Process/FreeBSDRemote/NativeThreadFreeBSD.cpp
192–193

No, I've copied it from NetBSD. I suppose I'll end up backporting a lot of fixes to NetBSD plugin ;-).

So generally assert that it's stopped. Ok.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2020, 7:38 AM