Commit Graph

11474 Commits

Author SHA1 Message Date
Tamas Berghammer 3c1d572799 Fix thumb condition extraction in ARM instrcution emulator
llvm-svn: 236988
2015-05-11 12:50:56 +00:00
Tamas Berghammer 428447f625 Skip and XFAIL TestThreadStepOut as it times out on the Linux build bot
llvm-svn: 236986
2015-05-11 12:42:56 +00:00
Tamas Berghammer 88504598c3 Skip and XFAIL test occasionally timing out on the Linux build bot
llvm-svn: 236984
2015-05-11 10:32:16 +00:00
Pavel Labath 8c8ff7af28 [NativeProcessLinux] Remove double thread state accounting
Summary:
Now that all thread events are processed synchronously, there is no need to have separate records
of whether a thread is running. This changes the (ever-dwindling) remains of the TSC to use
NativeThreadLinux as the authoritative source of the state of threads. The rest of the
ThreadContext we need has been moved to a member of NTL.

Test Plan: ninja check-lldb continues to pass

Reviewers: chaoren, ovyalov

Subscribers: lldb-commits

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

llvm-svn: 236983
2015-05-11 10:03:10 +00:00
Vince Harron 6d3d0f11ea Fixed lldb-mi test failures introduced by r236956
Move enable/disableLogForCurrentTest from lldbtest.TestBase to
lldbtest.Base so they're accessible to Mi tests

llvm-svn: 236963
2015-05-10 22:01:59 +00:00
Vince Harron f1ff3c146d Remove unsupported lldb-server parameters from test
llvm-svn: 236958
2015-05-10 18:02:53 +00:00
Vince Harron d5fa102d44 We can't use sys.path[0] to determine the script directory because it doesn't work under a debugger
Test Plan: run tests with/without python debugger
Tested on OSX & Linux with PyCharm

Reviewers: chying, clayborg

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

llvm-svn: 236957
2015-05-10 15:24:12 +00:00
Vince Harron 9753dd98b3 Add support for ./dotest.py --channel and --log-success
Summary:
New dotest options that allow arbitrary log channels and
categories to be enabled.  Also enables logging for locally run
debug servers.
    
Log messages are separated into separate files per test case.
(this makes it possible to log in dosep runs)
    
These new log files are stored side-by-side with trace files in the
session directory.
    
These files are deleted by default if the test run is successful.
    
If --log-success is specified, even successful logs are retained.
    
--log-success is useful for creating reference log files.
    
Test Plan:
add '--channel "lldb all" --channel "gdb-remote packets" --log-success'
to your dotest options

Tested on OSX and Linux
    
Differential Revision: http://reviews.llvm.org/D9594

llvm-svn: 236956
2015-05-10 15:22:09 +00:00
Vince Harron 4cc8d202d0 Fixed minor compile warnings
llvm-svn: 236945
2015-05-10 08:33:58 +00:00
Robert Flack 96ad3de54b Convert mmap options for target in InferiorCallMmap.
Converts the MAP_PRIVATE and MAP_ANON options to the target platform constants
(on which the call runs) rather than using those of the compiled host.

Test Plan:
Run test suite, the following tests requiring memory allocation / JIT support
begin passing when running mac -> linux:
Test11588.py
TestAnonymous.py
TestBreakpointConditions.py
TestCPPStaticMethods.py
TestCStrings.py
TestCallStdStringFunction.py
TestDataFormatterCpp.py
TestDataFormatterStdList.py
TestExprDoesntBlock.py
TestExprHelpExamples.py
TestFunctionTypes.py
TestPrintfAfterUp.py
TestSBValuePersist.py
TestSetValues.py

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

llvm-svn: 236933
2015-05-09 15:53:31 +00:00
Chaoren Lin f34f410e0a Set path syntax for remote executable FileSpec.
Reviewers: ovyalov, zturner

Subscribers: lldb-commits

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

llvm-svn: 236925
2015-05-09 01:21:32 +00:00
Ed Maste f5132e70cc Skip tests that are timing out on the FreeBSD buildbot
XFAILing these does not work because the timeout is caught by the
top-level test infrastucture instead.

Some might be llvm.org/pr22784

llvm-svn: 236924
2015-05-09 01:01:36 +00:00
Oleksiy Vyalov a9ea07113c Use hard links to link sysroot files within ModuleCache.
http://reviews.llvm.org/D9587

llvm-svn: 236917
2015-05-08 23:54:34 +00:00
Vince Harron a6ad6d3cc9 TestCModules was effectively skipped on Linux
Summary: I've removed the secret skip and added expectedFailureLinux
    
Test Plan: run tests
    
Reviewers: flackr
    
Subscribers: lldb-commits
    
Differential Revision: http://reviews.llvm.org/D9615

llvm-svn: 236914
2015-05-08 23:17:46 +00:00
Siva Chandra 2d7832e44b Bump the default timeout in dosep.py to 10m.
Summary:
This seems to be sufficient to get the tests taking longer than the
previous timeout of 5m to run to completion on Android to pass instead
of timing out.

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 236913
2015-05-08 23:08:53 +00:00
Siva Chandra 09c4424994 [TestCreateAfterAttach] Add @skipIfRemote to the forking test.
Test Plan: dotest.py -p TestCreateAfterAttach

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: lldb-commits

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

llvm-svn: 236903
2015-05-08 21:12:41 +00:00
Ed Maste 82d9f037fe Skip tests that are timing out on the FreeBSD buildbot
XFAILing these does not work because the timeout is caught by the
top-level test infrastucture instead.

Might be llvm.org/pr22784

llvm-svn: 236895
2015-05-08 19:51:44 +00:00
Zachary Turner a49c59145b Enable thread-safe logging.
Thread-safe logging had been disabled because of a deadlock,
possibly due to a lock acquired during a signal handler.

This patch turns thread safe logging back on and also greatly
reduces the scope of the lock, confining it only to the code that
affects the underlying output stream, instead of all the code that
builds up the formatted log message.  this should resolve the
issue surrounding the deadlock.

llvm-svn: 236892
2015-05-08 18:50:54 +00:00
Tamas Berghammer d916dbb726 Remove check for object file type from DynamicLoaderPOSIXDYLD::DidAttach
For PIE executables the type of the main executable is shared object
so we can't force that the main executable should have the type of
executable.

llvm-svn: 236870
2015-05-08 15:45:53 +00:00
Ed Maste e5f9bf0da0 Add expectedFailureFreeBSD decorator for buildbot pexpect issue
I'm not yet sure what's wrong with pexpect and I cannot reproduce this
problem locally. XFAIL these tests for now to reduce buildbot noise so
I can track down the remaining buildbot failures.

llvm.org/pr22784

llvm-svn: 236857
2015-05-08 14:20:25 +00:00
Ed Maste 0cb96aaf2b Enable TestCallStopAndContinue on FreeBSD
It's reported to pass consistently on Linux now, and it passed for me
in local testing on FreeBSD. Remove the expectedFailureFreeBSD decorator
for now.

llvm.org/pr20274

llvm-svn: 236853
2015-05-08 13:52:22 +00:00
Tamas Berghammer f3a243297b Use /data/local/tmp as temp directory on android
If no temp directory specified by the user on android then fall back
to /data/local/tmp what is always present on the device. It removes
the dependency of specifying TMPDIR for executing platform commands
on android.

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

llvm-svn: 236843
2015-05-08 12:46:26 +00:00
Ilia K fc6d66143f Improve MiBreakTestCase.test_lldbmi_break_insert_{function*,file_line*} tests (MI)
llvm-svn: 236840
2015-05-08 12:35:49 +00:00
Ilia K fd0325b81e Fix =breakpoint-created event after creation of BP (MI)
For example:
was:
```
$ bin/lldb-mi ~/p/hello
[...]
-break-insert main
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000e2d",func="main",file="hello.cpp",fullname="/Users/IliaK/p/hello.cpp",line="14",times="0",original-location="main"}
(gdb)
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000e2d",func="main",file="hello.cpp",fullname="/Users/IliaK/p/hello.cpp",line="14",times="0",original-location="main"}
```

now:
```
$ bin/lldb-mi ~/p/hello
[...]
-break-insert main
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000e2d",func="main",file="hello.cpp",fullname="/Users/IliaK/p/hello.cpp",line="14",times="0",original-location="main"}
(gdb)
=breakpoint-created,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000e2d",func="main",file="hello.cpp",fullname="/Users/IliaK/p/hello.cpp",line="14",times="0",original-location="main"}
```

llvm-svn: 236837
2015-05-08 12:18:11 +00:00
Colin Riley 5de4251474 Fix build on windows.
llvm-svn: 236836
2015-05-08 12:17:27 +00:00
Ilia K 3e6f515531 Remove duplicated code in CMICmdCmdBreakInsert::Acknowledge (MI)
llvm-svn: 236834
2015-05-08 12:11:13 +00:00
Ilia K e077ef7a69 Fix -break-insert without -f to cause an error if BP not resolved (MI)
For example:
was:
```
$ bin/lldb-mi ~/p/hello
[...]
-break-insert main
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000e2d",func="main",file="hello.cpp",fullname="/Users/Ilia
hello.cpp",line="14",pending=["main"],times="0",original-location="main"}
```

now:
```
$ bin/lldb-mi ~/p/hello
[...]
-break-insert main
^error,msg="Command 'break-insert'. Breakpoint location 'main' not found"
```

llvm-svn: 236832
2015-05-08 12:09:56 +00:00
Ilia K 913b2d4fd3 Fix BP address for local symbols if target not launched (MI)
For example:
was:
```
$ bin/lldb-mi ~/p/hello
[...]
-break-insert -f main
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0xffffffffffffffff",func="main",file="hello.cpp",fullname="/Users/IliaK/p/hello.cpp",line="14",pending=["main"],times="0",original-location="main"}
```

now:
```
$ bin/lldb-mi ~/p/hello
[...]
-break-insert -f main
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000e2d",func="main",file="hello.cpp",fullname="/Users/IliaK/p/hello.cpp",line="14",pending=["main"],times="0",original-location="main"}
```

llvm-svn: 236830
2015-05-08 12:06:17 +00:00
Ilia K b9bfd969e3 Add support for Unicode strings in CMICmnLLDBUtilSBValue::GetValue (MI)
This patch includes the following changes:
# Add CMIUtilString::ConvertToASCII to convert unicode to ASCII (MI)
# Rework CMICmnLLDBUtilSBValue::GetSimpleValue to print wide/unicode char (MI)
## Add CMICmnLLDBUtilSBValue::GetSimpleValueChar
## Extend CMICmnLLDBUtilSBValue::IsCharType to accept char16_t/char32_t
## Don't ignore the fail_value in SBValue::GetValueAsUnsigned
# Rework CMIUtilString::ConvertToASCII (MI)
## Don't use templates
## Change the function signature to convert signle characters (was std::basic_string)
## Rename CMIUtilString::ConvertToASCII to CMIUtilString::ConvertToPrintableASCII
# Add CMIUtilString::ConvertToPrintableASCII for char (MI)
## Refactor CMIUtilString::Escape
## Simplify CMICmnLLDBUtilSBValue::GetSimpleValueChar for char
# Add char16_t* and char32_t* support in CMICmnLLDBUtilSBValue::GetSimpleValue (MI)
## Add CMICmnLLDBUtilSBValue::GetSimpleValueCStringPointer
## Add CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory2
   (it's extended version of CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory)
# Improve error checking in CMICmnLLDBUtilSBValue::GetSimpleValueChar (MI)
# Refactor CMICmnLLDBUtilSBValue (MI)
## Remove CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory
   (use CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory2 instead)
## Rename CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory2 to
   CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory
## Move CMICmnLLDBUtilSBValue::GetValueCString to private methods
## Rename CMICmnLLDBUtilSBValue::GetValueCString to
   CMICmnLLDBUtilSBValue::GetSimpleValueCStringArray
## Remove CMICmnLLDBUtilSBValue::GetChildValueCString
# Improve MiGdbSetShowTestCase.test_lldbmi_gdb_set_show_print_char_array_as_string test to check char16_t/char32_t (MI)
# Fix CMICmnLLDBUtilSBValue::GetSimpleValueCStringArray for Unicode (MI)
## Fix handling of char16_t and char32_t
## Improve CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory to read
   variables of type char[]: add vnMaxLen argument
## Turn on few cases to check char16_t[] and char32_t[] output in
   MiGdbSetShowTestCase.test_lldbmi_gdb_set_show_print_char_array_as_string
# Remove unnecessary checks in CMICmnLLDBUtilSBValue (MI)

llvm-svn: 236827
2015-05-08 11:21:13 +00:00
Tamas Berghammer 84dc009bef Re-enable compute load address for shared modules
It is required because of systems using PIE code

llvm-svn: 236826
2015-05-08 11:07:05 +00:00
Ilia K 24862eaca0 Fix -var-create for undefined variables (MI)
llvm-svn: 236825
2015-05-08 10:58:45 +00:00
Ilia K a4cfe98a86 Print process's output line by line (MI)
For example:
was:
```
@"'\r\n` - it's \\ni=1\r\nj=2\r\nx=3\r\ny=4\r\nargc: /Users/IliaK/p/hello\r\nargc: (null)\r\n"
```

now:
```
@"'\r\n"
@"` - it's \\ni=1\r\n"
@"j=2\r\n"
@"x=3\r\n"
@"y=4\r\n"
@"argc: /Users/IliaK/p/hello\r\n"
@"argc: (null)\r\n"
```

llvm-svn: 236824
2015-05-08 10:52:50 +00:00
Ilia K f1796dc669 Add MiExitTestCase.test_lldbmi_q that checks reduction of quit (MI)
llvm-svn: 236822
2015-05-08 10:42:11 +00:00
Ilia K 307b917696 Fix -var-list-children command (MI)
This patch incldues the following:
# Add from/to arguments in -var-list-children command (MI)
## Handle from and to args
## Don't print children=[] if numchild is 0
## A bit refactoring
## Add MiVarTestCase.test_lldbmi_var_list_children test
# Refactor -var-list-children (MI)
## Remove CMICmdCmdVarListChildren::VecMIValueResult_t
## Add CMICmdCmdVarListChildren::m_miValueList
## Remove CMICmdCmdVarListChildren::m_vecMiValueResult
   (use CMICmdCmdVarListChildren::m_miValueList instead)
## Print error message if value is invalid:
   ```
     ^error,msg="variable invalid"
   ```
## Refactor CMICmdCmdVarListChildren::Acknowledge and remove duplicated code
## Don't print children=[] if numchild is 0
## Add error checking
## Use CMICmnLLDBDebugSessionInfo::VariableInfoFormat_e for print-values
## Add few more empty-range test cases in MiVarTestCase.test_lldbmi_var_list_children
#Improve MiVarTestCase.test_lldbmi_var_list_children test (MI)

llvm-svn: 236820
2015-05-08 10:10:14 +00:00
Pavel Labath 014d32b3bb Have lldb_assert accept bool expressions
Summary:
This changes lldb_assert to accept bool expressions as the parameter, this is because some
objects (such as std::shared_ptr) are convertible to bool, but are not convertible to int, which
leads to surprising errors.

Reviewers: granata.enrico, zturner

Subscribers: lldb-commits

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

llvm-svn: 236819
2015-05-08 09:53:31 +00:00
Tamas Berghammer 85fadd9fe8 Fix parsing of the plt section for android-arm
The ELF data contains two different errors in some ELF files on android.
* The link field of the symbol table don't point to the plt section or
  to the dynsym section even when it is present in the ELF files.
* The size of the plt entries aren't specified in the section header of
  the plt section.

This CL adds some workarounds for these two issue with finding the
sections by name if the link field is empty and by using a heuristic to
calculate the size and offset of the plt entries.

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

llvm-svn: 236818
2015-05-08 09:40:05 +00:00
Aidan Dodds c0c838516d This patch allows LLDB to use the $qXfer:Libraries: packet.
Differential Revision: http://reviews.llvm.org/D9471

llvm-svn: 236817
2015-05-08 09:36:31 +00:00
Bruce Mitchener 3a6cc51cb9 Make LLDB-MI tests wait for LLDB-MI to start up before sending any MI commands
Summary:
This set of changes addresses the issue I described in [[ http://llvm.org/pr23403 | Bug 23403 ]], in short most LLDB-MI tests fail unexpectedly due to timeout on my Ubuntu 14.10 x86_64 VirtualBox VM. I have no idea why the Ubuntu buildbots don't seem to suffer from this issue. This patch just makes **MiTestCaseBase.spawnLldbMi()** block until the spawned LLDB-MI child process outputs the **(gdb)** prompt, which ensures that MI commands aren't sent to the LLDB-MI child process until it's ready.

Before these changes 52 LLDB-MI tests failed unexpectedly (all but one due to timeouts), after these changes no tests fail due to timeouts. I still get one unexpected failure in **test_lldbmi_source_option_start_script_error** in **TestMiStartupOptions.py**, but that's due to a file error, that test should be skipped on Linux just like the other two //start_script// tests until the file error is fixed.

Patch from Vadim Macagon. Thanks!

Test Plan: ./dotest.py -A x86_64 -C clang --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: abidh, domipheus, ki.stfu

Reviewed By: ki.stfu

Subscribers: brucem, lldb-commits

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

llvm-svn: 236816
2015-05-08 09:28:11 +00:00
Pavel Labath 337f3eb929 [NativeProcessLinux] Remove the stop callback
Summary:
The stop callback is a remnant of the ThreadStateCoordinator. We don't need it now that TSC is
gone, as we know exactly which function to call when threads stop. This also removes some
stop-related functions, which were just forwarding calls to one another.

Test Plan: ninja check-lldb continues to pass

Reviewers: chaoren, ovyalov

Subscribers: lldb-commits

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

llvm-svn: 236814
2015-05-08 08:57:45 +00:00
Ying Chen cd81914772 change comment symbol from // to #
llvm-svn: 236803
2015-05-08 01:47:17 +00:00
Ying Chen c5430525a6 Remove tailing " (deleted)" from executable name returned by readlink
Summary: When calling readlink, " (deleted)" is appended to executable path if it's deleted. Remove if it's there.

Reviewers: chaoren, sivachandra, vharron

Subscribers: lldb-commits

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

llvm-svn: 236802
2015-05-08 01:25:10 +00:00
Siva Chandra 8a1f76936c [TestEvents] Add a 'connected' state to include remote debugging.
Test Plan: dotest.py -p TestEvents

Reviewers: vharron, chaoren

Reviewed By: chaoren

Subscribers: lldb-commits

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

llvm-svn: 236800
2015-05-08 00:43:28 +00:00
Chaoren Lin 9c70ea4790 Pass Android device ID to TestStubReverseConnect.
llvm-svn: 236789
2015-05-07 22:32:40 +00:00
Zachary Turner 0c779e0440 Remove __attribute__ from VAError.
__attribute__(format(print...)) requires a function which takes
variadic arguments (... style), not a function which takes a va_list.
So following the same thing that VAPrintf does, just remove the
__attribute__ from this function.

llvm-svn: 236788
2015-05-07 22:30:24 +00:00
Siva Chandra e4583bd32b [TestWatchpointMultipleThreads] Use default test executable names.
Summary:
Android has limits on file name lengths. This commit reduces the names of
the test executables to satisfy these limits.

Test Plan: dotest.py -p TestWatchpointMultipleThreads

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 236783
2015-05-07 21:56:08 +00:00
Zachary Turner 610e52912d Add logging to ProcessWindows.
llvm-svn: 236776
2015-05-07 21:39:33 +00:00
Enrico Granata 4878c87d5e Make it so that changing formats on a synthetic value object causes children to be invalidated and refetched when needed
This is required for supporting vector types formatting

llvm-svn: 236769
2015-05-07 20:33:31 +00:00
Jim Ingham 841ee9b998 Add a missing check for m_real_stop_reason.
<rdar://problem/20738527>

llvm-svn: 236762
2015-05-07 18:51:04 +00:00
Greg Clayton 3d415cd2cd qProcessInfo was not correctly detecting the sysctl value for "hw.cpu64bit_capable".
It was just detecting the existance of the value. If it gets the value correctly, we need to check that it is non-zero to see if cpu64bit_capable should be true.

<rdar://problem/20857426> 

llvm-svn: 236759
2015-05-07 18:42:03 +00:00
Ed Maste 19a05488e3 Extend r236708 to skip tests also failing on FreeBSD
llvm-svn: 236749
2015-05-07 17:14:56 +00:00
Oleksiy Vyalov 919ef9dc37 Use file locks to synchronize access to ModuleCache.
http://reviews.llvm.org/D9056

llvm-svn: 236736
2015-05-07 15:28:49 +00:00
Pavel Labath f84d76fbf2 Increase the timeout limit for TestConcurrentEvents
After recent changes, TestConcurrentEvents began timing out. This increases the timeout limit to
7m for this test, ensure the Test has enough time to complete.

llvm-svn: 236725
2015-05-07 13:35:21 +00:00
Mohit K. Bhakkad 5bf047e5c4 A small fix in rL236696
llvm-svn: 236716
2015-05-07 11:43:23 +00:00
Ilia K e4358b81e4 Skip few MiStartupOptionsTestCase tests to get Linux build green
llvm-svn: 236708
2015-05-07 08:31:12 +00:00
Pavel Labath 5eb721edcb [NativeProcessLinux] Remove logging and error callbacks
Summary:
These are remnants of the thread state coordinator, which are now unnecessary. I have basically
inlined the callbacks. No functional change.

Test Plan: Tests continue to pass.

Reviewers: chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 236707
2015-05-07 08:30:31 +00:00
Ilia K 7bb59b360b Implement -target-attach and -target-detach
Summary:
This changes add -target-attach and -target-detach. 

-target-attach allows lldb-mi to attach to an existing process by it's process id, matching gdb mi's syntax of '-target-attach <pid'. Additionally, support has been added for attaching to a process by name using '-target-attach -n <name>'. Combining this with --waitfor will allow lldb mi to attach to a process by name when the process starts. 

-target-detach simply detaches from the current process

Patch from chuckr@microsoft.com

Test Plan: I have added three tests, one each for -target-attach <pid>, -target-attach -n <name>, and -target-attach -n <name> --waitfor

Reviewers: paulmaybee, abidh, ChuckR

Subscribers: greggm, lldb-commits

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

llvm-svn: 236705
2015-05-07 07:38:49 +00:00
Ilia K 065397be00 Minor changes in the MiStartupOptionsTestCase (MI)
llvm-svn: 236704
2015-05-07 07:16:06 +00:00
Ilia K d3da77e84e Add -s/--source option support (MI)
Summary:
This patch adds -s/--source option to execute source file with prepared command.
For example:
```
$ cat start_script 
target create ~/p/hello
process launch -s
continue
$ bin/lldb-mi -s start_script 
(gdb)
target create ~/p/hello
Current executable set to '~/p/hello' (x86_64).
^done
(gdb)
process launch -s
=shlibs-added,shlib-info=[num="1",name="hello",dyld-addr="-",reason="dyld",path="/Users/IliaK/p/hello",loaded_addr="-",dsym-objpath="/Users/IliaK/p/hello.dSYM/Contents/Resources/DWARF/hello"]
Process 33289 launched: '/Users/IliaK/p/hello' (x86_64)
^done
(gdb)
continue
=thread-created,id="1",group-id="i1"
=thread-selected,id="1"
(gdb)
Process 33289 resuming
Process 33289 exited with status = 0 (0x00000000) 
^done
```

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: abidh

Reviewed By: abidh

Subscribers: lldb-commits, abidh

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

llvm-svn: 236703
2015-05-07 06:51:46 +00:00
Ilia K 8913012ee9 Remove quit hook in CMIDriver::DoMainLoop (MI)
Summary:
This patch removes quit hook and fixes 1 bug:
# Fix "quit" hook in CMIDriver::DoMainLoop (MI)
# Fix bug when the handler thread exits without any notification (MI)
# Fix a race condition in CMICmnLLDBDebugger::MonitorSBListenerEvents (MI)

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: abidh

Reviewed By: abidh

Subscribers: lldb-commits, abidh

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

llvm-svn: 236702
2015-05-07 06:45:42 +00:00
Ilia K ece0a3f69c Fix ClangUserExpression::Evaluate return code in case of eExpressionParseError
Summary: This patch fixes retvalue of ClangUserExpression::Evaluate in case of eExpressionParseError error

Reviewers: jingham, spyffe, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, spyffe, jingham

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

llvm-svn: 236700
2015-05-07 06:27:43 +00:00
Ilia K 8f0db3e1f0 Don't call the Process::SyncIOHandler in Target::Launch
Summary: This patch moves synchronization of iohandler to CommandObjectProcessLaunch::DoExecute like it was done in CommandObjectProcessContinue::DoExecute.

Reviewers: jingham, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, jingham

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

llvm-svn: 236699
2015-05-07 06:26:27 +00:00
Mohit K. Bhakkad cdc22a889e [LLDB][MIPS] Software single stepping
Patch by Jaydeep Patil

Reviewers: clayborg, jasonmolenda
Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D9519

llvm-svn: 236696
2015-05-07 05:56:27 +00:00
Bruce Mitchener 2873469ec0 Fix LLDB-MI -data-read-memory-bytes command to comply with GDB/MI spec
Summary:
- The address argument can now be an expression (e.g. &array), it's no longer restricted to being just a number literal.
- The -o (offset) option is now properly handled, not just silently ignored.
- The --thread option is now properly handled.
- A new --frame option has been added for consistency with GDB.
- Added a new test to verify old and new functionality.

Patch by Vadim Macagon. Thanks!

Test Plan: ./dotest.py -A x86_64 -C clang --executable $BUILDDIR/bin/lldb tools/lldb-mi/data

Reviewers: domipheus, abidh, ki.stfu

Reviewed By: abidh, ki.stfu

Subscribers: brucem, lldb-commits

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

llvm-svn: 236694
2015-05-07 05:32:13 +00:00
Chaoren Lin 28b8ea1d55 Fix adb forward in gdbremote_testcase to support multiple devices.
Summary: Update to D9510.

Reviewers: chying, tberghammer, ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 236688
2015-05-07 01:42:53 +00:00
Greg Clayton 28eb7bf406 Don't crash if we load a file with an architecture we don't support and try to parse some DWARF.
The ClangASTContext::getTargetInfo() will return NULL in this case and could cause us to crash if we don't check.

<rdar://problem/20543554> 

llvm-svn: 236681
2015-05-07 00:07:44 +00:00
Enrico Granata 087638b3a6 I forgot to return here, so do it, and appease the compiler
llvm-svn: 236646
2015-05-06 21:54:18 +00:00
Enrico Granata ba4b8b0917 Add a language objc class-table dump command
This command dumps a bunch of interesting facts about all Objective-C classes known to LLDB in the inferior process

llvm-svn: 236640
2015-05-06 21:01:07 +00:00
Ed Maste 18461e5c87 Skip additional lldb-mi tests that failed on FreeBSD
llvm-svn: 236636
2015-05-06 20:42:03 +00:00
Sean Callanan ac28c7044f Allow the gdb_objc_realized_classes symbol to be
any type of symbol, which is okay since we are
looking only in the Objective-C module.

<rdar://problem/20828139>

llvm-svn: 236622
2015-05-06 18:33:19 +00:00
Adrian McCarthy c99d2fadb5 Don't attempt DSym tests on Windows.
llvm-svn: 236620
2015-05-06 18:19:51 +00:00
Ed Maste e7f46558a4 Restore TestRegisterVariables failure decorator for older Clang
The @expectedFailureClang decorator was removed in r236447, but it
seems to be fixed only with Clang 3.5+.

llvm-svn: 236614
2015-05-06 17:35:29 +00:00
Pavel Labath ad5ee04058 Simplify FuncUnwinders::GetEHFrameAugmentedUnwindPlan
Summary:
GetEHFrameAugmentedUnwindPlan duplicated the work of GetEHFrameUnwindPlan in getting the original
plan from DWARF CFI. This changes the function to call GetEHFrameUnwindPlan instead of doing all
the work itself. A copy constructor is added to UnwindPlan to enable plan copying.

Test Plan: No regressions on linux test suite.

Reviewers: jasonmolenda, clayborg

Subscribers: lldb-commits

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

llvm-svn: 236607
2015-05-06 15:54:48 +00:00
Pavel Labath ed89c7fe44 [NativeProcessLinux] Remove the post-stop lambda
Summary:
The lambda was always calling SetState(eStateStopped) with small variations, so I have inlined
the code. Given that we don't have the TSC anymore, I believe we don't need to be so generic.

The only major change here is the way we choose a stop reason thread when we're interrupting a
program on client request. Previously, we were setting a null stop reason for all threads and
then fixing up the reason for one victim thread in the lambda. Now, I make sure the stop reason
is set for the victim thread correctly in the first place.

I also take the opportunity to rename CallAfter* functions into something more appropriate.

Test Plan: All tests continue to pass.

Reviewers: chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 236595
2015-05-06 12:22:37 +00:00
Pavel Labath c076559a5b [NativeProcessLinux] fold ThreadStateCoordinator into NPL
Summary:
Since all TSC operations are now executed synchronously, TSC has become a little more than a
messenger between different parts of NativeProcessLinux. Therefore, the reason for its existance
has disappeared.

This commit moves the contents of the TSC into the NPL class. This will enable us to remove all
the boilerplate code in NPL (as it stands now, this is most of the class), which I plan to do in
subsequent commits.

Unfortunately, this also means we will lose the unit tests for the TSC. However, since the size
of the TSC has diminished, the unit tests were not testing much at this point anyway, so it's not
a big loss.

No functional change.

Test Plan: All tests continue to pass.

Reviewers: vharron, chaoren

Subscribers: lldb-commits

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

llvm-svn: 236587
2015-05-06 10:46:34 +00:00
Pavel Labath 9d37c41022 [ThreadStateCoordinator] Remove Event classes
Summary:
This is a cleanup patch for thread state coordinator. After making processing of all events
synchronous, there is no need to have a a separate class for each event. I have moved back
processing of all events back into the TSC class. No functional change.

Test Plan: All tests continue to pass.

Reviewers: chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 236576
2015-05-06 08:23:47 +00:00
Chaoren Lin f9c4c424ac Update gdbremote_testcase to accomodate new adb:// scheme.
Reviewers: chying, ovyalov

Reviewed By: chying, ovyalov

Subscribers: lldb-commits

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

llvm-svn: 236560
2015-05-06 01:28:04 +00:00
Oleksiy Vyalov 8a28b21fde Mark TestMultithreaded.test_sb_api_listener_resume as XFAIL with gcc 4.8 and higher.
llvm-svn: 236549
2015-05-05 22:02:56 +00:00
Chaoren Lin f62b7fc317 Fix typo. platfrom -> platform
llvm-svn: 236543
2015-05-05 20:34:36 +00:00
Greg Clayton 9c284c4d7a Make sure that the following paths say they are equal:
/private/tmp/main.cpp
/private/tmp/..//tmp/main.cpp

We saw paths like this in makefile generate binaries when someone left an extra '/' on the end of a makefile variable.

<rdar://problem/18945972>

llvm-svn: 236541
2015-05-05 20:26:58 +00:00
Chaoren Lin ce36c4cee1 Fix process launch from Windows host to Android target.
Summary:
- Denormalized path on Windows host causes bad `A` packet.
- Executables copied from Windows host doesn't have executable bits.

Reviewers: tberghammer, zturner, ovyalov

Reviewed By: ovyalov

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 236516
2015-05-05 18:43:19 +00:00
Chaoren Lin 26438d26fa Fix Android build.
llvm-svn: 236509
2015-05-05 17:50:53 +00:00
Pavel Labath 45f5cb31dc [NativeProcessLinux] Get rid of the thread state coordinator thread
Summary:
This change removes the thread state coordinator thread by making all the operations it was
performing synchronous. In order to prevent deadlock, NativeProcessLinux must now always call
m_monitor->DoOperation with the m_threads_mutex released. This is needed because HandleWait
callbacks lock the mutex (which means the monitor thread will block waiting on whoever holds the
lock). If the other thread now requests a monitor operation, it will wait for the monitor thread
do process it, creating a deadlock.

To preserve this invariant I have introduced two new Monitor commands: "begin operation block"
and "end operation block". They begin command blocks the monitor from processing waitpid
events until the corresponding end command, thereby assuring the monitor does not attempt to
acquire the mutex.

Test Plan: Run the test suite locally, verify no tests fail.

Reviewers: vharron, chaoren

Subscribers: lldb-commits

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

llvm-svn: 236501
2015-05-05 15:05:50 +00:00
Pavel Labath 941b743fc9 Revert "Enable TestConvenienceVariables on Linux"
This reverts commit 193ac6993b64a502db6dc7f2d69dafc47c318407.

The buildbot says the test still fails. :)

llvm-svn: 236500
2015-05-05 14:54:23 +00:00
Pavel Labath 0d31df479f Enable TestConvenienceVariables on Linux
The test has passed in the last 300 runs for me, enabling to see what the buildbot says.

llvm-svn: 236498
2015-05-05 13:48:58 +00:00
Pavel Labath c23ba555c2 Enable TestChangeValueAPI on Linux
the test has passed in the last 300 runs, enabling to see what the build bot says. Also,
downgrading skipIfGcc to XFAIL, with plans of enabling it in the future if it shows to be
working.

llvm-svn: 236496
2015-05-05 12:10:13 +00:00
Pavel Labath 4647c5964b Enable TestCallStopAndContinue on Linux
This test has been working reliably for me in the last 300 test runs. Enabling to see what the
buildbot thinks...

llvm-svn: 236495
2015-05-05 11:08:08 +00:00
Aidan Dodds df627e73a1 Fix GetModuleInfo() not checking for unsupported RSP response.
http://reviews.llvm.org/D9473

llvm-svn: 236486
2015-05-05 08:31:55 +00:00
Jason Molenda 9060e987a0 Fix an uninitialized memory use error when interpreting
compact unwind encodings for x86_64 / i386 omit-frame-pointer
code.  It was possible for lldb to get the location of saved
registers incorrect for some of these functions.
<rdar://problem/20753264> 

llvm-svn: 236478
2015-05-05 02:05:53 +00:00
Jason Molenda d752050cc3 Add CommandObjectLanguage to the xcode project file.
llvm-svn: 236477
2015-05-05 02:03:37 +00:00
Siva Chandra e32f2b57ff [ValueObject::GetPointeeData] Get addr from value for eValueHostAddress values.
Summary:
After r236447, ValueObject::GetAddressOf returns LLDB_INVALID_ADDRESS
when the value type is eValueHostAddress. For such a case, clients of
GetAddressOf should get the address from the scalar part of the value
instead of using the value returned by GetAddressOf directly.

This change also makes ValueObject::GetAddressOf set the address type to
eAddressTypeHost for values of eValueHostAddress so that clients can
recognize that they need to fetch the address from the scalar part
of the value.

Test Plan: ninja check-lldb on linux

Reviewers: clayborg, ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 236473
2015-05-05 00:41:35 +00:00
Siva Chandra a3747a9d31 [ValueObject] Do not return address of eValueTypeHostAddress values.
Summary:
This fixes TestRegisterVariables for clang and hence it is enabled in this commit.


Test Plan: dotest.py -C clang -p TestRegisterVariables

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 236447
2015-05-04 19:43:34 +00:00
Colin Riley c9c55a26bd Add language command and LanguageRuntime plugin changes to allow vending of command objects.
Differential Revision: http://reviews.llvm.org/D9402

llvm-svn: 236443
2015-05-04 18:39:38 +00:00
Jim Ingham 204d0ee01f Fix a typo in the warning.
<rdar://problem/20799707>

llvm-svn: 236429
2015-05-04 17:33:33 +00:00
Oleksiy Vyalov 19f731f0ea Mark TestTypedefArray as XFAIL with Gcc.
llvm-svn: 236425
2015-05-04 15:20:25 +00:00
Mohit K. Bhakkad 1c34f7cf18 [LLDB][MIPS] Emulate instruction using MCDisassembler
Patch by Jaydeep Patil

EmulateInstructionMIPS64 has been modified to use llvm::MCDisassembler instead of duplicating the decoding logic.
Added emulation of few branch instructions for software single stepping

Reviewers: clayborg, jasonmolenda
Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D9319

llvm-svn: 236411
2015-05-04 06:28:04 +00:00
Vince Harron f9900379b4 TestCModules - fixed for gcc
Changed restrict keyword to something understood by gcc

llvm-svn: 236410
2015-05-04 06:26:13 +00:00
Vince Harron 0da0d4a948 XFAILing a test that fails with gcc 4.9 x86_64
llvm-svn: 236407
2015-05-04 03:53:22 +00:00
Vince Harron 410a9e1e1e un-skipped a bunch of tests on Linux
Some have been marked as skipIfLinux for years.
The seem to be passing so I've enabled them.

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

llvm-svn: 236403
2015-05-04 03:06:04 +00:00
Vince Harron c849267a69 Fixed skipIfLinuxClang to check the target architecture
Instead of the host architecture

This decorator isn't in use anywhere currently.
Add it to a test and run

llvm-svn: 236402
2015-05-04 02:59:19 +00:00
Vince Harron f2e3760ad8 Enabled libc++ formatter tests on Linux
Refactored TestInitializerList to not be an inline test.
Refactored Makefiles to use USE_LIBCPP instead of adding FLAGS directly
Fixed copy/paste error in TestDataFormatterUnordered class name

Differenttial Revision: http://reviews.llvm.org/D9426

llvm-svn: 236401
2015-05-04 02:56:32 +00:00
Vince Harron 026137628f TestMultithreaded improvements
These tests link against host lldb API. Compiler's target triple
must match liblldb triple. Instead of naively skipping i386, I added
a check of the liblldb arch against the compiler target arch.

This is useful for 32 bit API builds (planned for Windows)

Since remote is disabled, we can assume the os is the same.

Also, removed skipIfLinuxClang because it's passing

llvm-svn: 236396
2015-05-04 00:17:53 +00:00
Siva Chandra 6b921144ce Mark the other test of TestFdLeak also as xfail to keep the bot green.
Summary:
r235916 marked only one of the tests as xfail, but the other also has
been failing intermitantly on the buildbot.

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: lldb-commits

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

llvm-svn: 236366
2015-05-02 00:37:12 +00:00
Jason Molenda 8980e6bc10 Change process kill to call Process::Destroy (force_kill = true);
follow-up to the change in r235158.  Right now if you attach to 
a process and type "kill", lldb doesn't kill it, it detaches.
<rdar://problem/20691198> 

llvm-svn: 236363
2015-05-01 23:39:48 +00:00
Enrico Granata b0e8a55d4d Fix an issue where the UTF dumper was ignoring the direction to generate uncapped dumps
llvm-svn: 236362
2015-05-01 22:57:38 +00:00
Chaoren Lin b2b3ff1860 Fixed some compiler warnings because of bit-width mismatches.
llvm-svn: 236323
2015-05-01 16:58:18 +00:00
Chaoren Lin 3ea689b313 Support remote-android with multiple connected devices.
Summary:
This change introduces a new URL scheme for `platform connect`:
```
adb://device-id:port
```

Reviewers: vharron, tberghammer, clayborg, ovyalov

Reviewed By: ovyalov

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 236321
2015-05-01 16:49:28 +00:00
Chaoren Lin ec53482aef PosixPipes should not be copyable but should be movable.
Summary: This addresses Oleksiy's comment in D9307.

Reviewers: clayborg, ovyalov

Reviewed By: clayborg, ovyalov

Subscribers: lldb-commits

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

llvm-svn: 236320
2015-05-01 16:49:23 +00:00
Sean Callanan 80c9759ef7 Added support for locating and importing functions
(including inline functions) from modules in the
expression parser.  We now have to retain a reference
to the code generator in ClangExpressionDeclMap so
that any imported function bodies can be appropriately
sent to that code generator.

<rdar://problem/19883002>

llvm-svn: 236297
2015-05-01 00:47:29 +00:00
Sean Callanan 09b41c0785 Fixed some compiler warnings because of bit-width
mismatches.

llvm-svn: 236295
2015-05-01 00:44:36 +00:00
Sean Callanan 1376469a61 Updated our use of clang::Preprocessor to reflect
a change in the API used to get macros.

llvm-svn: 236292
2015-05-01 00:19:44 +00:00
Jim Ingham 2c83e336a1 Don't return nullptr when you mean to return an empty llvm::StringRef...
<rdar://problem/20747164>

llvm-svn: 236287
2015-04-30 23:45:07 +00:00
Jason Molenda ebd01b0ae6 Guard against the case where the Write method is called with
an argument pointing into the middle of m_buffer and then
Write() calls GrowBuffer() to resize m_buffer, leaving 
the content argument pointing into deallocated memory.

Patch by Kate Stone.
<rdar://problem/20756722> 

llvm-svn: 236286
2015-04-30 23:42:56 +00:00
Jason Molenda 29db330ce7 Use #include "lldb/API/SBCommandReturnObject.h" instead of <...>.
llvm-svn: 236284
2015-04-30 23:31:04 +00:00
Sean Callanan 68f85e7d6a Made macros from modules be injected before our
global convenience expression prefix.  Also ensured
that if macros are defined by the modules we don't
try to redefine them.  Finally cleaned up a bit of
code while I was in there.

<rdar://problem/20756642>

llvm-svn: 236266
2015-04-30 21:49:58 +00:00
Zachary Turner 26c0a5ea0d Remove the NullLog class introduced in r236174.
Based on list discussions, a different approach is desired for
reducing the visual impact of logging statements on the
readability of the code.  Another mechanism will be added in
a followup patch, but for now, since NullLog is unreferenced,
this patch just removes it.

This patch does *not* remove the other half of r236174, which was
to delete some dead code surrounding logging flags.

llvm-svn: 236259
2015-04-30 21:03:37 +00:00
Ilia K d8c1475f46 Fix Process::ResumeSynchronous which waits a process even in case of error
llvm-svn: 236231
2015-04-30 13:10:32 +00:00
Ilia K 70dd606f25 Fix MiLibraryLoadedTestCase.test_lldbmi_library_loaded test on Linux (MI)
llvm-svn: 236229
2015-04-30 12:37:05 +00:00
Ilia K 715eab12e5 Use \d+ pattern instead of hard-coded line number in MiBreakTestCase (MI)
llvm-svn: 236228
2015-04-30 12:28:26 +00:00
Pavel Labath 6884aa1b43 Enabling two watchpoint tests on linux
After recent changes, these tests should be stable. Please let me know if you still see failures.

llvm-svn: 236226
2015-04-30 11:28:06 +00:00
Ilia K ebb4dfd350 Rework =shlibs-added/=shlibs-removed
Summary:
This patch includes the following:
* Rename =shlibs-added/=shlibs-removed to standard =library-loaded/=library-unloaded
* Remove redundant fields
* Add extra symbols-loaded/symbols-path and loaded_addr fields
* Rename CMICmnMIOutOfBandRecord::eOutOfBand_TargetModulesLoaded/eOutOfBand_TargetModulesUnloaded to CMICmnMIOutOfBandRecord::eOutOfBand_TargetModuleLoaded/eOutOfBand_TargetModuleUnloaded

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: jasonmolenda, jingham, abidh

Reviewed By: abidh

Subscribers: lldb-commits, jingham, jasonmolenda, abidh

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

llvm-svn: 236225
2015-04-30 11:08:31 +00:00
Pavel Labath ac8be96242 Add expectedFailureLinux to TestProcessAttach
The test is skipped anyway due to timeout, but adding XFAIL improves grepability.

llvm-svn: 236224
2015-04-30 11:00:15 +00:00
Pavel Labath d351bcc858 Fix typo in Core/Log
llvm-svn: 236222
2015-04-30 10:47:56 +00:00
Ilia K 4ba3aee138 Add -data-info-line command (MI)
Summary: Add -data-info-line command + test

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: abidh

Reviewed By: abidh

Subscribers: lldb-commits, abidh

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

llvm-svn: 236208
2015-04-30 07:14:24 +00:00
Chaoren Lin 1d6ab11141 Add CMAKE_EXECUTABLE_SUFFIX to build with Android toolchain on Windows.
Reviewers: vharron, zturner, flackr

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 236185
2015-04-29 23:59:22 +00:00
Richard Smith 63a41277fe Fix build after Clang API change in r236176.
llvm-svn: 236182
2015-04-29 23:46:48 +00:00
Zachary Turner b74e279fe1 Fix build broken by r236174.
Apparently va_list is literally a char* on Windows.

llvm-svn: 236177
2015-04-29 23:24:12 +00:00
Zachary Turner c1592658d5 Introduce a NullLog class, which ignores all messages.
The purpose of this class is so that GetLogIfAllCategoriesSet
can always return an instance of some class, whether it be a real
logging class or a "null" class, which ignores messages.  Code
that is littered with if statements that only log if the pointer
is non-null can get very unwieldy very quickly, so this should
help code readability in such circumstances.

Since I'm in this code anyway, I'm also deleting the
PrintfWithFlags methods, as well as all the flags, since they
appear to be dead code that have been superceded by newer
mechanisms and all the flags are simply ignored.

llvm-svn: 236174
2015-04-29 22:55:28 +00:00
Jason Molenda 3114703b5c Don't force a vendor check in ProcessMachCore::CanDebug() -- if this
is a Mach-O file and it is a Mach-O core file, activate the 
ProcessMachCore plugin.
<rdar://problem/20739989> 

llvm-svn: 236170
2015-04-29 22:17:45 +00:00
Jason Molenda 0e78cab17b Update to build sysv-arm/sysv-arm64/sblanguageinfo/registercontextlinux_arm64.
llvm-svn: 236169
2015-04-29 22:16:19 +00:00
Chaoren Lin 4dc65069a1 lldb-gdbserver should not use unnamed pipes on Windows.
llvm-svn: 236138
2015-04-29 19:01:43 +00:00
Chaoren Lin 66f2e12f7a Expose Close{Read/Write}FileDescriptor for pipes.
llvm-svn: 236136
2015-04-29 18:25:18 +00:00
Chaoren Lin a52f48412d Add file descriptor constructor for PipePosix.
llvm-svn: 236133
2015-04-29 17:36:58 +00:00
Chaoren Lin 3eb4b4589e Remove trap code from disassembly.
Summary:
NativeProcessProtocol uses ReadMemory internally for setting/checking
breakpoints but also for generic memory reads (Handle_m), this change adds a
ReadMemoryWithoutTrap for that purpose. Also fixes a bunch of misuses of addr_t
as size/length.

Test Plan: `disassemble` no longer shows the trap code.

Reviewers: jingham, vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 236132
2015-04-29 17:24:48 +00:00
Omair Javaid b78e05fead This patch adds support aarch64-linux-gnu (SysV) abi in lldb.
This code is also an import from MacOSx implementation as SysV abi is
similar to what has been implemented for MacOS but may require a few tweaks.

http://reviews.llvm.org/D8538

llvm-svn: 236098
2015-04-29 11:52:35 +00:00
Omair Javaid 52f825bd1c This patch adds required piece of code for SysV Abi for arm.
Its mostly imported from MacOSx ABI for arm which is similar.

Further tweaking a updates may be required at a later stage.

http://reviews.llvm.org/D8539

llvm-svn: 236097
2015-04-29 10:49:45 +00:00
Aidan Dodds ed9f612639 Fix bug in gdb-remote xml parser which failed to parse xml split over multiple rsp packets.
llvm-svn: 236095
2015-04-29 10:08:17 +00:00
Hafiz Abid Qadeer fda237d09f Add support for -stack-list-variables.
This command is able to list both local variables and stack arguments for a specific thread/frame.
Args are denoted with 'arg="1"'.
Patch from Chuck Ries.

llvm-svn: 236090
2015-04-29 08:18:41 +00:00
Siva Chandra e6303cc3a1 [TestMiVar] Enable one of the tests for GCC.
Summary:
The "internal" name of vars is different between clang and GCC. All this
change does is to use a regex instead of the hardcoded internal name.

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

Reviewers: ki.stfu

Reviewed By: ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 236024
2015-04-28 19:21:57 +00:00
Hafiz Abid Qadeer 7f2f0ccb0a Replace sprintf with snprintf to avoid a crash.
During testing -data-list-register-values, I saw a crash here due to buffer overflow.
This commit should fix the crash. There is still problem with printing 1-byte register
in some cases that I will fix separately.

No regression on MI test cases.

llvm-svn: 235991
2015-04-28 14:16:00 +00:00
Ilia K 7f83624222 Add language option in -gdb-show command (MI)
Summary:
Add language option in -gdb-show command + test:
```
$ bin/lldb-mi ~/p/hello
[...]
b main
[...]
r
[...]
(gdb)
-gdb-show language
^done,value="c++"
(gdb)
quit
```

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: abidh, granata.enrico, jingham, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, jingham, granata.enrico, clayborg, abidh

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

llvm-svn: 235983
2015-04-28 12:51:16 +00:00
Ilia K 6e46512ec3 Don't print a type of variable in Address::Dump if it's unknown (i.e. nullptr)
Summary: This patch fixes dereferencing of nullptr in case when GetType() returns that.

Reviewers: jingham, granata.enrico, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, granata.enrico, clayborg, jingham

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

llvm-svn: 235982
2015-04-28 12:45:57 +00:00
Ewan Crawford 26607f799a test commit
llvm-svn: 235980
2015-04-28 12:34:19 +00:00
Pavel Labath bbaba96860 Skip TestProcessAttach.py on Linux
The test was already XFAILed. Changing this to skip, because the test timeouts and gets flagged
as an error anyway.

llvm-svn: 235979
2015-04-28 12:28:08 +00:00
Bruce Mitchener 41ad9c4128 LLDB-MI: -var-list-children with no children doesn't need a children value in the response.
Summary:
When using GDB with MI, if there aren't children for a variable,
it doesn't include a "children" value in the response. LLDB does
and sets it to "[]" while variables with children have an unquoted
list: children=[...].

This removes the children value entirely when there are no children
making this match GDB in behavior.

Test Plan: Ran tests on Mac OS X and they passed.

Reviewers: abidh, domipheus

Subscribers: lldb-commits

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

llvm-svn: 235974
2015-04-28 10:03:55 +00:00
Pavel Labath 426bdf8861 [NativeProcessLinux] Add back synchronisation of thread create events
Summary:
Without the synchronisation between the two thread creation events the following case could
happen:
- threads A and B are running. A hits a breakpoint. We note that we want to stop B.
- before we could stop it, B creates a new thread C, we get the stop notification for B, but we
  don't record C's existence yet.
- we resume B
- before we get the C notification, B stops again (e.g. hits a breakpoint, gets our SIGSTOP,
  etc.)
- we see all known threads have stopped, and we notify LLDB
- C notification comes, we note it's existence and resume it
=> we have an inconsistent state (LLDB thinks we've stopped, but C is running)

I resolve this by doing a blocking wait for for the C notification when we get the creation
notification on the parent (B) thread. This way the two events are synchronised, but we don't
need to introduce the intermediate "launching" state which would complicate handling of thread
states as all code would need to be aware of the third possible state.

Test Plan:
This is an obscure corner case, which I had not observed in practise, so I have no
test for it. I have tested that this commit does not regress in existing tests though.

Reviewers: chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 235969
2015-04-28 07:51:52 +00:00
Siva Chandra 0bbe4f2c8e [TestProcessAttach] Decorate with expectedFailureLinux
Summary: Link to PR: llvm.org/pr23360

Test Plan: dotest.py -p TestProcessAttach

Reviewers: sivachandra

Subscribers: lldb-commits

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

llvm-svn: 235947
2015-04-27 23:56:23 +00:00
Chaoren Lin 368c9f6e9b Add an unnamed pipe fail-safe to launching lldb-gdbserver.
Summary:
Currently, launching lldb-gdbserver from platform on Android requires root for
mkfifo() and an explicit TMPDIR variable. This should remove both requirements.

Test Plan: Successfully launched lldb-gdbserver on a non-rooted Android device.

Reviewers: tberghammer, vharron, clayborg

Reviewed By: clayborg

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 235940
2015-04-27 23:20:30 +00:00
Zachary Turner 7cc3494dea [Windows] Add a RegisterContextWindows_x64.
With this patch, LLDB can debug x64 executables on Windows with
the same level of functionality as for x86 executables.

llvm-svn: 235935
2015-04-27 22:58:57 +00:00
Chaoren Lin cae516117a XFail flakey test.
llvm-svn: 235916
2015-04-27 20:57:24 +00:00
Greg Clayton 937ff6e9c6 Make sure files in the Xcode project in source/API are in alphabetic order.
llvm-svn: 235894
2015-04-27 16:52:08 +00:00
Greg Clayton 63adb3f5ff Make sure versions are valid before we try to use them. Also check for invalid versions[0] by comparing it to UINT32_MAX instead of 0.
llvm-svn: 235892
2015-04-27 16:49:57 +00:00
Hafiz Abid Qadeer 398732979a Improve handling of ctrl-c with MSVC.
Currently hitting Ctrl-C in Windows LLDB-MI just exits MI. But according to test_lldbmi_stopped_when_interrupt() in TestMiSignal.py Ctrl-C should send a SIGINT signal to the inferior.
Patch adds this functionality to Windows so SIGINT is sent on Ctrl-C.

Patch from EwanCrawford. Reviewed in http://reviews.llvm.org/D9248.

llvm-svn: 235887
2015-04-27 15:04:42 +00:00
Omair Javaid a77ca519ea Fix LLDB ARM build error on ubuntu precise with gcc4.7
Differential revision: http://reviews.llvm.org/D9100

llvm-svn: 235865
2015-04-27 12:01:59 +00:00
Ilia K c04ce6e25c Fix double stdout/stderr output from CLI commands in MI mode (MI)
Summary:
This patch fixes stdout/stderr output that printed twice for CLI commands:
was:
```
(gdb)
target create ~/p/hello
Current executable set to '~/p/hello' (x86_64).
Current executable set to '~/p/hello' (x86_64).
^done
(gdb)
```
now:
```
(gdb)
target create ~/p/hello
Current executable set to '~/p/hello' (x86_64).
^done
(gdb)
```

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: abidh

Reviewed By: abidh

Subscribers: lldb-commits, abidh

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

llvm-svn: 235857
2015-04-27 10:07:49 +00:00
Pavel Labath 980b92a8e6 Add missing libraries to unittest link
Summary:
Currently, linking of the unittests fails on linux because it is missing a bunch of symbols from
libedit, curses, etc. This fixes the build by adding the correct dependencies.

Test Plan: Linking works, unit tests run.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 235853
2015-04-27 09:26:03 +00:00
Pavel Labath 6648fcc34b Fix register read callback in linux-arm single stepping
The previous read callback always read the value of the register what
caused problems when the emulator wrote some value into a register and
then expected to read the same value back. This CL add a register value
cache into the callbacks to return the correct value after a register
write also.

Test Plan: Stepping over BL/BLX instruction works on android-arm if the instruction set isn't change (other, unrelated patch will come for the case when we move to an other instruction set)

Reviewers: omjavaid, sas, clayborg

Reviewed By: clayborg

Subscribers: labath, tberghammer, rengolin, aemerson, lldb-commits

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

From: Tamas Berghammer <tberghammer@google.com>
llvm-svn: 235852
2015-04-27 09:21:14 +00:00
Pavel Labath 53ffb319d1 XFAIL two mi tests on gcc to stabilise build bots
llvm-svn: 235851
2015-04-27 09:10:30 +00:00
Ilia K ce216063ac Add SBLaunchInfo in include/lldb/API/SBDefines.h and fix spacing in scripts/Python/buildSwigPython.py
llvm-svn: 235819
2015-04-26 07:51:14 +00:00
Ilia K b64b8e16db Clean the CMIDriver (MI)
This patch does the following things:
* Use CMICmnStreamStdout::TextToStdout to print (gdb) prompt in CMIDriver::InitClientIDEEclipse
* Remove unnecessary inclusions

llvm-svn: 235817
2015-04-26 05:55:59 +00:00
Ilia K fb2be6c6f3 Clean CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateSuspended (MI)
Don't call the lldb::SBProcess::GetRestartedFromEvent twice while
handling the CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateSuspended.

llvm-svn: 235812
2015-04-25 21:21:55 +00:00
Ilia K 41a38d2021 Fix CMIUtilThreadActiveObjBase::ThreadIsActive when a thread has died (MI)
llvm-svn: 235811
2015-04-25 21:20:00 +00:00
Ilia K cf0c0bce01 Disable MiGdbSetShowTestCase.test_lldbmi_gdb_set_show_print_char_array_as_string test on Linux
llvm-svn: 235808
2015-04-25 20:37:41 +00:00
Ilia K 94b8ebcacf Add -gdb-set/-gdb-show aggregate-field-names option (MI)
Use this option to print/skip field names (default is on):
```
-var-create var1 * complx
^done,name="var1",numchild="3",value="{i = 3, inner = {l = 3}, complex_ptr = 0x[0-9a-f]+}",type="complex_type",thread-id="1",has_more="0"
-var-create var2 * complx_array
^done,name="var2",numchild="2",value="{[0] = {i = 4, inner = {l = 4}, complex_ptr = 0x[0-9a-f]+}, [1] = {i = 5, inner = {l = 5}, complex_ptr = 0x[0-9a-f]+}}",type="complex_type [2]",thread-id="1",has_more="0"
-gdb-set print aggregate-field-names off
^done
-var-create var3 * complx
^done,name="var3",numchild="3",value="{3,{3},0x[0-9a-f]+}",type="complex_type",thread-id="1",has_more="0"
-var-create var4 * complx_array
^done,name="var4",numchild="2",value="{{4,{4},0x[0-9a-f]+},{5,{5},0x[0-9a-f]+}}",type="complex_type [2]",thread-id="1",has_more="0"
```

llvm-svn: 235807
2015-04-25 20:33:02 +00:00
Ilia K 81bd06d787 Add -gdb-set/-gdb-show expand-aggregates option (MI)
Use this option to expand complex types always:
```
-var-create var1 * complx
^done,name="var1",numchild="3",value="{...}",type="complex_type",thread-id="1",has_more="0"
-var-create var2 * complx_array
^done,name="var2",numchild="2",value="[2]",type="complex_type [2]",thread-id="1",has_more="0"
-gdb-set print expand-aggregates on
^done
-var-create var3 * complx
^done,name="var3",numchild="3",value="{i = 3, inner = {l = 3}, complex_ptr = 0x[0-9a-f]+}",type="complex_type",thread-id="1",has_more="0"
-var-create var4 * complx_array
^done,name="var4",numchild="2",value="{[0] = {i = 4, inner = {l = 4}, complex_ptr = 0x[0-9a-f]+}, [1] = {i = 5, inner = {l = 5}, complex_ptr = 0x[0-9a-f]+}}",type="complex_type [2]",thread-id="1",has_more="0"
```

llvm-svn: 235805
2015-04-25 20:10:02 +00:00
Ilia K aa82b4af84 Add -gdb-set/-gdb-show print char-array-as-string option (MI)
llvm-svn: 235804
2015-04-25 19:44:56 +00:00
Adrian McCarthy f60daf7ca2 Eliminate redundant Alias test and improve Common Short Spellings test http://reviews.llvm.org/D9268
llvm-svn: 235790
2015-04-24 23:18:15 +00:00
Robert Flack 31870e15fa Look for both .debug and dsym debugging symbol information for stripped executable.
Currently Symbols::LocateExecutableSymbolFile on MacOSX only looks for external
dsym debugging information, however if running on a stripped dwarf executable it
should also check for a .debug file as well.

Test Plan:
./dotest.py $DOTEST_OPTS -t -p TestSharedLibStrippedSymbols.py
This test now passes when running a remote Mac -> Linux test, and still passes
running locally on Mac or locally on Linux.

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

llvm-svn: 235737
2015-04-24 18:09:54 +00:00
Tamas Berghammer 224dfbf3ae Fix condition detection in EmulateInstructionARM
The condition detection code is calculating the result of the condition
based on the first 3 bit of the condition and then negate it if the LSB
of the condition is set. It works for the normal conditions but 0b1110
and 0b1111 are special as both of them should evaluate to true
independently the value of CPSR. This CL removes the negating logic from
those cases.

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

llvm-svn: 235715
2015-04-24 12:13:44 +00:00
Tamas Berghammer 0da3ee1ef3 Fix order of b and blx instrction in EmulateInstructionARM
In the previous ordering some "blx <label>" instruction was recognised
as "b #imm24" instructions causing a failure in the instruction
emulator.

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

llvm-svn: 235714
2015-04-24 12:13:41 +00:00
Tamas Berghammer 04f7144907 Fix write register context for arm "add<c> <Rd>, sp, #imm"
Differential revision: http://reviews.llvm.org/D9213

llvm-svn: 235713
2015-04-24 12:13:38 +00:00
Ilia K 1107b015c2 Use self.fail() in MiGdbSetShowTestCase.test_lldbmi_gdb_set_target_async_off (MI)
llvm-svn: 235712
2015-04-24 11:41:42 +00:00
Ilia K afef49267a Fix CMICmnLLDBDebuggerHandleEvents::GetProcessStdout/GetProcessStderr to use stream-record (MI)
llvm-svn: 235711
2015-04-24 11:33:36 +00:00
Ilia K b9355045e1 Fix CMICmnMIOutOfBandRecord to accept stream-records (MI)
Previously the CMICmnMIOutOfBandRecord class worked only with async-records.

llvm-svn: 235709
2015-04-24 11:27:36 +00:00
Bruce Mitchener 17d2730ee0 Start to share SWIG interface files between languages.
Summary:
Move scripts/Python/interface to scripts/interface so that we
can start making iterative improvements towards sharing the
interface files between multiple languages (each of which would
have their own directory as now).

Test Plan: Build and see.

Reviewers: zturner, emaste, clayborg

Reviewed By: clayborg

Subscribers: mjsabby, lldb-commits

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

llvm-svn: 235676
2015-04-24 00:38:53 +00:00
Chaoren Lin 82c6a40ba6 Fix build.
llvm-svn: 235653
2015-04-23 22:19:29 +00:00
Adrian McCarthy 2304b6ff44 Factor resolution of abbreviations and aliases so that they can be tested directly. http://reviews.llvm.org/D9033
llvm-svn: 235633
2015-04-23 20:00:25 +00:00
Richard Smith 6d48859b18 Fix build of lldb after clang r235614.
llvm-svn: 235631
2015-04-23 19:36:34 +00:00
Chaoren Lin 9cf4f2c2d8 Fix TestFdLeak on Linux.
Summary:
LLGS leaks pipes (when launched by lldb), sockets (when launched by platform),
and/or log file to the inferior. This should prevent all possible leaks.

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 235615
2015-04-23 18:28:04 +00:00
Aidan Dodds 5372c72a42 Replace use of %zu with PRIu64 in DYDL logging message.
llvm-svn: 235598
2015-04-23 13:57:30 +00:00
Ilia K 3b0494c304 MI fix allowing multiple logging instances of lldb-mi to run simultaneously.
Summary:
Currently if two instances of lldb-mi are running with logging enabled using '--log' the log file conflicts. This produces the following error 
MI: Error: File Handler. Error Permission denied opening 'C:\Users\Ewan\LLVM\build\Debug\bin\lldb-mi-log.txt'

Fixed in this patch by renaming lldb-mi-log.txt based on the date, e.g. lldb-mi-log.txt-20150316163631.log, and moving the file into the temp directory by using the --log-dir option.

Regrading previous review comments the P_tmpdir macro is defined in Windows but always points to "\", which doesn't help much. Also when using the Windows API for GetTempPath() dynamic memory seems much more messy.

Patch from ewan@codeplay.com

Reviewers: abidh, EwanCrawford

Subscribers: zturner, lldb-commits, deepak2427

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

llvm-svn: 235589
2015-04-23 12:48:42 +00:00
Tamas Berghammer 10c7d300bc Update cpsr register in BLX instruction emulation
Write the new cpsr value into the cpsr register if the BL or the BLX
instruction change the instruction set on arm.

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

llvm-svn: 235585
2015-04-23 10:56:51 +00:00
Tamas Berghammer f959520efc Fix test expectation in TestNoreturnUnwind
The test case lookinhg for the abort function in the stack trace.
Previously it lookd for a function which ends with "abort" but on some
system there are multiple such functions (e.g.: on android abort calls
__libc_android_abort) what made the test fail. This CL change the
behaviour to look for the abort function based on a fix list of names.

llvm-svn: 235584
2015-04-23 10:54:27 +00:00
Pavel Labath 5fd24c673e [NativeProcessLinux] Fix race condition during inferior thread creation
The following situation occured if we were stopping a process (due to breakpoint, watchpoint, ...
hit) while a new thread was being created.
- process has two threads: A and B.
- thread A hits a breakpoint: we send a STOP signal to thread B and register a callback with
  ThreadStateCoordinator to send a stop notification after the thread stops.
- thread B stops, but not due to the SIGSTOP, but on a thread creation event (of a new thread C).
  We are unaware of our desire to stop, so we queue ThreadStopped and RequestResume operations
  with TSC, so the thread can continue running.
- TSC receives the ThreadStopped event, sees that all threads are stopped and fires the delayed
  stop notification.
- immediately after that TSC gets the RequestResume operation, so it resumes the thread.

At this point the state is inconsistent because LLDB thinks the process is stopped and will start
issuing commands to it, but one of the threads is in fact running. Things eventually break.

I address this problem by omitting the two TSC events altogether and Resuming the thread B
directly. This way the short stop is invisible to the TSC and the delayed notification will not
fire. We will fire the notification when we actually process the SIGSTOP on thread B.

When we get the initial SIGSTOP for thread C, we also resume the thread and send a
ThreadWasCreated message (is_stopped = false) to the TSC. This way, the TSC can stop the thread
on its own and handle the stop event later. This way the state of the new thread is correctly
handled as well (thanks Chaoren for the idea).

This patch also removes the synchronisation between the thread creation notifications on threads
B and C. The need for this synchronisation is unclear (the comments seem to hint that the new
thread is "fully created" only after we process both events, but I have noticed no regressions in
treating it as "created" even after just processing the initial C event), but it is a source for
many kinds of obscure races, since it introduces a new thread state "Launching" and the rest of
the code does not handle this state at all (what happens if we get a resume request from LLDB
while this thread is launching? what happens if we get a stop request? etc.).

This fixes the "spurious $O packet" problem in TestPrintStackTraces.py. However, the test remains
disabled on i386 due to the VDSO issue.

Test Plan:
TestPrintStackTraces works on x86_64. No regressions in the rest of the test suite.

Reviewers: vharron, chaoren

Subscribers: lldb-commits

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

llvm-svn: 235579
2015-04-23 09:04:35 +00:00
Mohit K. Bhakkad e8659b5df6 [LLDB][MIPS] Add MIPS32 and MIPS64 core revisions
Patch by Jaydeep Patil

Added MIPS32 and MIPS64 core revisions. This would be followed by register context and emulate-instruction for MIPS32.

DYLDRendezvous.cpp:
On Linux link map struct does not contain extra load offset field.

Reviewers: clayborg
Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D9190

llvm-svn: 235574
2015-04-23 06:36:20 +00:00
Jim Ingham 46e9f9df15 Missed one piece when committing r235538.
llvm-svn: 235564
2015-04-23 00:28:25 +00:00
Zachary Turner 0405d68bb4 Use the debugginess of the python interpreter when symlinking _lldb.pyd.
Previously we would pass an argument to finishSwigWrapperClasses.py which
specified whether this was a debug or a release build.  But sometimes
CMAKE_BUILD_TYPE would not be set to anything, causing this argument
to be empty when passed in.  The only purpose of this argument was to
determine whether or not to append _d to the extension module when
creating the symlink.  This is only necessary when doing a debug
build of LLDB on Windows, which implies a debug interpreter, so we
replace this with a check to see if the running interpreter is a debug
one, and append _d if so.

llvm-svn: 235559
2015-04-22 22:53:18 +00:00
Jim Ingham a72b31c79e This is some groundwork for filtering the language Exception
breakpoints, for instance on the class of the thrown object.

This change doesn't actually make that work, the part where we
extract the thrown object type from the throw site isn't done yet.

This provides a general programmatic "precondition" that you can add
to breakpoints to give them the ability to do filtering on the LLDB
side before we pass the stop on to the user-provided conditions & 
callbacks.

llvm-svn: 235538
2015-04-22 19:42:18 +00:00
Jim Ingham 5b4c5ebfe0 Formatting fix.
llvm-svn: 235527
2015-04-22 17:48:24 +00:00
Ed Maste 5ff2140527 Add decorator for signal test failing on FreeBSD
llvm.org/pr23318

llvm-svn: 235523
2015-04-22 17:06:48 +00:00
Ilia K 5a931869d4 MI Refactor CMIUtilSystemWindows::GetExecutablesPath()
Summary:
My understanding of the Windows API call GetLastError() is that it should only be checked when ::GetModuleFileName()  returns 0 on error.
Otherwise GetExecutablesPath() could return an error despite nLen being valid if GetLastError() was inconsistent.
Patch updates function to only call GetOSLastError() when nLen == 0

Patch from ewan@codeplay.com

Reviewers: EwanCrawford

Subscribers: lldb-commits, deepak2427

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

llvm-svn: 235515
2015-04-22 15:43:43 +00:00
Ed Maste 6078597370 Skip additional lldb-mi tests that failed on FreeBSD
llvm-svn: 235510
2015-04-22 14:55:34 +00:00
Pavel Labath c32e04d82c XFAILing a single test in TestConcurrentEvents
apparently, TestConcurrentEvents is still not fixed. One test has failed on Linux i386 build.
Will disable the failing test on i386 for now, and see how it goes..

llvm-svn: 235504
2015-04-22 13:20:03 +00:00
Pavel Labath 5c3c43afc1 Enable TestConcurrentEvents on Linux
After the latest changes in NativeProcessLinux, these tests should be stable now. Please revert
(and let me know) if any issue crops up.

llvm-svn: 235502
2015-04-22 12:21:06 +00:00
Tamas Berghammer e7708688ba Fix signle stepping on arm when multiple thread is involved
On linux-arm we use software single stepping where setting the new
breakpoint is only possible while the process is in stopped state.
This CL moves the setup code for single stepping form the SigneStep
operation into the Resum method to avoid an error when the process
already started when we want to step one of the thread.

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

llvm-svn: 235494
2015-04-22 10:00:23 +00:00
Pavel Labath 701db36744 [DWARF CFI] Add support for DW_CFA_def_cfa_sf when parsing CIE
Summary: Just what it says on the box.

Reviewers: jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 235493
2015-04-22 09:47:21 +00:00
Chaoren Lin 6598431c7a Same issue as in D8685 but for i386.
llvm-svn: 235454
2015-04-21 23:00:58 +00:00
Enrico Granata e3476572f3 Add properties to SBExecutionContext to access the several entities it stores in a more Pythonic fashion
llvm-svn: 235447
2015-04-21 22:09:12 +00:00
Davide Italiano 327fda84d9 Placate clang. lldb can build on FreeBSD with -Werror again.
llvm-svn: 235387
2015-04-21 16:06:17 +00:00
Ying Chen 7091c2ca3f XFAIL tests that are failed on linux with gcc-4.9.2
Summary:
- add decorator functions to xfail and skip test on specific os, architecture and version of comipler
- xfail failing test with gcc-4.9.2 on linux
- add one usage of skipIf function

Test Plan:
Run tests with different archs, and version of compilers to verify decorator function working as expected
Run tests with gcc-4.9.2 and no failure reported

Reviewers: sivachandra, ovyalov, vharron, chaoren

Subscribers: lldb-commits

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

llvm-svn: 235368
2015-04-21 01:15:47 +00:00
Ying Chen 1ff46f2060 Add Makefile for typedef_array
-Makefile was deleted by r235313 causing test failure of TestTypedefArray.py, add it back

Summary: -Makefile was deleted by r235313 causing test failure of TestTypedefArray.py, add it back

Test Plan: Run lldb test locally with change, TestTypedefArray.py passed and no regression observed.

Reviewers: chaoren, sivachandra, vharron

Subscribers: lldb-commits

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

llvm-svn: 235346
2015-04-20 20:34:31 +00:00