This is an archive of the discontinued LLVM Phabricator instance.

Enable test log collection from remote debug servers
ClosedPublic

Authored by labath on Jan 19 2016, 9:31 AM.

Details

Summary

We already have the ability to collect the server logs when doing local debugging. This enables
the collection of remote logs as well. This relies on specifying a relative path "server.log" for
LLDB_DEBUGSERVER_LOG_FILE when starting remote platform. Since we always set the platform working
directory to a fresh folder to avoid conflicts, the actual file path will always be different and
we can pick the logs up from there.

Diff Detail

Repository
rL LLVM

Event Timeline

labath updated this revision to Diff 45273.Jan 19 2016, 9:31 AM
labath retitled this revision from to Enable test log collection from remote debug servers.
labath updated this object.
labath added a reviewer: tfiala.
labath added a subscriber: lldb-commits.

Any thoughts? Objections? Indifference? :)

tfiala edited edge metadata.Jan 21 2016, 8:11 AM

Oops, this one slipped past me. Looking now!

tfiala accepted this revision.Jan 21 2016, 8:19 AM
tfiala edited edge metadata.

Looks reasonable.

I added one question on whether we can get a warning on failure to retrieve the server.log file when expecting one and it doesn't show up (perhaps only in verbose mode), which is totally not needed for this patch.

There's also one minor comment fix.

packages/Python/lldbsuite/test/lldbtest.py
1380 ↗(On Diff #45273)

minor: s/writting/writing/

1385–1386 ↗(On Diff #45273)

It might be nice to get some kind of output (perhaps in verbose mode?) if we're expecting the server.log to be there but we fail to retrieve it. (Just a warning). Does lldb.remote_platform.Get() already do that on a failure?

This revision is now accepted and ready to land.Jan 21 2016, 8:19 AM
labath added inline comments.Jan 21 2016, 8:40 AM
packages/Python/lldbsuite/test/lldbtest.py
1385–1386 ↗(On Diff #45273)

It's not really clear when are we expecting it. A user might choose to enable logging on the remote system, or he may choose not to. Both are valid options, and right now we don't tell the client which one of them is happening. So, unless we introduce another option --enable-server-logging or something, the client has no way of knowing whether server logging is active.

Perhaps I could just rephrase the comment to better explain the "best-effort" part?

tfiala added inline comments.Jan 21 2016, 8:50 AM
packages/Python/lldbsuite/test/lldbtest.py
1385–1386 ↗(On Diff #45273)

Oh okay - I thought we'd know for sure if the user was trying (or not trying) to log on the remote system. If we don't know, no biggie. I just thought it would be nice to know we didn't get the log when we were expecting it. But if that's not possible, so be it.

This revision was automatically updated to reflect the committed changes.