This is an archive of the discontinued LLVM Phabricator instance.

Don't include UnixSignals.h from Host
ClosedPublic

Authored by zturner on Feb 5 2019, 12:52 PM.

Details

Summary

This file lives in Target, which makes sense since it is supposed to represent the various types of signals that can occur on any platform (since you might be remote debugging a platform with different signals than the host).

However, Host had a method called GetUnixSignals which just returned an instance of this class initialized for the Host's signals. Rather than have this functionality in Host, we can just provide a static factory method on UnixSignals called CreateForHost. This brings us one step closer to breaking the Target -> Host -> Target cycle.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

zturner created this revision.Feb 5 2019, 12:52 PM
labath accepted this revision.Feb 6 2019, 12:48 AM
labath added reviewers: jingham, davide.

The rationale you give for this class being in Target is sound from the POV of lldb client. (the CreateForHost function is slightly fishy, but not too much.) However, it starts to break down when you start to consider lldb-server, whose large chunk of responsibility revolves around signals, but it doesn't need anything else in the Target module. For that, I think the ultimate place of UnixSignals should be somewhere else (I was planning to try to move it to Utility, which would mean that GetHostSignals could stay where it is).

However, we still have a long way to go before we can make lldb-server more independent, and the changes you make here are fairly small and easy to back out if needed. Since they solve the immediate problems with the Host module, I think it's fine to do this change now, and then revisit the placement of this class later.

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
401 ↗(On Diff #185379)

Despite being burried in Plugins/Process/gdb-remote, this code is actually part of lldb-server (and only lldb-server).

This revision is now accepted and ready to land.Feb 6 2019, 12:48 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald Transcript