Commit Graph

11085 Commits

Author SHA1 Message Date
Robert Flack 3a6a2e58d5 Append to CFLAGS_EXTRAS and LD_EXTRAS when building cmdline.
When building the command-line for compilations during tests, append to
CFLAGS_EXTRAS and LD_EXTRAS to preserve switches set by the environment
(i.e. for cross compiling to test on another platform).

Test Plan:
TestCPP11EnumTypes.py passes testing from macosx -> linux remotely with cross
compiling args in CFLAGS_EXTRAS and LD_EXTRAS.

Differential Revision: http://reviews.llvm.org/D8942

llvm-svn: 235083
2015-04-16 09:18:12 +00:00
Oleksiy Vyalov 7d9d941b9b Pass normalized target file paths via GDB-remote to a target and denormalize them on the target.
http://reviews.llvm.org/D8980

llvm-svn: 235077
2015-04-16 07:02:56 +00:00
Greg Clayton 2c93b80f78 Make -arch work on MacOSX.
llvm-svn: 235065
2015-04-16 01:18:05 +00:00
Adrian McCarthy b4b8bb72cb Fix OS default in Makefile.rules for Windows. http://reviews.llvm.org/D9043
llvm-svn: 235056
2015-04-15 23:38:23 +00:00
Siva Chandra 9e7a8172a3 [TestRvalueReferences] Fix an expectation.
Summary:
If 'i' is an rvalue reference to an 'int', evaluating it with the
'expression' command will return an 'int' value and not an 'int &&'.
Before this patch, an 'int &&' type was expected.

Enabled the test for clang and gcc as all parts of the test now pass
when the testcase is compiled with them.

Test Plan: dotest.py -C <gcc|clang> -p TestRvalueReferences

Reviewers: spyffe, chaoren

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9005

llvm-svn: 235036
2015-04-15 18:35:29 +00:00
Siva Chandra f5941b8d08 [TestMiBreak] Print a formatted string via printf in the test case.
Summary:
If the string is not formatted, these can happen when compiled with GCC:
1. If it is a null string "", then GCC completely removes the call to
printf even with -O0.
2. If the string is a single character string, say "\n" for example,
then GCC replaces the call to printf with a call to putchar.
3. If the string length is greater than 1, but is not formatted, then
GCC replaces the call to printf with a call to puts.

All the above will fail the test as we want a breakpoint on "printf" to
hit.

Test Plan: dotest.py -C gcc -p TestMiBreak

Reviewers: chying, ki.stfu

Reviewed By: ki.stfu

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9025

llvm-svn: 235034
2015-04-15 18:32:17 +00:00
Ilia K 7e38b5802a Add comments to LLDB-MI disassembly.
Summary:
This patch adds the comments which are included in LLDB disassembly, but are currently missing in MI, e.g.

 ^done,asm_insns=[...,{address="0x00000000004004ff",func-name="main",offset="18",size="2",inst="jmp 0x40050b ; <+30> at main.c:7"}]

 instead of

 ^done,asm_insns=[...,{address="0x00000000004004ff",func-name="main",offset="18",size="2",inst="jmp 0x40050b"}]

Thanks, Ewan

Patch from ewan@codeplay.com

Reviewers: abidh, EwanCrawford

Subscribers: ted, lldb-commits, deepak2427

Differential Revision: http://reviews.llvm.org/D8964

llvm-svn: 235017
2015-04-15 16:17:50 +00:00
Ilia K 42eae2f010 Improve MiBreakTestCase tests to expect =breakpoint-modified event after r234483
llvm-svn: 235016
2015-04-15 16:10:53 +00:00
Oleksiy Vyalov 280d8dc9f0 Add Modulecache::GetAndPut method which wraps sequence of Get and Put (if module wasn't found in cache) calls.
http://reviews.llvm.org/D9013

llvm-svn: 235011
2015-04-15 14:35:10 +00:00
Ilia K 3c886e6efc Fix the ConvenienceVariablesCase tests after r234993
llvm-svn: 235010
2015-04-15 14:11:52 +00:00
Ilia K 725abcb889 Bug 23051 - Fix zombie processes after lldb-server tests
Summary:
This patch fixes the following bug: https://llvm.org/bugs/show_bug.cgi?id=23181
For some reason some lldb-server tests should be kicked using SIGHUP and SIGINT before termination, otherwise it will leave a zombie process.
I think the reason is that the lldb-server will terminate a slave process if it gets the SIGHUP/SIGINT and if so it should be fixed in lldb-server.

The solution is to terminate process like it does the pexpect (including the delayafterterminate interval).

Also this patch reverts the following commits:
* r234549 - Skip lldb-server tests according to bug 23181
* r234765 - Skip a few tests on OS X according to the bug 23181
* r234803 - Skip the TestGdbRemoteRegisterState.test_grp_register_save_restore_works_no_suffix_debugserver_dsym test on OS X according to the bug 23181

Test Plan:
```
$ ps | grep Z | grep a.out | wc -l
447
$ ./dosep.py --options "-v --executable $INSTALLDIR/bin/lldb"
[...]
$ ps | grep Z | grep a.out | wc -l
447
```

Reviewers: jasonmolenda, clayborg, tberghammer

Reviewed By: clayborg

Subscribers: lldb-commits, dawn, tberghammer, clayborg, jasonmolenda

Differential Revision: http://reviews.llvm.org/D9019

llvm-svn: 235008
2015-04-15 13:35:49 +00:00
Ilia K 7c1d91d816 Add teardown hook to shutdown an inferior process
Summary: Add teardown hook to shutdown an inferior process

Reviewers: jasonmolenda, clayborg, tberghammer

Reviewed By: clayborg, tberghammer

Subscribers: lldb-commits, tberghammer, clayborg, jasonmolenda

Differential Revision: http://reviews.llvm.org/D9018

llvm-svn: 235005
2015-04-15 13:08:35 +00:00
Pavel Labath bacc5fb4b6 Skip TestMiVar test case to get build green
bug report at <https://llvm.org/bugs/show_bug.cgi?id=23239>.

llvm-svn: 235002
2015-04-15 12:39:18 +00:00
Vince Harron 43d79053d7 Fixed remote failures in TestCPP11EnumTypes, probably others
Typically, LLGS only sends stdout/stderr notifications when the inferior
process is running.

Because LLGS reads stdout from the process in a separate thread, sometimes
these stdout notifications can be received after the server has sent a thread
stop message. The host isn't expecting stdout to be generated by the target
after a stop message and these messages interfere with the host's request/
response paradigm.

Differential Revision: http://reviews.llvm.org/D9024

llvm-svn: 234995
2015-04-15 10:40:51 +00:00
Vince Harron 0f2b1aba15 Skip reverse connect test when running remotely
This use case is not supported and may be removed in the future if not
needed

llvm-svn: 234994
2015-04-15 10:39:17 +00:00
Vince Harron e0d8dbe55f TestConvenienceVariables - fixed a Linux problem
Test was waiting for wrong string on Linux.
It is still marked as XFAIL because of an intermittent failure.

Differential Revision: http://reviews.llvm.org/D8679

llvm-svn: 234993
2015-04-15 10:36:39 +00:00
Vince Harron 7343ab44ee Exception registers aren't supported outside of Darwin
Updated test to match

Differential Revision: http://reviews.llvm.org/D8812

llvm-svn: 234992
2015-04-15 10:31:42 +00:00
Tamas Berghammer d8c338d42f Add single stepping logic for linux arm
Linux arm don't support hardware stepping (neither mismatch
breakpoints). This patch implement signle stepping with doing a software
emulation of the next instruction and then setting a temporary
breakpoint at the address where the thread will stop next.

Differential revision: http://reviews.llvm.org/D8976

llvm-svn: 234987
2015-04-15 09:47:02 +00:00
Tamas Berghammer 63c8be9571 Fix breakpoint trap opcode detection for arm linux
llvm-svn: 234986
2015-04-15 09:38:48 +00:00
Tamas Berghammer 23fc4b00a9 Fix test makefile after r234949.
On non OSX architectures we don't need a space between the arch flag
(-m) and the value.

llvm-svn: 234985
2015-04-15 09:28:31 +00:00
Greg Clayton 50bd5a2dc6 Change SymbolVendor::GetCompileUnitAtIndex() and SymbolVendor::Dump() to make sure they are thread safe.
<rdar://problem/20263111>

llvm-svn: 234951
2015-04-14 22:34:00 +00:00
Greg Clayton 931b107364 MacOSX needs a space between $(ARCHFLAG) and $(ARCH) otherwise we try to call clang with "-archx86_64" which doesn't work.
llvm-svn: 234949
2015-04-14 22:08:17 +00:00
Jason Molenda d2e46b19cb Remove unneeded include.
llvm-svn: 234945
2015-04-14 21:34:51 +00:00
Greg Clayton bef47e497f Fix printf warnings about a size mismatch on MacOSX.
llvm-svn: 234941
2015-04-14 20:58:08 +00:00
Greg Clayton 21667b64bc Remove unused functions that were causing warnings.
llvm-svn: 234940
2015-04-14 20:57:13 +00:00
Sean Callanan 26760a80fc Added some documentation for ForEachMacro.
llvm-svn: 234923
2015-04-14 18:50:05 +00:00
Sean Callanan b8bf6efa6e Added support to ClangUserExpression for importing
all the macros from the modules the user has loaded.
These macros are currently imported textually into
the expression's source code, which turns out not to
impose the horrific string processing overhead that
I thought it would, but I still plan to look into
performance improvements.

Also modified TestCModules to test that this works.

llvm-svn: 234922
2015-04-14 18:36:17 +00:00
Sean Callanan 507b588a34 Updated IRForTarget to change the way we generate
relocations.  We used to do GEP on a pointer to
the result type, which is wrong.  We should be doing
GEP on a pointer to char, which allows us to offset
correctly.

This fixes the C modules testcase, so it's no longer
ExpectFail.

llvm-svn: 234918
2015-04-14 18:17:35 +00:00
Ilia K bc929b80dc Fix handling of the executable arg which contains spaces (MI)
* Don't use the CMICmdArgValFile::GetFileNamePath for the CMIDriver::m_strCmdLineArgExecuteableFileNamePath
  because it wraps path with spaces into quotes what is already being done in CMIDriver::LocalDebugSessionStartupExecuteCommands
* Improve the MiSyntaxTestCase.test_lldbmi_specialchars test to catch this error
  ```
    $ bin/lldb-mi "~/p/ hello"
    (gdb)
    -file-exec-and-symbols "\"~/p/ hello\""
    ^error,msg="Command 'file-exec-and-symbols'. Target binary '\"~/p/ hello\"' is invalid. error: unable to find executable for '/"~/p/ hello/"'"
  ```

llvm-svn: 234888
2015-04-14 14:12:22 +00:00
Ilia K 5867a70057 Simplify some lldb-mi tests by using the Base.addTearDownHook()
llvm-svn: 234885
2015-04-14 13:48:49 +00:00
Oleksiy Vyalov f74503c5a6 Fix XCode build after r234870.
llvm-svn: 234877
2015-04-14 10:20:43 +00:00
Colin Riley ef20b08ff3 Additions to RenderScriptRuntime in prep for detection of RenderScript modules and moving of the command interpreter manipulation to after construction.
Differential Revision: http://reviews.llvm.org/D9001

llvm-svn: 234871
2015-04-14 07:39:24 +00:00
Omair Javaid 3f57216ca4 Adds Register Context Linux/POSIX for ARM Architecture
This patch is major step towards supporting lldb on ARM.
This adds all the required bits to support register manipulation on Linux Arm.
Also adds utility enumerations, definitions and register context classes for arm.

llvm-svn: 234870
2015-04-14 07:30:20 +00:00
Chaoren Lin 9cb8988b91 Remove gcc xfail for TestTargetWatchAddress.
llvm-svn: 234828
2015-04-14 00:51:57 +00:00
Chaoren Lin 239189ee6c Remove gcc xfail for TestWatchpointMultipleThreads.
llvm-svn: 234826
2015-04-14 00:40:41 +00:00
Siva Chandra ed62034df8 [TestPluginCommands] Add skipIfGcc at the right place.
Summary:
The decorator @expectedFailureGcc was at the wrong place skipping this
test all together. This patch removes it and adds skipIfGcc at the right
place.

Test Plan: dotest.py -C <gcc|clang> -p TestPluginCommands

Reviewers: chying, chaoren

Reviewed By: chaoren

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9010

llvm-svn: 234821
2015-04-14 00:13:28 +00:00
Ilia K 653457831b Skip the TestGdbRemoteRegisterState.test_grp_register_save_restore_works_no_suffix_debugserver_dsym test on OS X according to the bug 23181
llvm-svn: 234803
2015-04-13 22:07:13 +00:00
Adrian McCarthy 54700b05c7 Skip libc++ data formmatting tests on Windows. libc++ hasn't been ported to windows yet.
llvm-svn: 234794
2015-04-13 20:33:05 +00:00
Greg Clayton 6292b30bab Be sure to complete base classes when importing them.
llvm-svn: 234771
2015-04-13 18:32:54 +00:00
Chaoren Lin f4a92bda49 Missing `-lpthread` causes gcc test failure.
Summary:
`-lpthread` was removed for `g++ -std=c++11` on Linux due to llvm.org/pr21553,
but the original issue doesn't seem to be reproducible anymore. Even if it were,
it had nothing to do with compiling inferiors.

Reviewers: sbest, sivachandra, chying

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8991

llvm-svn: 234770
2015-04-13 18:21:31 +00:00
Ilia K 038363370f Skip a few tests on OS X according to the bug 23181
llvm-svn: 234765
2015-04-13 17:21:58 +00:00
Ilia K 2ecf23bc5d Fix CMICmnStreamStdout::WritePriv which causes a stack overflow (MI)
This includes:
* Remove IDS_STDOUT_ERR_NOT_ALL_DATA_WRITTEN enum value
* Remove IDS_STDOUT_ERR_NOT_ALL_DATA_WRITTEN mapped string in CMICmnResources::ms_pResourceId2TextData
* Fix a stack overflow which happens when fputs() fails:
  ```
    [...]
    frame #21153: 0x00000001045db6f0 lldb-mi`CMICmnStreamStderr::WritePriv(CMIUtilString const&, CMIUtilString const&, bool) + 416
    frame #21154: 0x00000001045db529 lldb-mi`CMICmnStreamStderr::Write(CMIUtilString const&, bool) + 265
    frame #21155: 0x00000001045c6a27 lldb-mi`CMICmnBase::SetErrorDescription(CMIUtilString const&) const + 215
    frame #21156: 0x00000001045db6f0 lldb-mi`CMICmnStreamStderr::WritePriv(CMIUtilString const&, CMIUtilString const&, bool) + 416
    frame #21157: 0x00000001045db529 lldb-mi`CMICmnStreamStderr::Write(CMIUtilString const&, bool) + 265
    frame #21158: 0x00000001045c6a27 lldb-mi`CMICmnBase::SetErrorDescription(CMIUtilString const&) const + 215
    frame #21159: 0x00000001045db6f0 lldb-mi`CMICmnStreamStderr::WritePriv(CMIUtilString const&, CMIUtilString const&, bool) + 416
    frame #21160: 0x00000001045db529 lldb-mi`CMICmnStreamStderr::Write(CMIUtilString const&, bool) + 265
    frame #21161: 0x00000001045c6a27 lldb-mi`CMICmnBase::SetErrorDescription(CMIUtilString const&) const + 215
    frame #21162: 0x00000001045db6f0 lldb-mi`CMICmnStreamStderr::WritePriv(CMIUtilString const&, CMIUtilString const&, bool) + 416
    frame #21163: 0x00000001045db529 lldb-mi`CMICmnStreamStderr::Write(CMIUtilString const&, bool) + 265
    frame #21164: 0x00000001045c6a27 lldb-mi`CMICmnBase::SetErrorDescription(CMIUtilString const&) const + 215
    frame #21165: 0x00000001045dc540 lldb-mi`CMICmnStreamStdout::WritePriv(CMIUtilString const&, CMIUtilString const&, bool) + 416
    frame #21166: 0x00000001045de5fb lldb-mi`CMIDriver::DoMainLoop() + 939
    frame #21167: 0x00000001045e2334 lldb-mi`CMIDriverMgr::DriverMainLoop() + 36
    frame #21168: 0x00000001045e1a39 lldb-mi`main + 217
    frame #21169: 0x00007fff90f395c9 libdyld.dylib`start + 1
  ```

llvm-svn: 234751
2015-04-13 14:40:16 +00:00
Colin Riley 189598ed4c fixing msvc build (format string z is not supported)
llvm-svn: 234708
2015-04-12 22:05:58 +00:00
Zachary Turner dd50f7421c Making linking against Python simpler on Windows.
This patch deprecates the three Python CMake variables in favor of
a single variable PYTHON_HOME which points to the root of a python
installation.  Since building Python doesn't output the files in
a structure that is compatible with the PYTHONHOME environment
variable, we also provide a script install_custom_python.py which
will copy the output of a custom python build to the correct
directory structure.

The supported workflow after this patch will be to build python
once for each configuration and architecture {Debug,Release} x {x86,x64}
and then run the script.  Then run CMake specifying -DPYTHON_HOME=<path>

The first time you do this will probably require you to delete your
CMake cache.

The old workflow is still supported during a transitionary period,
but a warning is printed at CMake time, and this will eventually
be removed.

Differential Revision: http://reviews.llvm.org/D8979

llvm-svn: 234660
2015-04-10 22:58:56 +00:00
Greg Clayton eb72dc7d7d Allow the variable view to get synthetic values if they are available in "gui" mode.
llvm-svn: 234642
2015-04-10 21:34:10 +00:00
Greg Clayton bd5ae6b4de Cleanup virtual methods and mark them as "override" and remove "virtual".
Also fixed an issue with the GUI mode where tree items wouldn't be notified that they were selected. Now selecting a thread or stack frame in the Threads view will update all windows (source, variables, registers).

llvm-svn: 234640
2015-04-10 21:21:09 +00:00
Siva Chandra 18d1696d62 [TestFormatters, TestDataFormatterSynthVal] Mark as xfail.
Summary:
This is to get the bots to go green while a robust solution to fix these
tests is worked out.

Reviewers: chaoren, tberghammer, clayborg

Reviewed By: tberghammer, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8947

llvm-svn: 234625
2015-04-10 19:25:50 +00:00
Siva Chandra d7a2fc830f [TestAnonymous] Enable all tests for GCC
Summary:
Also added "_with_dsym" prefix to the dsym tests, and "_with_dwarf" to the dwarf tests.


Test Plan: dotest.py -C gcc -p TestAnonymous

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8944

llvm-svn: 234624
2015-04-10 19:24:48 +00:00
Oleksiy Vyalov cc81556831 Use llvm::sys::fs::create_directories to create new directory on Windows.
http://reviews.llvm.org/D8977

llvm-svn: 234610
2015-04-10 17:02:26 +00:00
Greg Clayton a625f7bcf4 Check in missing file.
llvm-svn: 234609
2015-04-10 16:48:37 +00:00