This is an archive of the discontinued LLVM Phabricator instance.

Initialize ProcessPOSIXLog by NativeProcessLinux
ClosedPublic

Authored by tberghammer on Mar 5 2015, 6:28 AM.

Details

Summary

Initialize ProcessPOSIXLog by NativeProcessLinux

Previously it was initialized by ProcessLinux but lldb-server don't contain ProcessLinux anymore (since the separation of the dependencies) so it have to be initialized by NativeProcessLinux also.

Diff Detail

Repository
rL LLVM

Event Timeline

tberghammer updated this revision to Diff 21272.Mar 5 2015, 6:28 AM
tberghammer retitled this revision from to Initialize ProcessPOSIXLog by NativeProcessLinux.
tberghammer updated this object.
tberghammer edited the test plan for this revision. (Show Details)
tberghammer added reviewers: flackr, vharron.
tberghammer added a subscriber: Unknown Object (MLST).
flackr edited edge metadata.Mar 5 2015, 8:18 AM

Isn't this equivalent to calling ProcessLinux::Initialize in InitializeForLLGS?

No, it don't register the process linux plugin into the plugin manager.

flackr added a comment.Mar 5 2015, 8:28 AM

No, it don't register the process linux plugin into the plugin manager.

Ah of course, makes sense. Can we remove the common code from ProcessLinux and only register the plugin in ProcessLinux::Initialize or implicitly initialize NativeProcessLinux from ProcessLinux::Initialize?

We can, but ProcessPOSIXLog is a dependency for both of them, so I think it isn't a good idea.

If we want to reduce the amount of code duplication, then I would suggest to simplify the process of registering a log channel to just one function call (e.g.: create a ProcessPOSIXLog::RegisterLogger (const ConstString& name)) function.

flackr added a comment.Mar 5 2015, 9:09 AM

We can, but ProcessPOSIXLog is a dependency for both of them, so I think it isn't a good idea.

If we want to reduce the amount of code duplication, then I would suggest to simplify the process of registering a log channel to just one function call (e.g.: create a ProcessPOSIXLog::RegisterLogger (const ConstString& name)) function.

But lldb_private::Initialize initializes everything (i.e. calls lldb_private::InitializeForLLGS), I think it's reasonable to expect there are some inter-dependencies. That being said I'm fine with moving it to ProcessPOSIXLog::RegisterLogger as long as it doesn't matter that it will be called twice, just trying to reduce code duplication.

tberghammer planned changes to this revision.Mar 5 2015, 9:27 AM

Move NativeProcessLinux::Initialize() call into lldb-gdbserver.cpp

tberghammer edited edge metadata.
flackr accepted this revision.Mar 5 2015, 10:51 AM
flackr edited edge metadata.

lgtm

This revision is now accepted and ready to land.Mar 5 2015, 10:51 AM
This revision was automatically updated to reflect the committed changes.