This is an archive of the discontinued LLVM Phabricator instance.

Implement QPassSignals GDB package in lldb-server
ClosedPublic

Authored by eugene on Feb 22 2017, 7:44 PM.

Details

Summary

QPassSignals package allows lldb client to tell lldb-server to ignore certain types of signals and re-inject them back to inferior without stopping execution.

Diff Detail

Repository
rL LLVM

Event Timeline

eugene created this revision.Feb 22 2017, 7:44 PM
labath edited edge metadata.Feb 23 2017, 3:37 AM

Good stuff. We just need a couple of changes to make this conform better with llvm guidelines.

include/lldb/Host/common/NativeProcessProtocol.h
72 ↗(On Diff #89462)

llvm::ArrayRef<int> signals

320 ↗(On Diff #89462)

use of unordered_set is discouraged in llvm http://llvm.org/docs/ProgrammersManual.html#set-like-containers-std-set-smallset-setvector-etc. It sounds like this would be a good use-case for a llvm::DenseSet or potentially SmallSet.

packages/Python/lldbsuite/test/tools/lldb-server/signal-filtering/Makefile
3 ↗(On Diff #89462)

I am pretty sure the CFLAGS_EXTRAS line is not necessary here.

packages/Python/lldbsuite/test/tools/lldb-server/signal-filtering/TestGdbRemote_QPassSignals.py
73 ↗(On Diff #89462)

I really like how these tests are written. May suggest one more improvement:

  • have the inferior count how many signals it received and then return that number from main()
  • in the test you can then check the exit code matches the number of signals you are expecting

This should verify that we actually pass the signals and not just swallow them silently.

source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
3097 ↗(On Diff #89462)

This is not a big deal, but in LLVM we generally don't put braces around blocks that fit on a single line.

eugene updated this revision to Diff 89575.Feb 23 2017, 3:24 PM
eugene edited the summary of this revision. (Show Details)

Addressing code review comments.

eugene marked 5 inline comments as done.Feb 23 2017, 3:26 PM
labath accepted this revision.Feb 24 2017, 1:38 AM

Looks great. Thank you.

This revision is now accepted and ready to land.Feb 24 2017, 1:38 AM
This revision was automatically updated to reflect the committed changes.