Commit Graph

10998 Commits

Author SHA1 Message Date
Ilia K e771b59017 Fix/Add comments in CMICmdCmdGdbSet (MI)
llvm-svn: 233017
2015-03-23 20:46:10 +00:00
Stephane Sezer 5a1774da7c Initialize ObjC runtime at the right location.
Summary:
Saw this while reading some code in DynamicLoader classes. Looks like this has
been a FIXME since 2011 at least.

Test Plan: Run unit tests.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 232983
2015-03-23 18:36:54 +00:00
Stephane Sezer 019b031c5c Add a missing null pointer check in CommandObjectThread.cpp.
Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 232979
2015-03-23 18:15:07 +00:00
Zachary Turner 5028e33e54 Rely on Makefile.rules in lldb/test/driver/batch_mode.
This was hardcoding some make rules instead of relying on
Makefile.rules, which was causing some of the logic to be
incorrect for Windows.

Patch by: Adrian McCarthy
Differential Revision: http://reviews.llvm.org/D8363

llvm-svn: 232974
2015-03-23 18:00:07 +00:00
Ed Maste a6a53d1131 Remove non-standard Environment header section
llvm-svn: 232973
2015-03-23 17:57:42 +00:00
Ed Maste 4c276fb4cc Use .so library extension by default if platform is not Windows or Darwin
llvm-svn: 232970
2015-03-23 17:52:38 +00:00
Ed Maste 9956670a0e Fix whitespace in finishSwigWrapperClasses.py
- replace hard tabs with 4-space indents
- delete EOL whitespace

llvm-svn: 232969
2015-03-23 17:52:10 +00:00
Stephane Sezer acd80d80dd Do not assert on POSIXDYLD double-eAdd.
Summary:
This has been discovered while experimenting with the gecko linker on android.
In general, assert()'ing on "user input" is a bad idea.

Test Plan: Run unit tests.

Reviewers: clayborg, tfiala

Subscribers: lldb-commits

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

llvm-svn: 232966
2015-03-23 17:05:41 +00:00
Tamas Berghammer 9bacf0ff1a Shorten executable name in WatchpointLLDBCommandTestCase
It is required because the name of the executable exceeded the maximum
allowed file name on android.

llvm-svn: 232959
2015-03-23 16:17:47 +00:00
Tamas Berghammer 30b8cd331e Remove virtual and add override to all virtual functions in Process/gdb-remote.
llvm-svn: 232952
2015-03-23 15:50:03 +00:00
Ilia K e7d19c38d9 Fix ObjCDataFormatterTestCase.test_nsdate_* tests (ver. 2)
This commit reverts r232946 because it caused an another error with absolute time.

llvm-svn: 232951
2015-03-23 14:22:27 +00:00
Ilia K fc90b43cea Convert CRLF to LF in CODE_OWNERS.txt
llvm-svn: 232950
2015-03-23 14:00:54 +00:00
Ilia K 005bc81842 Fix ObjCDataFormatterTestCase.test_nsdate_* tests
The time/date strings (like "6pm April 10, 1985") are interpreted as a local time but CFDateGetAbsoluteTime() returns time in UTC. It caused a problem when local time was UTC+0100 or more (0200, 0300 etc.):
```
======================================================================
FAIL: test_nsdate_with_dsym_and_run_command (TestDataFormatterObjC.ObjCDataFormatterTestCase)
    Test formatters for NSDate.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 462, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py", line 157, in test_nsdate_with_dsym_and_run_command
    self.appkit_tester_impl(self.buildDsym,self.nsdate_data_formatter_commands)
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py", line 34, in appkit_tester_impl
    commands()
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py", line 475, in nsdate_data_formatter_commands
    substrs = ['1985-04','2011-01'])
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 2146, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : '2011-01' returns expected result
Config=x86_64-clang
======================================================================
FAIL: test_nsdate_with_dwarf_and_run_command (TestDataFormatterObjC.ObjCDataFormatterTestCase)
    Test formatters for NSDate.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 479, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py", line 163, in test_nsdate_with_dwarf_and_run_command
    self.appkit_tester_impl(self.buildDwarf,self.nsdate_data_formatter_commands)
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py", line 34, in appkit_tester_impl
    commands()
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py", line 475, in nsdate_data_formatter_commands
    substrs = ['1985-04','2011-01'])
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 2146, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : '2011-01' returns expected result
Config=x86_64-clang
```

llvm-svn: 232946
2015-03-23 12:44:54 +00:00
Davide Italiano cd9f7b84bb Use POSIX pid_t and not lldb::pid_t.
The latter is uint64_t beacuse lldb supports arbitrary pid/platforms
but in this case we're using it as return value for fork() which might
return -1 to the parent in case the syscall fails. 

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

llvm-svn: 232926
2015-03-22 23:43:58 +00:00
Richard Smith 7572caf485 Add missing #include to fix libc++ Linux build.
llvm-svn: 232925
2015-03-22 23:18:46 +00:00
Vince Harron 62fa2732b9 Reverted r232883 due to failing tests.
llvm-svn: 232904
2015-03-22 05:47:00 +00:00
Ilia K f9e5dc16b1 Compare pointers directly instead of ::strcmp in SBXxx::EventIsXxxEvent()
llvm-svn: 232892
2015-03-21 11:11:07 +00:00
Ilia K af10e1ce6f Fix handling of CommandInterpreter's events in lldb-mi
Summary:
Previously lldb-mi contains a stub for that but it didn't work and all CommanInterpreter's events were ignored.
This commit adds a handling of CommandInterpreter's events in lldb-mi.

Steps:
# Fix CMICmnLLDBDebugger::InitSBListener
# Add SBCommandInterpreter::EventIsCommandInterpreterEvent
# Exit on lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived

All tests pass on OS X.

In further we can remove "quit" hack in lldb-mi.

Test Plan:
# Create start_script file:
```
target create ~/p/hello
b main
r
quit
```

# Run lldb-mi --interpreter
# Execute start_script file by following command:
```
-interpreter-exec console "command source start_script"
```

Log:
```
$ bin/lldb-mi --interpreter
(gdb)
-interpreter-exec console "command source start_script"
Executing commands in '/Users/IliaK/p/llvm/build_ninja/start_script'.
(lldb) target create ~/p/hello
Current executable set to '~/p/hello' (x86_64).
(lldb) b main
Breakpoint 1: where = hello`main + 29 at hello.cpp:12, address = 0x0000000100000e2d
(lldb) r
Process 1582 launched: '/Users/IliaK/p/hello' (x86_64)
(lldb) quit
^done
(gdb)
=thread-created,id="1",group-id="i1"
=thread-selected,id="1"
(gdb)
=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"]
...
=shlibs-added,shlib-info=[num="132",name="libDiagnosticMessagesClient.dylib",dyld-addr="0x7fff91705000",reason="dyld",path="/usr/lib/libDiagnosticMessagesClient.dylib",loaded_addr="0x7fff91705000"]
(gdb)
*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x100000e2d",func="main",args=[{name="argc",value="1"},{name="argv",value="0x00007fff5fbffc88"}],file="hello.cpp",fullname="/Users/IliaK/p/hello.cpp",line="12"},thread-id="1",stopped-threads="all"
(gdb)<press Enter>



MI: Program exited OK
```

Reviewers: abidh, clayborg

Reviewed By: abidh

Subscribers: jingham, lldb-commits, clayborg, abidh

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

llvm-svn: 232891
2015-03-21 10:53:37 +00:00
Chaoren Lin 0a6ce26c38 Fix ComputeSupportExeDirectory for Linux (merge with Android).
Summary:
ComputeSupportExeDirectory relied on ComputeSharedLibraryDirectory which was
not always reliable. Using procfs seems to be the best way to deal with it on
Linux (since it's already done on Android, might as well merge it).

Reviewers: ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 232883
2015-03-21 03:59:29 +00:00
Ed Maste b933fb2c0b Avoid output on successful execution of the SWIG scripts
Standard practice for tools like this upon success is no output and a
zero return value.

llvm-svn: 232841
2015-03-20 19:59:35 +00:00
Ed Maste ae9d841c89 Fixup whitespace in finishSwigWrapperClasses.py
- replace hard tabs with 4-space indents
- delete EOL whitespace

llvm-svn: 232840
2015-03-20 19:53:49 +00:00
Zachary Turner be30a6524f Try to fix configure/make build.
llvm-svn: 232823
2015-03-20 16:23:40 +00:00
Pavel Labath 12fd375629 Add missing cases to NativeProcessLinux LogThreadStopInfo
Test Plan: No tests, this is just a debug logging function.

Reviewers: tberghammer

Subscribers: lldb-commits

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

llvm-svn: 232815
2015-03-20 14:45:13 +00:00
Pavel Labath 98236e0510 Fix ninja check-lldb
Ninja apparently has issues with commands writing nul characters '\0' to stdout. When it
encounters a nul character, the rest of the output is skipped (I will file a bug with ninja about
that). This breaks the linux buildbot since it parses the ninja check-lldb output to get a list
of failures.

Recently, we have started outputting nul characters in lldb-server tests. This is probably
a bug in itself, but I am not addressing that now. This is just a workaround commit, which
prevents the nul characters from appearing in the output, and gets the buildbot operational again.

llvm-svn: 232805
2015-03-20 11:24:36 +00:00
Pavel Labath 8ac06996bf Support for truncate/append on log files
Summary:
Presently, if a log file already exists, lldb simply starts overwriting bits of it, without
truncating or anything. This patch makes it use eFileOptionFileTruncate by default. It also adds
an --append option, which will append to the file without truncating. A test is included.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 232801
2015-03-20 09:43:20 +00:00
Chaoren Lin c16f5dca27 Report watchpoint hits during single stepping.
Summary:
Reorganized NativeProcessLinux::MonitorSIGTRAP to check for watchpoint hits on
TRAP_TRACE.

Added test for stepping over watchpoints.

https://llvm.org/bugs/show_bug.cgi?id=22814

Reviewers: ovyalov, tberghammer, vharron, clayborg

Subscribers: jingham, labath, lldb-commits

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

llvm-svn: 232784
2015-03-19 23:28:10 +00:00
Zachary Turner 3a00691f3d Move LLDB initialization/shutdown to Initialization.
This creates a new top-level folder called Initialization which
is intended to hold code specific to LLDB system initialization.
Currently this holds the Initialize() and Terminate() functions,
as well as the fatal error handler.

This provides a means to break the massive dependency cycle which
is caused by the fact that Debugger depends on Initialize and
Terminate which then depends on the entire LLDB project.  With
this structure, it will be possible for applications to invoke
lldb_private::Initialize() directly, and have that invoke
Debugger::Initialize.

llvm-svn: 232768
2015-03-19 22:00:21 +00:00
Chaoren Lin 0efb51a072 Fix SBFrame::FindValue for when only global variables exist.
Summary:
sc.block->AppendVariables(...) returns 0 if there are no arguments or local
variables, but we still need to check for global variables.

Test Plan:
```
$ cat test.cpp
int i;
int main() {
}
$ lldb test -o 'b main' -o r
(lldb) script
>>> print lldb.frame.FindValue('i', lldb.eValueTypeVariableGlobal)
(int) i = 0 # as opposed to "No value"
```

Reviewers: jingham, ovyalov, vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 232767
2015-03-19 22:00:13 +00:00
Artem Belevich 52210aee10 Added missing case for IK_PreprocessedCuda.
llvm-svn: 232741
2015-03-19 18:12:26 +00:00
Ilia K bb7002d751 Remove IDE_MI_APP_EXIT_OK msg on exit (MI)
Summary: Remove IDE_MI_APP_EXIT_OK msg on exit (MI)

Reviewers: abidh

Reviewed By: abidh

Subscribers: lldb-commits, abidh

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

llvm-svn: 232738
2015-03-19 17:40:15 +00:00
Ilia K 7690fc5428 expose 64 bit addresses through MI
Summary:
This changes all reporting of addresses from lldb-mi to be 64 bit capable. There could have been cases where a 64 bit address was getting truncated to 32 bit format.

Patch from chuckr@microsoft.com

Reviewers: abidh, ChuckR

Reviewed By: abidh

Subscribers: paulmaybee, ki.stfu, zturner, lldb-commits

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

llvm-svn: 232736
2015-03-19 17:27:23 +00:00
Ilia K 4c5a0b40de Fix memory allocating inside signal handler (MI)
Summary:
This patch fixes a memory allocating inside signal handler.

This bug was found by @vharron:
> Hi all,
> 
> I noticed these thread sanitizer warnings while running lldb-mi tests on
> Linux.
> 
> WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=39721)
> 
>     #0 operator new(unsigned long) <null>:0 (lldb-mi-3.7.0+0x000000092b9d)
> 
>     #1 std::string::_Rep::_S_create(unsigned long, unsigned long,
> std::allocator<char> const&) <null>:0 (libstdc++.so.6+0x0000000ba3b8)
> 
>     #2 CMICmnResources::GetStringFromResource(unsigned int, CMIUtilString&)
> const
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MICmnResources.cpp:434
> (lldb-mi-3.7.0+0x00000014ddd8)
> 
>     #3 CMICmnResources::GetString(unsigned int) const
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MICmnResources.cpp:371
> (lldb-mi-3.7.0+0x00000014db81)
> 
>     #4 sigwinch_handler(int)
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MIDriverMain.cpp:99
> (lldb-mi-3.7.0+0x0000001589ff)
> 
>     #5 __tsan::CallUserSignalHandler(__tsan::ThreadState*, bool, bool, int,
> my_siginfo_t*, void*) tsan_interceptors.o:0 (lldb-mi-3.7.0+0x00000009f25f)
> 
>     #6 void std::this_thread::sleep_for<long, std::ratio<1l, 1000l>
> >(std::chrono::duration<long, std::ratio<1l, 1000l> > const&)
> /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/thread:279
> (lldb-mi-3.7.0+0x00000013243e)
> 
>     #7 CMIDriver::ReadStdinLineQueue()
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MIDriver.cpp:710
> (lldb-mi-3.7.0+0x000000155e62)
> 
>     #8 CMIDriver::DoMainLoop()
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MIDriver.cpp:631
> (lldb-mi-3.7.0+0x000000155d37)
> 
>     #9 non-virtual thunk to CMIDriver::DoMainLoop()
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MIDriver.cpp:648
> (lldb-mi-3.7.0+0x000000155fbd)
> 
>     #10 CMIDriverMgr::DriverMainLoop()
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MIDriverMgr.cpp:340
> (lldb-mi-3.7.0+0x000000159ee6)
> 
>     #11 main
> /usr/local/google/home/vharron/ll/tot/llvm/tools/lldb/tools/lldb-mi/MIDriverMain.cpp:364
> (lldb-mi-3.7.0+0x000000158f60)

Reviewers: vharron, abidh

Reviewed By: abidh

Subscribers: lldb-commits, abidh, vharron

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

llvm-svn: 232735
2015-03-19 17:17:26 +00:00
Ilia K 641f027d82 Fix -break-insert for system functions (MI)
Summary:
# Fix -break-insert for system functions
# Fix MiExecTestCase to use -break-insert instead of CLI "b"
# Improve MiBreakTestCase: now it uses printf() instead of in-house function

All tests pass on OS X.

Test Plan:
```
$ bin/lldb-mi --interpreter
(gdb)
-file-exec-and-symbols ~/p/hello
^done
(gdb)
=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"]
-break-insert -f printf
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0xffffffff",func="??",file="??",fullname="??/??",line="0",pending=["printf"],times="0",original-location="printf"}
(gdb)
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0xffffffff",func="??",file="??",fullname="??/??",line="0",pending=["printf"],times="0",original-location="printf"}
-exec-run
^running
...
*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x7fff8a476910",func="printf",args=[],file="??",fullname="??",line="-1"},thread-id="1",stopped-threads="all"
(gdb)
```

Reviewers: abidh, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, abidh

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

llvm-svn: 232734
2015-03-19 17:13:20 +00:00
Tamas Berghammer 00bdca6839 Don't close pseudo terminal master file descriptor on EOF
Some application on Linux an all application on android close stdout and
stderr during the libc exit stage. Previously the master file descriptor
of the pseudo terminal used to communicate with the inferior was closed
on an EOF causing a race condition and a possible SIGHUP on process
exit. After this change the master file descriptor will be closed by the
destructor of the GDBRemoteCommunicationServerLLGS class.

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

llvm-svn: 232724
2015-03-19 14:58:36 +00:00
Ilia K aa27aadb14 Fix double (gdb) prompt when command doesn't exist
llvm-svn: 232715
2015-03-19 09:17:06 +00:00
Ilia K 30a4ba1721 Fix error handling in CMIDriver::DoMainLoop after r215223 (MI)
llvm-svn: 232713
2015-03-19 08:54:17 +00:00
Ed Maste 0ddc6160ec Add NameMatches.h header to fix FreeBSD build after r232673
llvm-svn: 232702
2015-03-19 02:47:36 +00:00
Jim Ingham 4bd65b9f71 Comment discouraging writing command based test cases.
llvm-svn: 232689
2015-03-18 23:16:58 +00:00
Siva Chandra a996bff82e Enable TestCallStdStringFunction for GCC.
Test Plan: dotest.py -C gcc -p TestCallStdStringFunction

Reviewers: vharron

Subscribers: lldb-commits

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

llvm-svn: 232687
2015-03-18 23:02:28 +00:00
Siva Chandra 05fd66d2f8 Cleanup to simplify the formatter for std::map of libstdc++.
Summary:
GCC does not emit some DWARF required for the simplified formatter
to work. A workaround for it has been incorporated in the formatter.
The corresponding test TestDataFormatterStdMap has also been enabled
for GCC.

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

Reviewers: clayborg, vharron, granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 232678
2015-03-18 22:01:45 +00:00
Zachary Turner 5023257f23 Move some functions from source/lldb.cpp to Utility.
Specifically, there were some functions for converting enums
to strings and a function for matching a string using a specific
matching algorithm.  This moves those functions to more appropriate
headers in lldb/Utility and updates references to include the
new headers.

llvm-svn: 232673
2015-03-18 21:31:45 +00:00
Zachary Turner 71536d930d Try to fix the Makefile build.
I deleted lldb-log.cpp, but the Makefile build lists this file
explicitly, so it is removed in this patch.

llvm-svn: 232669
2015-03-18 20:58:39 +00:00
Greg Clayton 1adf3ac460 Don't load register data from memory.
llvm-svn: 232668
2015-03-18 20:45:28 +00:00
Enrico Granata c457132ede Fix the Xcode build after the MIPS64 changes
llvm-svn: 232655
2015-03-18 18:42:41 +00:00
Zachary Turner 3294de270e Move lldb-log.cpp to core/Logging.cpp
So that we don't have to update every single #include in the entire
codebase to #include this new header (which used to get included by
lldb-private-log.h, we automatically #include "Logging.h" from
within "Log.h".

llvm-svn: 232653
2015-03-18 18:20:42 +00:00
Greg Clayton 833d798b0e Always add some fake threads with x86_64 registers no matter what the architecture since this is just for testing that we can add new threads with completely different registers contexts to a process.
llvm-svn: 232649
2015-03-18 17:03:13 +00:00
Zachary Turner 799770c03a Fix linking of unit tests via CMake on Windows.
A previous attempt to make the unit tests link properly on
Linux broke it for Windows.  This patch fixes it for both platforms.

llvm-svn: 232648
2015-03-18 16:56:24 +00:00
Ed Maste 2001d1040f Skip intermittently failing test on FreeBSD
It is already skipped on the other platforms anyhow.

llvm.org/pr19246

llvm-svn: 232640
2015-03-18 15:23:53 +00:00
Robert Flack ebc5609087 Convert open options for POSIX open on target platform.
This moves the conversion of the open options to the target platform. On mac fcntl.h has different values for O_CREAT and O_TRUNC than on linux so by transmitting the standardized lldb open options we can correctly convert them on the target platform.

Test Plan:
On linux:
  lldb-server p --listen *:1234
On mac:
  lldb
  platform select remote-linux
  platform connect connect://ip-of-linux-box:1234
  target create ~/path/to/linux/binary
  b main
  process launch
Binary is successfully pushed to linux remote, process successfully launches and break in the main method.

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

llvm-svn: 232634
2015-03-18 13:55:48 +00:00
Ilia K 5d8b145d70 Fix comment in tools/lldb-mi/MIDriver.cpp
llvm-svn: 232633
2015-03-18 13:08:52 +00:00
Tamas Berghammer db037d9c49 Parse .note.android.ident header from elf files
In android a .note.android.ident section header is added to the elf
files to provide information for the debuggers that it is an android
specific module. This CL add logic to parse it out from the elf files
and set the module specification based on it.

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

llvm-svn: 232625
2015-03-18 10:36:27 +00:00
Hafiz Abid Qadeer 4a7baeab14 Make lldb-mi handle only MI commands
Summary:
Previously lldb-mi can also act as a driver like normal lldb. It needed a lot
of redundant code in the lldb-mi for that. I think that if a user wants command
line lldb driver then he/she should use the lldb for it. This change will cleanup
the code a lot. When this change goes in, it will allow us to remove some more
redundant code too.

All tests pass on Linux. Did some sanity testing on command line and with eclipse.

Reviewers: ki.stfu

Reviewed By: ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 232621
2015-03-18 10:07:46 +00:00
Pavel Labath 61984d39d5 Fix a typo in EmulateInstructioinMIPS64
llvm-svn: 232620
2015-03-18 09:57:10 +00:00
Bhushan D. Attarde 29e5937cd9 Initial Assembly profiler for mips64
Summary:
This is initial implementation of assembly profiler which only scans prologue/epilogue assembly instructions to create CFI instructions.

Reviewers: clayborg, jasonmolenda

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

llvm-svn: 232619
2015-03-18 09:21:29 +00:00
Ilia K 41c56755be Clean up CommandObjectBreakpointNameList: remove duplicated 'protected' access modifier
llvm-svn: 232618
2015-03-18 09:14:49 +00:00
Jason Molenda 1bffc64a46 Build fix for building debugserver for ios.
llvm-svn: 232563
2015-03-17 23:16:42 +00:00
Zachary Turner 85bc48ca74 Convert CRLF to LF.
I accidentally let some Windows line endings slip in.  This is a
good reminder for me to use core.eol=lf.

llvm-svn: 232560
2015-03-17 22:51:21 +00:00
Siva Chandra 7523ec4f47 Enable TestDataFormatterStdIterator with GCC.
Summary:
This test now passes for Clang and GCC. I do not know why it was
disabled for GCC with link to a bug which should not have had an
effect on this test.

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

Reviewers: vharron

Subscribers: lldb-commits

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

llvm-svn: 232552
2015-03-17 21:43:01 +00:00
Siva Chandra 8d88d08197 Implement formatter for std::vector<bool, ...> of libstdc++ in Python.
Summary:
The existing formatter in C++ has been removed as it was not being used. 
The associated test TestDataFormatterStdVBool.py has been enabled for
both Clang and GCC on Linux.

Test Plan: dotest.py -p TestDataFormatterStdVBool

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 232548
2015-03-17 21:23:17 +00:00
Zachary Turner 0641ca1a2d Remove ScriptInterpreterObject.
This removes ScriptInterpreterObject from the codebase completely.
Places that used to rely on ScriptInterpreterObject now use
StructuredData::Object and its derived classes.  To support this,
a new type of StructuredData object is introduced, called
StructuredData::Generic, which stores a void*.  Internally within
the python library, StructuredPythonObject subclasses this
StructuredData::Generic class so that it can addref and decref
the python object on construction and destruction.

Additionally, all of the classes in PythonDataObjects.h such
as PythonList, PythonDictionary, etc now provide a method to
create an instance of the corresponding StructuredData type.  For
example, there is PythonDictionary::CreateStructuredDictionary.
To eliminate dependencies on PythonDataObjects for external
callers, all ScriptInterpreter methods now return only
StructuredData classes

The rest of the changes in this CL are focused on fixing up
users of PythonDataObjects classes to use the new StructuredData
classes.

llvm-svn: 232534
2015-03-17 20:04:04 +00:00
David Blaikie 5121c9aa92 Fix the clang -Werror build by suppressing -Wextended-offsetof
llvm-svn: 232507
2015-03-17 17:37:17 +00:00
David Blaikie 7d3cf0062a Add missing overrides to fix the clang -Werror build (-Winconsistent-missing-override)
llvm-svn: 232504
2015-03-17 17:26:41 +00:00
Ilia K 8a00a562c5 Fix broadcasters for interpreter and process:
# Fix CommandInterpreter.Broadcaster name (it should be the same as CommandInterpreter::GetStaticBroadcasterClass())
# Prevent the same error in Process.Broadcaster
# Fix SBCommandInterpreter::GetBroadcasterClass (it should call CommandInterpreter::GetStaticBroadcasterClass(), was Communication::GetStaticBroadcasterClass())

llvm-svn: 232500
2015-03-17 16:54:52 +00:00
Tamas Berghammer cb84eebb52 Change reinterpret_casts to static_casts in NativeProcessLinux
llvm-svn: 232491
2015-03-17 15:05:31 +00:00
Tamas Berghammer c7e6680637 Remove obsolate rdar comment from TestSetValues.py
llvm-svn: 232490
2015-03-17 15:05:28 +00:00
Tamas Berghammer 9f3658d211 Fix signature of ProcessInfo::SetArchitecture
llvm-svn: 232489
2015-03-17 15:05:25 +00:00
Tamas Berghammer 655b87f99d Remove unused handler registreation from GDBRemoteCommunicationServerLLGS
llvm-svn: 232488
2015-03-17 15:05:23 +00:00
Tamas Berghammer eadb2a9ed0 Report stopped by trace if none of the watchpoint was hit
Some linux kernel reports a watchpoint hit after single stepping even
when no watchpoint was hit. This CL looks for a watchpoint which was hit
and reports a stop by trace if it haven't found any.

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

llvm-svn: 232482
2015-03-17 14:40:57 +00:00
Hafiz Abid Qadeer 7658b2be16 Cleanup the MIReadMe.txt after the recent changes in lldb-mi.
This commit removed the redundant and out of date stuff from the file.

llvm-svn: 232477
2015-03-17 14:12:03 +00:00
Mohit K. Bhakkad 3df471c32d [MIPS] - Register Context for MIPS64
Patch by Jaydeep Patil

Summery:
1. Add MIPS variants by parsing e_flags of the ELF
2. Create RegisterInfoInterface and RegisterContext for MIPS64 and MIPS64EL

Reviewers: clayborg

Subscribers: tberghammer, bhushan, mohit.bhakkad, sagar

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

llvm-svn: 232467
2015-03-17 11:43:56 +00:00
David Blaikie 3dfb86b641 Fix the clang -Werror build & make the unit tests link under Linux
The order of libraries passed to the linker didn't work under linux (you
need the llvm libraries first, then the lldb libraries). I modelled this
after clang's setup here. Seemed simple enough to just be consistent.

llvm-svn: 232461
2015-03-17 03:32:21 +00:00
Vince Harron de0a0f3100 XFAIL flaky tests
llvm-svn: 232441
2015-03-17 00:10:51 +00:00
Oleksiy Vyalov 933f853030 Make ModuleList::GetSharedModule to use module_search_paths parameter.
http://reviews.llvm.org/D8365

llvm-svn: 232437
2015-03-16 23:44:30 +00:00
Siva Chandra 3b36038f45 Cleanup implementation of formatter for std::vector from libstdc++.
Summary: Removed unused variables and methods.

Test Plan: dotest.py -p TestDataFormatterStdVector

Reviewers: vharron

Subscribers: lldb-commits

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

llvm-svn: 232434
2015-03-16 23:02:03 +00:00
Jim Ingham 6312991cdb Report an error for line number values that don't convert to integers during argument
parsing so that we can give a more accurate error message.

<rdar://problem/20145563>

llvm-svn: 232433
2015-03-16 22:47:38 +00:00
Siva Chandra 588ec02f19 Enable TestDataFormatterStdMap on linux (libstdc++) with clang.
Summary:
This test should have been enabled along with
7181dae1248cc1b03505cca1b7c6e3dfeffefc0a, but since the test was
actually crashing, I thought it was a much deeper problem. Turns out,
all I had to do was to add "-fno-limit-debug-info" when compiling
the test case.

The test is still skipped when the testcase is compiled with GCC.

Test Plan: dotest.py -p TestDataFormatterStdMap

Reviewers: vharron

Subscribers: lldb-commits

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

llvm-svn: 232432
2015-03-16 22:45:05 +00:00
Siva Chandra 4da7a29a11 Skip TestDataFormatterStdMap on linux instead of xfailing.
Summary:
After 7181dae1248cc1b03505cca1b7c6e3dfeffefc0a, this test progresses
much further but crashes. Will skip this test while I fix this properly.

Test Plan: dotest.py -p TestDataFormatterStdMap

Reviewers: vharron

Subscribers: lldb-commits

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

llvm-svn: 232403
2015-03-16 19:56:36 +00:00
Greg Clayton 75a19344ad Added an Python operating system plug-in test to verify that python can be used to add threads to an existing process.
The test does the following:
1 - runs a program to main without the OS plug-in and verifies no OS threads are in the process
2 - loads the OS plug-in and verifies the 3 OS plug-in threads are now in the current process
3 - verify the register contents of each thread that shows up
4 - unload the python OS plug-in and verify that the OS threads are gone.

llvm-svn: 232401
2015-03-16 19:54:22 +00:00
Siva Chandra 870602dd3c Handle PyLong return values in LLDBSwigPython_CalculateNumChildren.
Summary:
Also, change its return type to size_t to match the return types of
its callers.

With this change, std::vector and std::list data formatter tests
pass on Linux (when using libstdc++) with clang as well as with gcc.
These tests have also been enabled in this patch.

Test Plan: dotest.py -p <TestDataFormatterStdVector|TestDataFormatterStdList>

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: zturner, lldb-commits

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

llvm-svn: 232399
2015-03-16 19:01:33 +00:00
Hafiz Abid Qadeer a40780e36c Remove redundant comments from lldb-mi source files.
Most of lldb-mi files have comments about environement, copyright etc which were neither needed nor uptodate.
This commit removes those comments.

llvm-svn: 232396
2015-03-16 18:18:18 +00:00
Hafiz Abid Qadeer 10fa53d26e Enabling the lldb-mi tests on Linux.
I think the issue that caused the random failure has been fixed. So I am enabling the tests again on Linux.
There are still some tests that are skipped on Linux due to different output. Those will be handled separately.

Tested with dotest.py and with "make check-lldb" and there was no MI related failure.

llvm-svn: 232380
2015-03-16 14:28:18 +00:00
Hafiz Abid Qadeer ace93f3a90 Fix the test for gcc.
Following 3 changes were made.
1. Test was assuming that function name will have () in the end. I dont know why lldb is generating function name like this but it looks like a bug. For this test, I have removed it.
2. Step instruction test was assuming that function call will not be the first instruction in the range of the line. This assumption failed with gcc. So I had fixed this.
3. Some minor adjustments with the line number.

Test with bot gcc and clang and all tests pass.

This test is still very fragile. We should be removing hardcoded line number.

llvm-svn: 232372
2015-03-16 12:16:19 +00:00
Hafiz Abid Qadeer 943483f451 Check that RestartedFromEvent flag before processing the state changed event.
Not checking for this flags caused lldb-mi to issue stop notification when target
has started running again. It also tried to get stack when target was running and
this caused randon failure.

Approved in http://lists.cs.uiuc.edu/pipermail/lldb-dev/2015-March/006953.html

llvm-svn: 232370
2015-03-16 11:47:24 +00:00
Vince Harron 0fc6c6762f Added nullptr to fix build
llvm-svn: 232345
2015-03-16 03:54:22 +00:00
Vince Harron b63c1880f2 Use -fno-limit-debug-info instead of -fstandalone-debug in tests
This fixes tests on clang-3.4

AFAICT, these flags have the same affect and -fstandalone-debug wasn't
added until after clang-3.4

Committed to try to fix buildbot

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

llvm-svn: 232326
2015-03-15 18:05:53 +00:00
Zachary Turner 073951f28b Fix a bug related to arg escaping, and add unit tests.
A recent refactor had introduced a bug where if you escaped a
character, the rest of the string would get processed incorrectly.

This patch fixes that bug and adds some unit tests for Args.

llvm-svn: 232288
2015-03-14 23:39:42 +00:00
Zachary Turner eeba1a896a [CMake] Make the unittests link against everything...
Sigh.  There's really not a good alternative until we decouple
python from lldb better.  The only way the build works right now
is by having every executable link against every LLDB library.
This causes implicit transitive link dependencies on the union
of everything that LLDB brings in.  Which means that if all we
want is one header file from interpreter, we have to bring in
everything, including everything that everything depends on,
which means python.

There's outstanding efforts to address this, but it's not yet
complete.  So until then, this is all we can do.

llvm-svn: 232287
2015-03-14 23:39:28 +00:00
Ed Maste 1cd6c667eb Strip trailing whitespace from python-wrapper.swig
(To test the dependency added in r232256.)

llvm-svn: 232257
2015-03-14 08:06:56 +00:00
Ed Maste c3948b4af1 Make LLDBWrapPython.cpp depend on the .swig files (configure+make build)
This is equivalent to r232175 for the CMake build.

llvm-svn: 232256
2015-03-14 07:58:06 +00:00
Zachary Turner 2c04f79b01 [gtest] Fix gtest failures on Windows.
On Windows, you need to call WSAStartup() before making any socket
calls, and WSACleanup() before you shutdown.  This wasn't being
done, so all of the socket tests were failing.  This fixes
that, which brings the unit test suite to a fully working state
on Windows.

llvm-svn: 232247
2015-03-14 04:19:32 +00:00
Zachary Turner f4a501a5f3 [CMake] Convert TABs to spaces.
This file had been using TAB all along, but my recent change that
used spaces exposed the issue.

llvm-svn: 232244
2015-03-14 03:10:51 +00:00
Ed Maste ea627d728b Skip additional lldb-mi tests that failed on FreeBSD
llvm-svn: 232243
2015-03-14 02:54:57 +00:00
Enrico Granata 9370d2784f If creating a Python command via a class, the help text is handled directly by the class object, no need for setting it manually via the cmdline
llvm-svn: 232228
2015-03-13 22:35:44 +00:00
Vince Harron e72b71ff08 Revert test/Makefile to state before r232205
llvm-svn: 232227
2015-03-13 22:33:42 +00:00
Enrico Granata cc342da574 Add accessors on SBCommand to get and set the help texts for a command
llvm-svn: 232226
2015-03-13 22:32:11 +00:00
Enrico Granata 2fc62ed37d Introduce documentation for Python command objects
llvm-svn: 232225
2015-03-13 22:27:36 +00:00
Enrico Granata 6f79bb2d57 Add support for Python object commands to return custom short and long help by implementing
def get_short_help(self)
def get_long_help(self)

methods on the command object

Also, add a test case for this feature

llvm-svn: 232224
2015-03-13 22:22:28 +00:00
Zachary Turner 794e6a60a8 Fix makefiles to build shared library tests on Windows.
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
2015-03-13 21:51:11 +00:00
Zachary Turner a6ad7a542b [CMake] Fix unit test build on Linux.
A filename had been misspelled in the CMake.

llvm-svn: 232218
2015-03-13 21:33:34 +00:00
Zachary Turner 891af04d82 Create a check-lldb-unit target to run unit tests.
llvm-svn: 232212
2015-03-13 20:55:07 +00:00
Zachary Turner 719ec93a74 Rework the gtest directory structure.
This makes the directory structure mirror the canonical LLVM
directory structure for a gtest suite.

Additionally, this patch deletes the xcode project.  Nobody
is currently depending on this, and it would be better to have
gtest unit tests be hand-maintained in the Xcode workspace
rather than using this python test runner.  Patches to that
effect will be submitted as followups.

llvm-svn: 232211
2015-03-13 20:54:57 +00:00
Zachary Turner 26d7fcfc38 Create a CMake build for the gtest unit tests.
llvm-svn: 232210
2015-03-13 20:54:21 +00:00
Vince Harron 8974ce2735 Add support for XFAILing a test on specific clang versions
llvm-svn: 232205
2015-03-13 19:54:54 +00:00
Oleksiy Vyalov 6474721c10 Extend Platform(s) in order to cache remote executables using ModuleCache and make POSIX dynamic loader to use this flow when attaching to a remote target.
http://reviews.llvm.org/D8306

llvm-svn: 232194
2015-03-13 18:44:56 +00:00
Zachary Turner d3b7582c84 [CMake] Make LLDBWrapPython.cpp depend on the .swig files.
Previously it would only regenerate LLDBWrapPython.cpp if one of
the .i files changed, or if lldb.swig changed.  This patch also
makes it depend on the rest of the *.swig files, so that if any
of them changes it regenerates the CMake.

llvm-svn: 232175
2015-03-13 16:31:58 +00:00
Tamas Berghammer 00c45289f4 Make TestSBFrameFindValue compatible with remote targets
llvm-svn: 232171
2015-03-13 14:54:42 +00:00
Tamas Berghammer 27c8d36270 Forward adb port for reverse connect test cases
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
2015-03-13 14:32:25 +00:00
Tamas Berghammer 42f35defee Skip VectorTypesFormatting test case when using gcc
Gcc don't support the ext_vector_type extension used by the test

llvm-svn: 232169
2015-03-13 14:30:42 +00:00
Tamas Berghammer 457ecce23d Fix expectation in TestDataFormatterSynth
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
2015-03-13 11:59:58 +00:00
Tamas Berghammer 1e209fcceb Create NativeRegisterContext for android-arm64
Differential revision: http://reviews.llvm.org/D8058

llvm-svn: 232160
2015-03-13 11:36:47 +00:00
Tamas Berghammer 0deef9c3cb Fix SO entry is main executable detection on android
* On Android (at least on platfrom-21 x86) the dynamic linker reports the
  executable with its full path
* Use the platform path of the executable when storing it into the cache
  (used to identify the SO entry for the executable) as this is the path
  what will be reported by the dynamic linker. If the platform path isn't
  set (local debugging) then it falls back to the normal file path.

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

llvm-svn: 232158
2015-03-13 11:16:14 +00:00
Tamas Berghammer a109421936 Fix missing data in GetProcessInfo on linux
Fill in the missing part of the architecture in GetProcessInfo from the
HostArchitecture (e.g. Environment).

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

llvm-svn: 232157
2015-03-13 11:16:12 +00:00
Tamas Berghammer dad4db713d Add filepath to qModuleInfo packet
The file path is currently required on android because the executables
only contain the name of the system libraries without their path. This
CL add an extra field to the qModuleInfo packet to return the full path
of a modul and add logic to locate a shared module on android.

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

llvm-svn: 232156
2015-03-13 11:16:08 +00:00
Tamas Berghammer 0cbf0b13e7 Add code to exit the NativeProcessLinux Monitor thread on android
This CL change the logic used to terminate the monitor thread of
NativeProcessLinux to use a signal instead of pthread_cancel as
pthread_cancel is not supported on android.

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

llvm-svn: 232155
2015-03-13 11:16:03 +00:00
Tamas Berghammer e9f4dfe6fb Fix fetching the architecture of the target on process launch
Previously it was fetched only if the architecture isn't valid, but the
architecture can be valid without containing all information about the
current target (e.g. missing os).

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

llvm-svn: 232153
2015-03-13 10:32:42 +00:00
Tamas Berghammer e724af10b6 Remove non const version of GetArchitecture from Target.h
The architecture of a target should be updated only by the
SetArchitecture method so the target can correctly manage its modules.

llvm-svn: 232152
2015-03-13 10:32:37 +00:00
Pavel Labath a73d657e36 Respect include_inlines when looking up functions in SymbolFileDWARF
Summary:
SymbolFileDWARF was not respecting the include_inlines argument in function lookup in all code
paths. This resulted in an attempt to call an inlined function during expression evaluation,
which is impossible, and usually resulted in a segfault in the inferior. This patch makes sure
include_inlines is respected in all code paths.

Reviewers: clayborg

Subscribers: lldb-commits, sivachandra

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

llvm-svn: 232151
2015-03-13 10:22:00 +00:00
Tamas Berghammer 1253a81096 Skip fdleak tests on android
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
2015-03-13 10:12:25 +00:00
Vince Harron 393edd1cb3 Don't require AVX registers if the target CPU doesn't have them
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
2015-03-13 03:43:46 +00:00
Enrico Granata 9fe00e52d3 Bulk of the infrastructure work to allow script commands to be backed by object instances in addition to free functions
This works by creating a command backed by a class whose interface should - at least - include

def __init__(self, debugger, session_dict)
def __call__(self, args, return_obj, exe_ctx)

What works:
- adding a command via command script add --class
- calling a thusly created command

What is missing:
- support for custom help
- test cases

The missing parts will follow over the next couple of days

This is an improvement over the existing system as:
a) it provides an obvious location for commands to provide help strings (i.e. methods)
b) it allows commands to store state in an obvious fashion
c) it allows us to easily add features to script commands over time (option parsing and subcommands registration, I am looking at you :-)

llvm-svn: 232136
2015-03-13 02:20:41 +00:00
Enrico Granata f2d44ca8e2 Silence warnings here by explicit cast.
llvm-svn: 232126
2015-03-13 00:31:45 +00:00
Enrico Granata 2aa191c878 Add override markers
llvm-svn: 232116
2015-03-12 22:33:52 +00:00
Enrico Granata ef238c1df2 This fixes the build I previously broke - and actually makes the test case work just like I promised
llvm-svn: 232115
2015-03-12 22:30:58 +00:00
Enrico Granata 495dccd67f Fix a bug in the data formatters where summary strings would not look into the non-synthetic value for child members if the ValueObject being formatted happened to have a synthetic value
rdar://15630776

llvm-svn: 232114
2015-03-12 22:17:07 +00:00
Enrico Granata 3fa6dc904a Fix an issue where values would be printed in one-line mode even if you asked to see locations and/or asked for flat output mode
llvm-svn: 232113
2015-03-12 22:16:20 +00:00
Vince Harron ffee7c114b XFAIL TestAbbreviations on Linux, improve test
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
2015-03-12 20:08:45 +00:00
Vince Harron e849103f5a Test that software breakpoints aren't visible in disassembly
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
2015-03-12 20:07:13 +00:00
Hafiz Abid Qadeer 5f86f216c3 Add -p and -r options to lldb-mi command -file-exec-file-and-symbols to support iOS debugging on macOS.
The patch adds 2 options which are not present in the GDB MI. Those have been described in MIExtensions.txt.

Patch from Chuck Ries.

llvm-svn: 232077
2015-03-12 18:35:54 +00:00
Oleksiy Vyalov eda270ee99 Make ModuleCache::Get to return instantiated ModuleSP instance so already created in-memory instance can be returned instead of creating a new one.
http://reviews.llvm.org/D8270

llvm-svn: 232075
2015-03-12 18:18:03 +00:00
Greg Clayton 6ef9712296 Avoid a failing test case by fixing things so the compiler generates a line table entry for line the very start of the printf() before any values have been loaded into registers.
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
2015-03-12 17:42:15 +00:00
Ilia K 520b0e45aa Remove unused FileSpec variable from Target::GetSharedModule
llvm-svn: 232060
2015-03-12 17:12:06 +00:00
Ilia K ed5e4a4b63 Clean up includes in source/lldb.cpp (1 was unused, 1 duplicated)
llvm-svn: 232059
2015-03-12 17:05:18 +00:00
Ilia K 02e55ef3fb Add low-frame/high-frame options to -stack-list-arguments (MI)
Summary:
Add low-frame/high-frame options to -stack-list-arguments

All tests pass on OS X.

Reviewers: clayborg, abidh

Reviewed By: abidh

Subscribers: lldb-commits, clayborg, abidh

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

llvm-svn: 232048
2015-03-12 15:35:58 +00:00
Hafiz Abid Qadeer d5d496a55d Removed an unused global variable.
This variable "g_debugger_name" is not used anywhere. It also causes a warning.
I was first going to change its type to fix the warning then noticed that it 
is not being used. So removing it.

Committed as Obvious. 

llvm-svn: 232043
2015-03-12 14:54:44 +00:00
Pavel Labath bbdb712765 Remove unused variable
llvm-svn: 232041
2015-03-12 14:41:40 +00:00
Tamas Berghammer 6698d84286 Limit the lenght of the file name of the log file for tests
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
2015-03-12 10:24:11 +00:00
Pavel Labath 3f5df53fde Fix ProcessIO test failures
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
2015-03-12 10:12:41 +00:00
Bhushan D. Attarde 9425b329c8 Test Commit: Spell correction
llvm-svn: 232022
2015-03-12 09:17:22 +00:00
Ilia K ba6d7b6004 Add lldb-mi/lldb-server test folders to PATH before in dotest.py
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
2015-03-12 07:32:32 +00:00
Ilia K e4af28b7e9 Fix SDK selection using "platform select" when --sysroot/--version/--build options were specified
Summary:
This patch fixes SDK selection in the following case:
```
platform select remote-ios --sysroot "/Users/IliaK/Library/Developer/Xcode/iOS DeviceSupport/8.1.2 (12B440)" --build 12B440 --version 8.1.2
target create --arch arm64 "~/Project1.app"
```

Currently the lldb selects a first SDK version (in name order) in directory and then updates it after the device is connected. This approach ignores user's arguments and actually "platform select" command doesn't make sense.

After this patch, lldb takes a SDK which matches to user's arguments.

Reviewers: jasonmolenda, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, jasonmolenda, aemerson

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

llvm-svn: 232017
2015-03-12 07:21:25 +00:00
Ilia K d9953052e3 Skip AsanTestCase and AsanTestReportDataCase on Darwin
Summary:
This patch skips tests which cause the following error:
```
1: test_with_dsym (TestMemoryHistory.AsanTestCase) ... 
os command: make clean ; make MAKE_DSYM=YES ARCH=x86_64 CC="/Users/IliaK/p/llvm/build_ninja/bin/clang" 
with pid: 9475
stdout: rm -f "a.out"  main.o main.d main.d.tmp  
rm -f -r "a.out.dSYM"
/Users/IliaK/p/llvm/build_ninja/bin/clang  -fsanitize=address -fsanitize-address-field-padding=1 -g -arch x86_64   -I/Users/IliaK/p/llvm/tools/lldb/test/make/../../include   -c -o main.o main.c
/Users/IliaK/p/llvm/build_ninja/bin/clang  main.o  -fsanitize=address -fsanitize-address-field-padding=1 -g -arch x86_64   -I/Users/IliaK/p/llvm/tools/lldb/test/make/../../include   -o "a.out"

stderr: clang: error: unknown argument: '-fsanitize-address-field-padding=1'
clang: error: unsupported argument 'address' to option 'fsanitize='
ld: file not found: /Users/IliaK/p/llvm/build_ninja/bin/../lib/clang/3.7.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [a.out] Error 1

retcode: 2


ERROR

os command: make clean 
with pid: 9521
stdout: rm -f "a.out"  main.o main.d main.d.tmp  
rm -f -r "a.out.dSYM"

stderr: 
retcode: 0


Restore dir to: /Users/IliaK/p/llvm/tools/lldb

======================================================================
ERROR: test_with_dsym (TestMemoryHistory.AsanTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 612, in wrapper
    func(*args, **kwargs)
  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/asan/TestMemoryHistory.py", line 24, in test_with_dsym
    self.buildDsym (None, compiler)
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 1496, in buildDsym
    if not module.buildDsym(self, architecture, compiler, dictionary, clean):
  File "/Users/IliaK/p/llvm/tools/lldb/test/plugins/builder_darwin.py", line 16, in buildDsym
    lldbtest.system(commands, sender=sender)
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 370, in system
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command 'make clean ; make MAKE_DSYM=YES ARCH=x86_64 CC="/Users/IliaK/p/llvm/build_ninja/bin/clang" ' returned non-zero exit status 2
Config=x86_64-clang
----------------------------------------------------------------------
```

Also this patch fixes findBuiltClang() by looking a clang in the build folder.

BTW, another patch was made in October 2014, but it wasn't committed: http://reviews.llvm.org/D6272.

Reviewers: abidh, zturner, emaste, jingham, jasonmolenda, granata.enrico, DougSnyder, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, DougSnyder, granata.enrico, jasonmolenda, jingham, emaste, zturner, abidh, clayborg

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

llvm-svn: 232016
2015-03-12 07:19:41 +00:00
Ilia K 299819c458 Fix PATH_MAX definition after remarks in r231917 (MI)
llvm-svn: 232008
2015-03-12 04:18:47 +00:00
Greg Clayton 2463d982b4 Remove "virtual" and add "override" to all virtual functions.
llvm-svn: 231991
2015-03-12 00:17:08 +00:00
Greg Clayton 6d06d9050e Remove "virtual" and add "override" to all functions that are overridden to quiet warnings.
llvm-svn: 231990
2015-03-12 00:16:14 +00:00
Robert Flack 5f4b6c7c9e Initialize ProcessGDBRemoteLog for LLGS to fix remote platform logging
This was previously initialized by ProcessGDBRemote::Initialize but lldb-server does not contain ProcessGDBRemote anymore so this needs to be initialized directly.

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

llvm-svn: 231966
2015-03-11 21:14:22 +00:00
Robert Flack d6c9bd509e Reduce the number of components initialized for LLGS further.
In http://reviews.llvm.org/D7880 the initialization for LLGS was separated out so that LLGS could initialize only the components it needs to. This further reduces the set of components initialized for LLGS.

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

llvm-svn: 231964
2015-03-11 20:35:05 +00:00
Oleksiy Vyalov bac75698d4 Pass a process full executable path within "name" response field.
http://reviews.llvm.org/D8239

llvm-svn: 231949
2015-03-11 18:13:37 +00:00
Zachary Turner 5178125abd Add a CODE_OWNERS.txt file to LLDB.
llvm-svn: 231936
2015-03-11 16:26:46 +00:00
Tamas Berghammer 04f51d1413 Refactor GdbRemote test cases to support remote platforms
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
2015-03-11 13:51:07 +00:00
Ilia K 555ed1342d Move MiInterpreterExecTestCase to test/tools/lldb-mi/interpreter folder (MI)
llvm-svn: 231918
2015-03-11 12:28:48 +00:00
Ilia K 654e1c2c1a Fix build on Windows (PATH_MAX was undefined) after r231858
llvm-svn: 231917
2015-03-11 11:24:10 +00:00
Pavel Labath a55a953a29 Fix bug in ProcessGDBRemote
Summary:
ProcessGDBRemote::AsyncThread nuked its own thread handle upon exiting. This prevented the main
thread from joining it correctly in StopAsyncThread. I address this by moving the Reset() call to
StopAsyncThread, after the join.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 231915
2015-03-11 09:53:42 +00:00
Jason Molenda 4897583344 If the user specifies a kernel binary that isn't correct for the current
kernel debug session, instead of issuing a warning (which on one ever
sees), drop the user-specified kernel binary Module from the target and
try to discover the correct one dynamically.
<rdar://problem/19450329> 

llvm-svn: 231885
2015-03-10 23:34:52 +00:00
Zachary Turner c99b5ce13a Update build instructions / coding conventions.
This improves the instructions for checking out LLDB, adds
more links to LLVM instructions, and more explicitly calls out
when we differ from the style guide.

Also updates the clang-format configuration file to correctly
reflect a 120 column limit.

Reviewed by: Jim Ingham
Differential Revision: http://reviews.llvm.org/D8222

llvm-svn: 231884
2015-03-10 23:22:25 +00:00
Ilia K eb2c19a549 Add =shlibs-added/=shlibs-removed notifications (MI)
Summary:
This patch adds =shlibs-added/=shlibs-removed notifications in lldb-mi. In more detail:
# Add Target::ModulesDidLoad/ModulesDidUnload notifications
# Improve Target::TargetEventData:
## Refactoring
## Move it back to include/lldb/Target/Target.h
## Add Target::{GetModuleListFromEvent,GetModuleList}; Add Target::m_module_list
# Add SBModule::{GetSymbolVendorMainFileSpec,GetObjectFileHeaderAddress}
# Add SBTarget::{EventIsTaretEvent,GetTargetFromEvent,GetNumModulesFromEvent,GetModuleAtIndexFromEvent}

All tests pass on OS X.

Reviewers: abidh, zturner, jingham, clayborg

Reviewed By: clayborg

Subscribers: jingham, zturner, lldb-commits, clayborg, abidh

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

llvm-svn: 231858
2015-03-10 21:59:55 +00:00
Ilia K e912e3e3f9 Add SymbolVendor::GetMainFileSpec and simplify CommandObjectTargetModulesList::PrintModule
Summary:
Add SymbolVendor::GetMainFileSpec and simplify CommandObjectTargetModulesList::PrintModule.

All tests pass on OS X.

Reviewers: abidh, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, abidh

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

llvm-svn: 231849
2015-03-10 21:18:59 +00:00
Robert Flack f196c93172 Add Debugger::InitializeForLLGS to allow ref counted LLGS initialization.
After http://reviews.llvm.org/D8133 landed as r231550 process launch on remote platform stopped working.

This adds Debugger::InitializeForLLGS and tracks whether one or both of Initialize and InitializeForLLGS have been called, calling only the corresponding lldb_private::Terminate* methods as necessary. Since lldb_private::Terminate calls lldb_private::TerminateForLLGS, the latter method may be called twice if Initialize was called for both however the terminate methods ensure they are only called once after being initialized.

This still maintains the reduced binary size, though it does now technically link in lldb_private::Terminate on lldb-server even though this should never be called.

This should resolve the issue raised in http://reviews.llvm.org/D8133 where Debugger::Terminate assumed that there were 0 references to debugger and terminated early.

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

llvm-svn: 231808
2015-03-10 18:07:47 +00:00
Ilia K a3cea50016 Fix a comment for ValueObject::GetValueDidChange after r231526
Summary:
Fix a comment for ValueObject::GetValueDidChange after r231526.

This fix was requested by @jingham.

Reviewers: jingham, ki.stfu

Reviewed By: ki.stfu

Subscribers: lldb-commits, jingham

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

llvm-svn: 231804
2015-03-10 17:24:32 +00:00
Oleksiy Vyalov 4eab4bc23c Restore commented setTearDownCleanup in TestHelloWorld.test_with_dwarf_and_attach_to_process_with_id_api.
llvm-svn: 231737
2015-03-10 01:58:47 +00:00
Oleksiy Vyalov 63acdfdeb2 Add Utility/ModuleCache class and integrate it with PlatformGDBRemoteServer - in order to allow modules caching from remote targets.
http://reviews.llvm.org/D8037

llvm-svn: 231734
2015-03-10 01:15:28 +00:00
Greg Clayton ee2ed52584 Fix debugserver warnings on MacOSX.
llvm-svn: 231692
2015-03-09 19:45:23 +00:00
Greg Clayton 58ea3e35d0 Fixed a bug where the expression parser relied on having symbols for things even if they were in the debug info.
The issue can happen if you strip your main executable and then run an expression and it would fail to find the stripped symbol and it would then not be able to make the function call. The issue was fixed by doing our normal FindFunctions call.

<rdar://problem/20072750>

llvm-svn: 231667
2015-03-09 16:46:57 +00:00
Tamas Berghammer 05b098d250 Fix AttachDeniedTestCase on android
Failure caused by a missing mkfifo command in the android OS. This fix
replace mkfifo with "mknode p" command on android.

llvm-svn: 231651
2015-03-09 13:11:42 +00:00
Tamas Berghammer 8fa23b8ebf Report the actual user register count from NativeRegisterContextLinux_x86_64
Thic change have effect wehn the AVX registers aren't available with
reporting the count of user registers without them.

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

llvm-svn: 231638
2015-03-09 10:48:23 +00:00
Vince Harron 18258687e6 Skip all lldb-mi tests on Linux
lldb-mi tests have been failing for a while on the buildbots.
Disabling until someone has a chance to fix.

llvm-svn: 231602
2015-03-08 17:28:08 +00:00
Ed Maste 8f3c0cd1ba Fix whitespace on Python SWIG wrapper
llvm-svn: 231600
2015-03-08 16:24:30 +00:00
Vince Harron b3237de6e4 Move Python Init from InitializeForLLGS to Initialize
Linux configure+make builds have ~175 tests failing that aren't
failing in cmake builds.  The tests have error messages like
"'a.out' doesn't contain the architecture x86-64"  ObjectFileELF
plugin wasn't loaded when this message was output.
    
I found ScriptInterpreterPython::InitializePrivate() is calling
Debugger::Terminate(), which terminates ObjectFileELF (and lots
of other stuff) setup earlier in the InitializeForLLGS.
    
So I moved python Init/Term from Init/TermForLLGS to Init/Term

llvm-svn: 231550
2015-03-07 03:37:15 +00:00
Greg Clayton 910db5c520 Help for _regexp-break wasn't very clear. Added more detailed explanations of all things that can be typed by the _regexp-break command.
<rdar://problem/12281058>

llvm-svn: 231537
2015-03-07 00:01:46 +00:00
Greg Clayton 39fb1389b4 Make sure to re-read the file data you can get from OptionValueFileSpec::GetFileContents(...) when the file has changed.
This means you can set an expression prefix file with:
(lldb) settings set target.expr-prefix /tmp/to/prefix.txt

And you can run an expression and modify your expression prefix file in another editor without having to type:

(lldb) settings set target.expr-prefix /tmp/to/prefix.txt

again...

<rdar://problem/12155942> 

llvm-svn: 231535
2015-03-06 23:46:54 +00:00
Ilia K d4ec5a70ea Improve ValueObject::GetValueDidChange test; Add a comment for it
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
2015-03-06 22:35:08 +00:00
Ilia K 6ec9ba5a97 Fix -var-create and -var-update (MI)
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
2015-03-06 22:25:12 +00:00
Jim Ingham ed1d079377 Remember to set m_loaded_objc_opt once you've loaded the ObjC data
from the shared cache so you don't update it over & over.

<rdar://problem/20074768>

llvm-svn: 231514
2015-03-06 20:57:17 +00:00
Zachary Turner a893d3014b Remove Host::Backtrace in favor of llvm::sys::PrintStackTrace()
This removes Host::Backtrace from the codebase, and changes all
call sites to use llvm::sys::PrintStackTrace().  This makes the
functionality available for all platforms, and even for platforms
which currently had a supported implementation of Host::Backtrace,
this patch should enable richer information in stack traces, such
as file and line number information, as well as giving it the
ability to unwind through inlined functions.

llvm-svn: 231511
2015-03-06 20:45:43 +00:00
Enrico Granata db595cdc17 A few improvements to our vector types formatting story:
- 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
2015-03-06 19:37:57 +00:00
Ilia K f7ee16f9e3 Fix Radar10642615DataFormatterTestCase after r231449
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
2015-03-06 16:53:37 +00:00
Ilia K d9f78360a7 Fix MiSignalTestCase.test_lldbmi_stopped_when_stopatentry_remote test after r231479
llvm-svn: 231489
2015-03-06 16:43:38 +00:00
Tamas Berghammer 6ad63744b3 Initialize ProcessPOSIXLog by NativeProcessLinux
Previously it was initialized by ProcessLinux but lldb-server don't
contain ProcessLinux anymore so it have to be initialized by
NativeProcessLinux also.

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

llvm-svn: 231482
2015-03-06 15:47:23 +00:00
Robert Flack 8cc4cf178c Rename test/tools/lldb-gdbserver to test/tools/lldb-server
As requested in http://reviews.llvm.org/D7545 this change moves test/tools/lldb-gdbserver to test/tools/lldb-server ot match the name of the target being tested.

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

llvm-svn: 231479
2015-03-06 14:36:33 +00:00
Pavel Labath 78521ef545 Fix race condition with -o "process launch" on linux
Summary:
starting a debug session on linux with -o "process launch" lldb parameter was failing since
Target::Launch (in sychronous mode) is expecting to be able to receive public process events.
However, PlatformLinux did not set up event hijacking on process launch, which caused these
events to be processed elsewhere and left Target::Launch hanging. This patch enables event
interception in PlatformLinux (which was commented out).

Upon enabling event interception, I noticed an issue, which I traced back to the inconsistent
state of public run lock, which remained false even though public and private process states were
"stopped". I addressed this by making sure the run lock is "stopped" upon exit from
WaitForProcessToStop (which already had similar provisions for other return paths).

Test Plan: This should fix the intermittent TestFormats failure we have been experiencing on Linux.

Reviewers: jingham, clayborg, vharron

Subscribers: lldb-commits

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

llvm-svn: 231460
2015-03-06 10:52:47 +00:00
Enrico Granata 72146af68c Windows bot
llvm-svn: 231450
2015-03-06 03:37:33 +00:00
Enrico Granata 0ddbf3633c Provide synthetic children for some vector types
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
2015-03-06 03:32:20 +00:00
Jason Molenda 07e51cc72d Bump major vers # in xcode project file from 330 to 340.
llvm-svn: 231441
2015-03-06 00:45:01 +00:00
Chaoren Lin 6fb4915bd6 Remove libedit and libncurses from LLDB_SYSTEM_LIBS if they're disabled.
Reviewers: clayborg, zturner, vharron, sbest

Subscribers: lldb-commits

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

llvm-svn: 231423
2015-03-05 23:22:54 +00:00
Greg Clayton 12ba733ce8 When we have a symbol, like "NSLog" that we try to call in an expression, make sure we prioritize the external symbols over the internal one.
This is a temporary fix until a more comprehensive fix can be made for finding functions that we call in expressions.

We find "NSLog" in ClangExpressionDeclMap::FindExternalVisibleDecls() in after a call to target->GetImages().FindFunctions(...). Note that there are two symbols: NSLog from CFNetwork which is not external, and NSLog from Foundation which _is_ external. We do something with the external symbol with:

                    if (extern_symbol)
                    {
                        AddOneFunction (context, NULL, extern_symbol, current_id);
                        context.m_found.function = true;
                    }

Then later we try to lookup the _Z5NSLogP8NSStringz name and we don't find it so we call ClangExpressionDeclMap::GetFunctionAddress() with "_Z5NSLogP8NSStringz" as the name and the sc_list_size is zero at the "if" statement at line 568 because we don't find the mangled name and we extract the basename "NSLog" and call:

            FindCodeSymbolInContext(ConstString(basename), m_parser_vars->m_sym_ctx, sc_list);
            sc_list_size = sc_list.GetSize();

and we get a list size of two again, and we proceed to search for the symbol again, this time ignoring the external vs non-external-ness of the symbols that we find. This fix ensures we prioritize the external symbol until we get a real fix from Sean Callanan when he gets back to make sure we don't do multiple lookups for the same symbol we already resolved.

<rdar://problem/19879282>

llvm-svn: 231420
2015-03-05 23:12:02 +00:00
Greg Clayton 48d157dd41 symbolicate the application specific backtraces that are in MacOSX crash log files.
<rdar://problem/20039160> 

llvm-svn: 231415
2015-03-05 22:53:06 +00:00
Vince Harron 6caca38f68 XFAIL tests that are known to fail occasionally on Linux
Trying to get the build green so we can notice new failures easier.

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

llvm-svn: 231407
2015-03-05 21:35:28 +00:00
Pavel Labath aa1ae6f660 Correctly quote arguments in LLDB driver
Summary:
LLDB driver was simply tacking quotes around the strings in lldb commands, hoping that will work.
This changes it to properly escape quotes and backslashes.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 231394
2015-03-05 19:17:56 +00:00
Jason Molenda 9594459b21 Add support for the DWARFv3 (circa 2005) DW_OP_form_tls_address
operator in addition to the vendor-extension DW_OP_GNU_push_tls_address.
clang on PS4 and Darwin will be emitting the standard opcode 
as of r231286 via http://reviews.llvm.org/D8018

Behavior of this standard  opcode is the same as 
DW_OP_GNU_push_tls_address.

<rdar://problem/20043195>

llvm-svn: 231342
2015-03-05 02:42:06 +00:00
Enrico Granata 61f7928376 Appease the Windows bot
llvm-svn: 231315
2015-03-04 23:19:36 +00:00
Enrico Granata 53ed89c6da Introduce lldbassert(x)
We would like it if LLDB never crashed, especially if we never caused LLDB to crash
On the other hand, having assertions can sometimes be useful

lldbassert(x) is the best of both worlds:
- in debug builds, it turns into a regular assert, which is fine because we don't mind debug LLDB to crash on development machines
- in non-debug builds, it emits a message formatted just like assert(x) would, but then instead of crashing, it dumps a backtrace, suggests filing a bug, and keeps running

llvm-svn: 231310
2015-03-04 22:59:20 +00:00
Enrico Granata b10e003015 Add a required #include
llvm-svn: 231288
2015-03-04 21:33:45 +00:00
Jim Ingham cfae0b23b9 Fix a thinko in the case where we return a launch error with no error
string.  Return "<unknown error>" rather than the empty launch error...

<rdar://problem/20026469>

llvm-svn: 231287
2015-03-04 21:28:55 +00:00
Zachary Turner fc8588136c Don't #include clang headers from BreakpointLocation.h
llvm-svn: 231263
2015-03-04 17:43:00 +00:00
Ilia K 41204d0960 Fix build on OS X after r231202
llvm-svn: 231235
2015-03-04 12:05:24 +00:00
Tamas Berghammer ac83982906 Set the signals based on the OS in the qHostInfo packet
Setting it from the Target architecture cause problems when the target
archiutecture is filled just by examining the executable because in that
case the OS isn't set.

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

llvm-svn: 231234
2015-03-04 11:34:10 +00:00
Ilia K 53d33368c4 Added long 'print-values' option for var-update MI command.
Summary:
The -var-update MI command should take the same print-values options as var-list children, however currently only the integer versions are supported.
Added --no-values, --all-values, and --simple-values long options. 

See:
https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Variable-Objects.html#GDB_002fMI-Variable-Objects

Patch from ewan@codeplay.com

Reviewers: EwanCrawford

Subscribers: ki.stfu, lldb-commits

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

llvm-svn: 231233
2015-03-04 11:21:18 +00:00
Tamas Berghammer ccd28a147b Fix expectation for TestPlatformCommand.test_shell
* Create expectation based on target platform
* Add custom expectation for remote android target

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

llvm-svn: 231232
2015-03-04 11:18:34 +00:00
Tamas Berghammer 43f2d97191 Fix deadlock in operation thread in NativeProcessLinux
The deadlock occurred when the Attach or the Launch operation failed for
any reason.

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

llvm-svn: 231231
2015-03-04 11:10:03 +00:00
Pavel Labath 783cbdcd89 Use the unified section list when generating a symbol table
Summary:
Symbol table generation code was failing to take into account the debug symbols because
the object file was looking only into its own section list when doing the generation, even though
the debug symbols from another object file were correctly detected and loaded by the
SymbolVendor. This changes the code to use the unified section list, which fixes this problem.

Test Plan:
I do not intend do submit this yet since it causes (or more like, exposes) the issue
in D7884, but I wanted to put this out here, so that anyone who wants to take a look at it can do
so. (And I also wanted to know if this is the right approach to the problem :).

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 231229
2015-03-04 10:28:15 +00:00
Pavel Labath c6ae7eaa7b Correctly resolve symbol names containing linker annotations
Summary:
Symbols in ELF files can be versioned, but LLDB currently does not understand these. This problem
becomes apparent once one loads glibc with debug info. Here (in the .symtab section) the versions
are embedded in the name (name@VERSION), which causes issues when evaluating expressions
referencing memcpy for example (current glibc contains memcpy@@GLIBC_2.14 and
memcpy@GLIBC_2.2.5).

This problem was not evident without debug symbols as the .dynsym section
stores the bare names and the actual versions are present in a separate section (.gnu.version_d),
which LLDB ignores. This resulted in two definitions of memcpy in the symbol table.

This patch adds support for storing annotated names to the Symbol class. If
Symbol.m_contains_linker_annotations is true then this symbol is annotated. Unannotated name can
be obtained by calling StripLinkerAnnotations on the corresponding ObjectFile. ObjectFileELF
implements this to strip @VERSION suffixes when requested. Symtab uses this function to add the
bare name as well as the annotated name to the name lookup table.

To preserve the size of the Symbol class, I had to steal one bit from the m_type field.

Test Plan:
This fixes TestExprHelpExamples.py when run with a glibc with debug symbols. Writing
an environment agnostic test case would require building a custom shared library with symbol
versions and testing symbol resolution against that, which is somewhat challenging.

Reviewers: clayborg, jingham

Subscribers: lldb-commits

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

llvm-svn: 231228
2015-03-04 10:25:22 +00:00