This is an archive of the discontinued LLVM Phabricator instance.

Implement ProcessInfo::Dump(), log gdb-remote stub launch
ClosedPublic

Authored by tfiala on May 26 2016, 9:26 PM.

Details

Summary

This change implements dumping the executable, triple,
args and environment when using ProcessInfo::Dump().

It also tweaks the way Args::Dump() works so that it prints
a configurable label rather than argv[{index}]={value}. By
default it behaves the same, but if the Dump() method with
the additional arg is provided, it can be overridden. The
environment variables dumped as part of ProcessInfo::Dump()
make use of that.

lldb-server has been modified to dump the gdb-remote stub's
ProcessInfo before launching if the "gdb-remote process" channel
is logged.

Diff Detail

Event Timeline

tfiala updated this revision to Diff 58750.May 26 2016, 9:26 PM
tfiala retitled this revision from to Implement ProcessInfo::Dump(), log gdb-remote stub launch.
tfiala added reviewers: clayborg, labath, ovyalov.
tfiala updated this object.
tfiala added a subscriber: lldb-commits.

Hang on, this diff is busted. It seems to have a few more changes in it than came from me. (I suspect it is something slightly out of sync between my change branch and trunk... I'll re-upload as soon as I straighten that out).

tfiala updated this revision to Diff 58751.May 26 2016, 9:31 PM

Fixed up whatever my arcanist-foo did wrong on the initial 'arc diff' creation of the patch. (The diff I'm putting up is exactly what comes out of 'git diff origin/master', so not sure how this got mutated into the original diff).

This was the logging I used to discover the breakage in launching debugserver from 'lldb-server platform' on Apple platforms.

clayborg requested changes to this revision.May 27 2016, 10:02 AM
clayborg edited edge metadata.

See inlined comments.

include/lldb/Interpreter/Args.h
120

I would make just one Dump function and default the label_name to "argv". No need for two functions.

This revision now requires changes to proceed.May 27 2016, 10:02 AM
tfiala added inline comments.May 27 2016, 10:05 AM
include/lldb/Interpreter/Args.h
120

Okay - I wasn't sure if we preferred to avoid default args - they used to sometimes cause problems with stale compilations in some build systems, but we're probably way past that point nowadays.

I'll fix that up. Also, I'll run it through the clang formatter. I kept the formatting of the (unimplemented) header in ProcessInfo, but that was using the non-official space-before-the-paren style.

tfiala updated this revision to Diff 59105.May 31 2016, 11:30 AM
tfiala edited edge metadata.

Updates per Greg.

  • Args::Dump(stream, label) now takes a default label.
  • Dropped the Args::Dump(stream) call.
  • Converted the Args stream parameter to a ref. It is not valid to call this without a stream.
  • Updated in-source docs to reflect changes.
tfiala marked 2 inline comments as done.May 31 2016, 11:30 AM

Marked comments as done.

clayborg accepted this revision.May 31 2016, 11:35 AM
clayborg edited edge metadata.
This revision is now accepted and ready to land.May 31 2016, 11:35 AM
tfiala closed this revision.May 31 2016, 11:39 AM

Closed by commit r271312.