llvm-project/lldb/source/Target
Todd Fiala 75f47c3a5d llgs: fixes to PTY/gdb-remote inferior stdout/stderr handling, logging addtions.
With this change, both local-process llgs and remote-target llgs stdout/stderr
handling from inferior work correctly.

Several log lines have been added around PTY and stdout/stderr redirection
logic on the lldb client side.

Regarding remote llgs execution, see the following:

With these changes, remote llgs with $O now works properly:

$ lldb
(lldb) platform select remote-linux
(lldb) target create ~/some/inferior/exe
(lldb) gdb-remote {some-target}:{port}
(lldb) run

The sequence above will correctly redirect stdout/stderr over gdb-remote $O,
as is needed for remote debugging.  That sequence assumes there is a lldb-gdbserver
exe running on the target with {some-host}:{port}.

You can replace the gdb-remote command with a '(lldb) platform connect
connect://{target-ip}:{target-port}'.  If you do this and have a
lldb-platform running on the remote end, it will go ahead and launch
llgs for lldb for each target instance that is run/attached.

For local debugging with llgs, the following sequence also works, and
uses local PTYs instead to avoid $O and extra gdb-remote messages:

$ lldb
(lldb) settings set platform.plugin.linux.use-llgs true
(lldb) target create ~/some/inferior/exe
(lldb) run

The above will run the inferior using llgs on the local host, and
will use PTYs rather than $O redirection.

This change also removes the logging that happened after the fork but
before the exec when llgs is launching a new inferior process.  Some
aspect of the file handling during that portion of code would not do
the right thing with log handling.  We might want to go back later
and have that communicate over a pipe from the child to parent to pass
along any messages that previously were logged in that section of code.

llvm-svn: 219578
2014-10-11 21:42:09 +00:00
..
ABI.cpp ABI for the Hexagon DSP 2014-07-21 17:21:01 +00:00
CMakeLists.txt LLDB AddressSanitizer instrumentation runtime plugin, breakpint on error and report data extraction 2014-10-10 23:43:03 +00:00
CPPLanguageRuntime.cpp <rdar://problem/11398407> 2013-05-18 00:11:21 +00:00
ExecutionContext.cpp Merging the iohandler branch back into main. 2014-01-27 23:43:24 +00:00
FileAction.cpp Enable local llgs debugging on Linux when the use-llgs-for-local setting is enabled. 2014-10-10 00:09:16 +00:00
InstrumentationRuntime.cpp LLDB AddressSanitizer instrumentation runtime plugin, breakpint on error and report data extraction 2014-10-10 23:43:03 +00:00
InstrumentationRuntimeStopInfo.cpp LLDB AddressSanitizer instrumentation runtime plugin, breakpint on error and report data extraction 2014-10-10 23:43:03 +00:00
JITLoader.cpp Moved JITLoader.cpp and JITLoaderList.cpp over into "source/Target" since the header files were in "include/lldb/Target". 2014-03-06 00:14:12 +00:00
JITLoaderList.cpp Create a Process::ModulesDidLoad() method to handle process-related tasks, as suggested by Jim Ingham. Make JITLoader instances use this to probe only new modules for relevant JIT symbols. Also re-enable the JITLoader hooks in Process. 2014-03-13 09:37:02 +00:00
LanguageRuntime.cpp [dwarf] Add new language enumerations. 2014-08-26 21:22:49 +00:00
Makefile
Memory.cpp Clean-up warnings on Linux/GCC 2014-09-16 06:34:29 +00:00
MemoryHistory.cpp ASan malloc/free history threads 2014-09-04 01:03:18 +00:00
NativeRegisterContext.cpp Add lldb-gdbserver support for Linux x86_64. 2014-06-30 21:05:18 +00:00
NativeRegisterContextRegisterInfo.cpp Add lldb-gdbserver support for Linux x86_64. 2014-06-30 21:05:18 +00:00
ObjCLanguageRuntime.cpp This is a fairly bulky patch, but a lot of it involves rearranging existing code 2014-08-19 21:46:37 +00:00
OperatingSystem.cpp <rdar://problem/13854277> 2013-05-10 21:47:16 +00:00
PathMappingList.cpp Start converting usages of off_t to other types. 2014-07-02 17:24:07 +00:00
Platform.cpp logging: added more logging to the Target/Platform launch & attach sequence. 2014-10-09 01:02:08 +00:00
Process.cpp Add a IsInstrumentationRuntimePresent SB API 2014-10-11 01:59:32 +00:00
ProcessInfo.cpp Pull ProcessInfo and ProcessLaunchInfo out of Target/Process. 2014-06-30 00:30:53 +00:00
ProcessLaunchInfo.cpp llgs: fixes to PTY/gdb-remote inferior stdout/stderr handling, logging addtions. 2014-10-11 21:42:09 +00:00
Queue.cpp Add a SBQueue::GetKind() method to retrieve the type of libdispatch queue (serial or concurrent). 2014-03-13 02:54:54 +00:00
QueueItem.cpp Correctly add the QueueID to a pending block's extended thread backtrace thread. 2014-03-10 08:42:03 +00:00
QueueList.cpp Add new Queue, QueueItem, Queuelist, SBQueue, SBQueueItem classes to represent 2013-12-13 00:29:16 +00:00
RegisterContext.cpp Replace uint32_t by lldb::RegisterKing in register context API. 2014-07-02 09:51:28 +00:00
SectionLoadHistory.cpp Fix typos. 2014-07-01 21:22:11 +00:00
SectionLoadList.cpp Fix typos. 2014-07-08 18:05:41 +00:00
StackFrame.cpp Add a new disassembly-format specification so that the disassembler 2014-10-10 23:07:36 +00:00
StackFrameList.cpp Fix typos. 2014-07-08 18:05:41 +00:00
StackID.cpp sweep up -Wformat warnings from gcc 2014-04-04 04:06:10 +00:00
StopInfo.cpp LLDB AddressSanitizer instrumentation runtime plugin, breakpint on error and report data extraction 2014-10-10 23:43:03 +00:00
SystemRuntime.cpp Change the Mac OS X SystemRuntime plugin from using the placeholder 2014-02-05 05:44:54 +00:00
Target.cpp llgs: fixes to PTY/gdb-remote inferior stdout/stderr handling, logging addtions. 2014-10-11 21:42:09 +00:00
TargetList.cpp Test suite runs better again after recent fixes that would select a platform if a "file a.out" auto selected a different platform than the selected one. 2014-09-19 20:11:50 +00:00
Thread.cpp LLDB AddressSanitizer instrumentation runtime plugin, breakpint on error and report data extraction 2014-10-10 23:43:03 +00:00
ThreadCollection.cpp [lldb] Abstract a superclass for a generic thread container. 2014-09-05 19:13:15 +00:00
ThreadList.cpp [lldb] Abstract a superclass for a generic thread container. 2014-09-05 19:13:15 +00:00
ThreadPlan.cpp sweep up -Wformat warnings from gcc 2014-04-04 04:06:10 +00:00
ThreadPlanBase.cpp Improve logging a bit by printing the exception or signal type description. 2014-02-27 19:35:12 +00:00
ThreadPlanCallFunction.cpp Fix the behavior when hand-calling a function times out on one thread, 2014-04-08 21:33:21 +00:00
ThreadPlanCallUserExpression.cpp Move some Host logic into HostInfo class. 2014-08-19 17:18:29 +00:00
ThreadPlanPython.cpp This checkin is the first step in making the lldb thread stepping mechanism more accessible from 2014-09-29 23:17:18 +00:00
ThreadPlanRunToAddress.cpp Fix typos. 2014-07-01 21:22:11 +00:00
ThreadPlanShouldStopHere.cpp When stepping, handle the case where the step leaves us with 2014-08-06 01:49:59 +00:00
ThreadPlanStepInRange.cpp This checkin is the first step in making the lldb thread stepping mechanism more accessible from 2014-09-29 23:17:18 +00:00
ThreadPlanStepInstruction.cpp Add the ability to provide a "count" option to the various "thread step-*" operations. Only 2014-07-08 19:28:57 +00:00
ThreadPlanStepOut.cpp This checkin is the first step in making the lldb thread stepping mechanism more accessible from 2014-09-29 23:17:18 +00:00
ThreadPlanStepOverBreakpoint.cpp Fix stepping over the inserted breakpoint trap when the NEXT instruction 2014-10-08 01:03:54 +00:00
ThreadPlanStepOverRange.cpp This checkin is the first step in making the lldb thread stepping mechanism more accessible from 2014-09-29 23:17:18 +00:00
ThreadPlanStepRange.cpp This checkin is the first step in making the lldb thread stepping mechanism more accessible from 2014-09-29 23:17:18 +00:00
ThreadPlanStepThrough.cpp Not all processes have a Dynamic Loader. Be sure to check that it exists before using it. 2014-09-30 20:33:25 +00:00
ThreadPlanStepUntil.cpp Fetching the parent frame may fail, handle that case. Patch from Tong Shen. 2014-08-11 23:57:43 +00:00
ThreadPlanTracer.cpp Add a new disassembly-format specification so that the disassembler 2014-10-10 23:07:36 +00:00
ThreadSpec.cpp Resolve printf formatting warnings on Linux: 2012-11-29 21:49:15 +00:00
UnixSignals.cpp Change the default handling for SIGALRM and SIGCHLD to not notify. 2013-10-28 19:00:42 +00:00
UnwindAssembly.cpp Fix UnwindAssembly memory leak by defining and using a shared UnwindAssemblySP type. 2014-02-03 23:49:47 +00:00