Abstracted away some POSIX-isms that caused MAKE to issue invalid
commands on Windows. Added a new force-include for the test
programs so that we can use platform-specific macros.
TestSharedLib now builds and cleans up on Windows, though the test
still fails some of the expectations.
Differential Revision: http://reviews.llvm.org/D8277
Patch by: Adrian McCarthy
Issue Tracker: http://llvm.org/pr21727
llvm-svn: 232220
The test cases in TestStubReverseConnect are using a socket connection
from python to lldb-server running on a remote target. To enable the
socket connection an adb port forwarding have to be set up when the
remote target is android.
Differential revision: http://reviews.llvm.org/D8319
llvm-svn: 232170
The value of some_values (pointer) expeced to start by 0x0 but nothing
requires that the first digit of the address be '0'.
This CL change the expectation to check only for a value starting with 0x.
llvm-svn: 232163
Android have more file descriptor opened by the shell what are inherited
to the process (different ones on device and on emulator).
Differential revision: http://reviews.llvm.org/D8299
llvm-svn: 232150
TestLldbGdbServer was failing because it always assumed AVX is available on
x86_64 Linux. This patch checks the target before asserting that AVX
registers are available.
llvm-svn: 232137
It was failing on gcc 4.8, only passing accidentally on clang 3.5
This patch improves the checking to make sure if fails in all cases
and then XFAILS
llvm-svn: 232092
Linux lldb-server Handle_m doesn't properly replace software breakpoints
with the original instructions. This test is added with expectedFailureLinux
Differential Revision: http://reviews.llvm.org/D8191
llvm-svn: 232091
The issue was the previous code tried to stop on the following code in main.c:
21 // Stop here and set values
22 printf ("Val - %d Mine - %d, %d, %llu. Ptr - %d, %d, %llu\n",
23 val,
24 mine.first_val, mine.second_val, mine.third_val,
25 ptr->first_val, ptr->second_val, ptr->third_val);
We we set a source regex breakpoint on "// Stop here and set values" we would set a breakpoint on line 22 as expected.
The problem is the most recent clang compiler generates a line table like this
0x1000: main.c:23 // Loading of "val" into a register
0x1010: main.c:24 // Load mine.first_val, mine.second_val, mine.third_val values into registers or on the stack
0x1020: main.c:25 // Load ptr->first_val, ptr->second_val, ptr->third_val values into registers or on the stack
0x1030: main.c:22 // Call to printf
In this test, we run to line 22, then we use python to modify the value of "val" and then continue to another breakpoint and try to read the STDOUT from the printf to verify the values changed correctly.
With the above line table the value for "val" had already been loaded into a register so the string from printf would be incorrect.
Doing an easy fix for now by changing the code to:
21 // Stop here and set values
22 printf ("Val - %d Mine - %d, %d, %llu. Ptr - %d, %d, %llu\n", val,
23 mine.first_val, mine.second_val, mine.third_val,
24 ptr->first_val, ptr->second_val, ptr->third_val);
Now we get a line table entry for line 22 that is before any locals are read from the stack into registers.
I need to follow up with the compiler guys and see if we can get a fix for this as anyone setting file + line breeakpoints might be very surprised to have code from lines below the current line already have had their code run.
llvm-svn: 232068
If a test have very long name and the compiler specified with (a long)
full path then the name of the log file name can exceed 255 characters.
This change replace the full compiler path with just the compiler name
if the prior would cause a too long file name.
Differential revision: http://reviews.llvm.org/D8252
llvm-svn: 232024
Summary:
There was a race condition regarding the output of the inferior process. The reading of the
output is performed on a separate thread, and there was no guarantee that the output will get
eventually consumed. Because of that, it was happening that calling Process::GetSTDOUT was not
returning anything even though the process was terminated and would definitely not produce any
further output. This was usually happening only under very heavy system load, but it can be
reproduced by placing an usleep in the stdio thread (Process::STDIOReadThreadBytesReceived).
This patch addresses this by adding synchronization capabilities to the Communication thread.
After calling Communication::SynchronizeWithReadThread one can be sure that all pending input has
been processed by the read thread. This function is then called after every public event which
stops the process to obtain the entire process output.
Test Plan: TestProcessIO.py should now succeed every time instead of flaking in and out.
Reviewers: clayborg, jingham
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D8246
llvm-svn: 232023
Summary:
This patch allows not specify search path in each lldb-mi test. It makes tests easier.
This fix was requested by vharron.
All test pass on OS X.
Reviewers: vharron, clayborg
Subscribers: lldb-commits, vharron
Differential Revision: http://reviews.llvm.org/D8207
llvm-svn: 232019
Previously these test cases execute lldb-server on the host and run the
tests against it even if a remote platform was specified. With this CL
these tests always test the communication with an lldb-server instance
running on the target.
Differential revision: http://reviews.llvm.org/D8202
llvm-svn: 231922
Summary: This patch adds a few comments for GetValueDidChange and contains improvements for TestValueVarUpdate.py test which checks ValueObject::GetValueDidChange for complex types.
Reviewers: zturner, granata.enrico, clayborg
Reviewed By: clayborg
Subscribers: jingham, lldb-commits, granata.enrico, zturner, clayborg
Differential Revision: http://reviews.llvm.org/D8103
llvm-svn: 231526
Summary:
This patch includes:
* Fix -var-create command for global/static variables
* Fix -var-update command: remove m_strValueName/m_eVarInfoFormat/m_bValueChanged{Array,Composite,Normal}Type; clean CMICmdCmdVarUpdate::Execute and CMICmdCmdVarUpdate::Acknowledge; improve CMICmdCmdVarUpdate::MIFormResponse; Complete the value after -var-create using the CMICmdCmdVarCreate::CompleteSBValue to get SBValue::GetValueDidChange work.
* Add non-constant version of CMICmnLLDBDebugSessionInfoVarObj::GetValue
* Add MiVarTestCase.test_lldbmi_var_update test
All tests pass on OS X.
Reviewers: abidh, emaste, clayborg
Reviewed By: clayborg
Subscribers: lldb-commits, emaste, clayborg, abidh
Differential Revision: http://reviews.llvm.org/D8110
llvm-svn: 231525
- use a hardcoded formatter to match all vector types, and make it so that their element type is taken into account when doing default formatting
- special case a vector of char to display byte values instead of characters by default
Fixes the test failures Ilia was seeing
llvm-svn: 231504
Summary:
I'm not sure that this failure should be fixed by modifying this test.
It seems strange for me that the only one type vUInt8 is printed with '0x' prefix.
This patch fixes the following error:
```
======================================================================
FAIL: test_with_dsym_and_run_command (Test-rdar-10642615.Radar10642615DataFormatterTestCase)
Test data formatter commands.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 456, in wrapper
return func(self, *args, **kwargs)
File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py", line 21, in test_with_dsym_and_run_command
self.data_formatter_commands()
File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py", line 68, in data_formatter_commands
'(vBool32) valueBool32 = (0, 1, 0, 1)'])
File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 2100, in expect
msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : '(vUInt8) valueU8 = ('\x01', '\0', '\x04', '\0', '\0', '\x01', '\0', '\x04', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0')' returns expected result
Config=x86_64-clang
======================================================================
FAIL: test_with_dwarf_and_run_command (Test-rdar-10642615.Radar10642615DataFormatterTestCase)
Test data formatter commands.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 473, in wrapper
return func(self, *args, **kwargs)
File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py", line 28, in test_with_dwarf_and_run_command
self.data_formatter_commands()
File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py", line 68, in data_formatter_commands
'(vBool32) valueBool32 = (0, 1, 0, 1)'])
File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 2100, in expect
msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : '(vUInt8) valueU8 = ('\x01', '\0', '\x04', '\0', '\0', '\x01', '\0', '\x04', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0')' returns expected result
Config=x86_64-clang
----------------------------------------------------------------------
```
Reviewers: granata.enrico, zturner, clayborg
Subscribers: clayborg, lldb-commits, zturner, granata.enrico
Differential Revision: http://reviews.llvm.org/D8102
llvm-svn: 231490
Unlike GDB, we tackle the problem of representing vector types in different styles by having a synthetic child provider that recognizes the format you're trying to apply to the variable, and coming up with the right type and number of child values to match that format
This makes for a more compact representation and less visual noise
Fixes rdar://5429347
llvm-svn: 231449
Summary:
The inferior can load the library now, but the remote test is still failing
because of a module loading problem in LLDB.
Reviewers: ovyalov, sivachandra, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D8038
llvm-svn: 231120
Summary: Needed to transfer stdout.txt to host before reading.
Reviewers: ovyalov, clayborg
Subscribers: tberghammer, lldb-commits
Differential Revision: http://reviews.llvm.org/D8023
llvm-svn: 231101
Summary:
Fix and enable some lldb-mi tests on Linux:
Fixed:
# MiExecInterpreterTestCase.test_lldbmi_thread_step_in
# MiExecTestCase.test_lldbmi_exec_step
# MiStackTestCase.test_lldbmi_stack_info_frame tests.
Also I enabled the following tests on Linux:
# MiExecTestCase.test_lldbmi_exec_step_instruction
# MiSignalTestCase.test_lldbmi_stopped_when_interrupted
All test pass on OS X and Linux.
Reviewers: abidh, vharron, clayborg
Reviewed By: clayborg
Subscribers: vharron, lldb-commits, clayborg, abidh
Differential Revision: http://reviews.llvm.org/D7987
llvm-svn: 231072
Summary:
# Allow to pass an executable file via lldb-mi arguments
# Add tests
# Fix (gdb) prompt in CMIDriver::LocalDebugSessionStartupExecuteCommands
# Fix prompt in CMIDriver::InterpretCommandThisDriver: use the lldb-mi prompt instead of a hard-coded value.
All tests pass on OS X.
Reviewers: abidh, clayborg
Reviewed By: clayborg
Subscribers: lldb-commits, clayborg, abidh
Differential Revision: http://reviews.llvm.org/D8001
llvm-svn: 231070
Summary:
Using std::thread/random instead of pthread/rand.
Two of them also suffered from the synchronization problem in D7916.
Reviewers: clayborg, zturner, ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D7991
llvm-svn: 230993
Windows doesn't define getcwd(), so this test executable failed
to compile.
Patch by Adrian McCarthy
Differential Revision: http://reviews.llvm.org/D7962
llvm-svn: 230983
Summary:
Presently Args::SetCommandString allows quotes to be escaped with backslash. However, the
backslash itself is not removed from the argument, nor there is a way to escape the backslash
itself. This leads to surprising results:
"a b" c" -> 'a b', 'c' # Here we actually have an unterminated quote, but that is ignored
"a b\" c" -> 'a b\" c' # We try to escape the quote. That works but the backslash is not removed.
"a b\\" c" -> 'a b\\" c' # Escaping the backslash has no effect.
This change changes quote handling to be more shell-like:
- single quotes and backquotes are literal and there is no way to escape the closing quote or
anything else inside;
- inside double quotes you can use backslash to escape the closing quote and another backslash
- outside any quotes, you can use backslash to escape quotes, spaces and itself.
This makes the parsing more consistent with what the user is familiar and increases the
probability that pasting the command line from shell to the "process launch" command "just work".
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D7855
llvm-svn: 230955
Instead of lldb calling the ptrace APIs directly, it launches an llgs
instance and communicates with it via the remote debug protocol.
This has two advantages.
There is more code shared between the remote debugging code path
and the local debugging code path. If a feature works in remote, it
probably works locally and vice-versa.
It makes us more architecturally similar to OSX (which also does
local debugging via a connection to debugserver).
This path is called LLGS local. We think that this configuration is
now at parity with (or better than) local linux debugging.
It is currently invoked if you have an environment variable defined
"PLATFORM_LINUX_FORCE_LLGS_LOCAL"
We would like to switch to LLGS local as the default path and only
use the non-LLGS path if someone has an environment variable defined
"PLATFORM_LINUX_DISABLE_LLGS_LOCAL"
Later, if all goes well, we would like to remove non-LLGS local
debugging support to simplify the codebase and avoid confusion.
llvm-svn: 230919
clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD targets.
Other targets do not, which causes several tests to fail. This flag
enables FullDebugInfo for all targets.
Fixes the following tests:
TestCallStdStringFunction.py
TestDataFormatterSkipSummary.py
TestDataFormatterStdIterator.py
TestDataFormatterStdList.py
TestDataFormatterStdString.py
TestSBValuePersist.py
TestStringPrinter.py
TestTypeCompletion.py
llvm-svn: 230831
Summary:
This ability was added by @jasonmolenda in [[ http://reviews.llvm.org/rL225748 | r225748 ]] but it was commented out because he hadn't test it.
I tested it on OS X and now we can enable it legally.
This change is made by @chying request.
Reviewers: jasonmolenda, chying, clayborg
Reviewed By: clayborg
Subscribers: lldb-commits, chying, jasonmolenda, clayborg
Differential Revision: http://reviews.llvm.org/D7930
llvm-svn: 230782