We want to forward stdin when stdio is not disabled and when we're not
redirecting stdin from a file.
renamed m_stdio_disable to m_stdin_forward and inverted value because
that's what we want to remember.
There was previously a bug that if you redirected stdin from a file,
stdout and stderr would also be redirected to /dev/null
Adds support for remote target to TestProcessIO.py
Fixes ProcessIOTestCase.test_stdin_redirection_with_dwarf for remote
Linux targets
llvm-svn: 228744
This file MICmnStreamStdinLinux.cpp is wrongly added in the windows build.
It has no use there. CMakeList.txt for lldb-mi needs to be re-factored to
include the right file for each build. This is quick fix to un-break the build.
llvm-svn: 228714
Summary:
I don't know if there is a better way for the change in source/Host/freebsd/ThisThread.cpp
Reviewers: emaste
Subscribers: hansw, emaste, lldb-commits
Differential Revision: http://reviews.llvm.org/D7441
llvm-svn: 228710
Summary:
One of the problem is reported here.
http://llvm.org/bugs/show_bug.cgi?id=22411
A fix was committed for this problem that works only for OSX. This revision
extends that fix to other system. The select system call has some limitation with
multi-threaded application which have been addresses here.
LLDB-mi exits if quit command is given but needs an extra retur if -gdb-exit is
given. That issue has also been addressed.
Reviewers: ki.stfu, emaste
Reviewed By: ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D7529
llvm-svn: 228709
The problem occurred when we had incorrect address ranges in the debug map that included the padding between functions causing the end address of a line table entry to fall into an inlinked (next function) address range.
<rdar://problem/19721144>
llvm-svn: 228707
This test case was checking for a specific stop reason which is different on
Linux. This caused the test to fail. It now only checks for stoppped. Also added
some more steps to run to main so that we dont pass when application has run to
completion.
llvm-svn: 228584
Previously the offset field showed the offset from the section base.
I have fixed it so that first disassembled instruction has offset of 0.
Also made a little modification in the test case to match the output coming
form the lldb-mi.
llvm-svn: 228577
The test case were failing becuase my test compiler was gcc. The generated
code behaved a bit differently to the how the test expected. Adjusted a few
lines so that it works on both gcc and clang.
llvm-svn: 228576
Summary:
When debugging two targets concurrently, the pseude terminal master fd from the first one would
leak into the second. This fixes the problem by setting O_CLOEXEC on the master fd. Test
included.
Reviewers: clayborg, vharron
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D7466
llvm-svn: 228570
For some time, eclipse (CDT) uses full path of the file in break-insert command
when putting breakpoint on a source line. On windows, a typical command looks
like the following.
56-break-insert -f F:\\work\\ws\\test\\main.c:49
Current implementation in lldb-mi have problem in 2 ways.
1. It was assuming that there will be only one : in the path which is wrong if full
path is supplied.
2. CDT sends out path with double backslashes in windows which gives error on
resolution.
Fixed the : issue in lldb-mi. Changed FileSpec::Normalize to make sure that it
handles the path with \\ correctly. Added test cases to check for full path in
both lldb-mi and lldb. Also added a test case to check SBFileSpec with double
slashes.
llvm-svn: 228538
only execute thumb instructions, force the arch triple string to
be "thumbv..." instead of "armv..." so we do the right thing by
default when disassembling arbitrary chunks of code.
<rdar://problem/15126397>
llvm-svn: 228486
If you do, the test runner will fail immediately with the error:
close_fds is not supported on Windows platforms if you redirect
stdin/stdout/stderr.
llvm-svn: 228472
Processes running on a remote target can already send $O messages
to send stdout but there is no way to send stdin to a remote
inferior.
This allows processes using the API to pump stdin into a remote
inferior process.
It fixes a hang in TestProcessIO.py when running against a remote
target.
llvm-svn: 228419
Summary:
This patch fixes *stopped notification for remote target when started with eLaunchFlagStopAtEntry (for example, using "process launch -s").
See explanation below:
```
Target::Launch (ProcessLaunchInfo &launch_info, Stream *stream)
{
...
if (state != eStateConnected && platform_sp && platform_sp->CanDebugProcess ())
{
...
}
else
{
...
if (m_process_sp)
error = m_process_sp->Launch (launch_info);
}
if (error.Success())
{
if (launch_info.GetFlags().Test(eLaunchFlagStopAtEntry) == false)
{
....
}
-- missing event if eLaunchFlagStopAtEntry is set --
m_process_sp->RestoreProcessEvents ();
}
...
return error
```
Also this patch contains tests and you can check how it works.
Reviewers: zturner, clayborg, abidh
Reviewed By: clayborg
Subscribers: clayborg, abidh, zturner, lldb-commits
Differential Revision: http://reviews.llvm.org/D7273
llvm-svn: 228417
Summary:
This fixes test_with_dsym_and_run_command and test_with_dwarf_and_run_commands tests after r227285: "SBThread::GetDescription should use the Thread format instead of making up"
log:
```
======================================================================
FAIL: test_with_dsym_and_run_command (TestConvenienceVariables.ConvenienceVariablesCase)
Test convenience variables lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 456, in wrapper
return func(self, *args, **kwargs)
File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 612, in wrapper
func(*args, **kwargs)
File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 18, in test_with_dsym_and_run_command
self.convenience_variables()
File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 83, in convenience_variables
patterns = ['SBThread: tid = 0x[0-9a-f]+'])
File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 2091, in expect
msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : 'print lldb.thread
thread #1: tid = 0x80d885, 0x0000000100000f4d a.out`main(argc=1, argv=0x00007fff5fbff078) + 29 at main.c:4, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
' matches expected result
Config=x86_64-clang
======================================================================
FAIL: test_with_dwarf_and_run_commands (TestConvenienceVariables.ConvenienceVariablesCase)
Test convenience variables lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 473, in wrapper
return func(self, *args, **kwargs)
File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 641, in wrapper
func(*args, **kwargs)
File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 612, in wrapper
func(*args, **kwargs)
File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 537, in wrapper
func(*args, **kwargs)
File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 537, in wrapper
func(*args, **kwargs)
File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 28, in test_with_dwarf_and_run_commands
self.convenience_variables()
File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 83, in convenience_variables
patterns = ['SBThread: tid = 0x[0-9a-f]+'])
File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 2091, in expect
msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : 'print lldb.thread
thread #1: tid = 0x80d8d3, 0x0000000100000f4d a.out`main(argc=1, argv=0x00007fff5fbff078) + 29 at main.c:4, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
' matches expected result
Config=x86_64-clang
```
Reviewers: zturner, jingham, abidh, clayborg
Subscribers: abidh, lldb-commits, jingham, clayborg, zturner
Differential Revision: http://reviews.llvm.org/D7464
llvm-svn: 228415
Summary:
These changes include:
* Fix -var-create to be able use current frame '*' (MI)
* Fix print-values option in -var-update (MI)
* Fix 'variable doesn't exist' error in -var-show-attributes (MI)
* Mark print-values option as 'handled-by-cmd' in -var-update (MI)
* Fix SBValue::GetValueDidChange if value was changed
* Fix lldb-mi: -data-evaluate-expression shows undef vars. Before this fix -data-evaluate-expression perceives undefined variables as strings:
```
(gdb)
-data-evaluate-expression undef
^done,value="undef"
```
* Minor fix: -data-evaluate-expression uses IsUnknownValue()
* Enable MiEvaluateTestCase test
All test pass on OS X.
Reviewers: abidh, clayborg
Subscribers: lldb-commits, clayborg, abidh
Differential Revision: http://reviews.llvm.org/D7463
llvm-svn: 228414
Summary:
These changes include:
* Add eVariableInfoFormat argument for MIResponseFormVariableInfo{,2,3} and GetVariableInfo{,2} functions
* Fix -stack-list-locals and -stack-list-arguments: they ingored print-values
* Enable MiStackTestCase tests for -stack-list-xxx commands
All test pass on OS X.
Reviewers: abidh, clayborg
Reviewed By: abidh
Subscribers: lldb-commits, clayborg, abidh
Differential Revision: http://reviews.llvm.org/D7462
llvm-svn: 228412
Summary:
* Fix -data-list-register-names command: previously it ignored regno arguments and always showed all registers
* Add 'size' field to -data-disassemble command: now we are able to get an instruction's size
* Minor fix in -data-list-register-value: fix comments/code style
* Enable all tests in MiDataTestCase
* Fix the GetRegister function that gets an register by its index
These changes were tested on OS X; all MiDataTestCase tests were passed.
Reviewers: clayborg, abidh
Reviewed By: clayborg, abidh
Subscribers: clayborg, abidh, lldb-commits
Differential Revision: http://reviews.llvm.org/D7442
llvm-svn: 228393
Summary:
After closing all the leaked file descriptors to the inferior tty, the following problem occured:
- when stdin, stdout and stderr are redirected, there are no slave descriptors open (which is good)
- lldb has a reader thread, which attempts to read from the master end of the tty
- this thread receives an EOF
- in response, it closes it's master end
- as this is the last open file descriptor for the master end, this deletes the tty and sends
SIGHUP to the inferior (this is bad)
I fix this problem by making sure the master end remains open for the duration of the inferior
process by storing a copy of the file descriptor in ProcessMonitor. I create a copy to avoid
ownership issues with the reading thread.
Reviewers: ovyalov, emaste
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D7440
llvm-svn: 228391
This command is not implemented yet. Giving error gives chance to clients to
handle it properly instead of falsely assuming the lldb-mi is supporting it.
llvm-svn: 228389
* Fix cmake script for android x86
* Reorder includes to avoid collision between system macros and local
variables in clang framework
Differential Revision: http://reviews.llvm.org/D7435
llvm-svn: 228388
* Set the state of the process into running/stepping on continue/step operations
* Add mutex to use transactions in Thread State Coordinator
** It is required because the events from two Signal Handler or form a Signal handler and a Resume request shouldn't overlap
* Send Stop Replay Packet only when the state of the process changed
Differential Revision: http://reviews.llvm.org/D7374
llvm-svn: 228387
This also hooks up the new C++14 language constant to be treated
the same as the other C++ language constants.
Differential Revision: http://reviews.llvm.org/D7429
llvm-svn: 228386
and/or one or more addresses (with -a) and until will stop at the first one of thesepoints it hits,
or on exit from the function if you leave the function before hitting any of these stop points.
<rdar://problem/12438270>
llvm-svn: 228370
Summary:
This commit adds a new open flag File::eOpenOptionCloseOnExec (i.e., O_CLOEXEC), and adds it to
the list of flags when opening log files (#ifndef windows). A regression test is included.
Reviewers: vharron, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D7412
llvm-svn: 228310