This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [test] Fix TestGdbRemote_vContThreads.py logic
ClosedPublic

Authored by mgorny on Mar 16 2021, 4:25 PM.

Details

Summary

The TestGdbRemote_vContThreads.py were introduced to test NetBSD process
plugin's capability of sending per-thread and per-process signals.
However, at some point the tests started failing. From retrospective,
it is possible that they were relying on some bug in the plugin's
original signal handling.

Fix the tests not to expect the process to terminate after receiving
the signals. Instead, scan for output indicating that the signals were
received and match thread IDs in it. Enable 'signal to all threads'
test everywhere as it works fine on Linux. Add a new test for vCont
packet without specific thread IDs. Introduce a helper function
to cover the common part of tests.

While this does not fix all the problems on NetBSD, it enables a subset
of the tests on other systems. I am planning to add more tests
to the group while implementing multiprocess extension for vCont.

Diff Detail

Event Timeline

mgorny requested review of this revision.Mar 16 2021, 4:25 PM
mgorny created this revision.
mgorny updated this revision to Diff 331176.Mar 17 2021, 1:29 AM
mgorny edited the summary of this revision. (Show Details)

Added a helper send_and_check_signal method to reduce code duplication.

labath accepted this revision.Mar 17 2021, 7:46 AM
This revision is now accepted and ready to land.Mar 17 2021, 7:46 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2021, 9:30 AM

Just seen the mail, will commit a skip. I see that other similar tests are apparently skipped there too due to lack of pty.