Commit Graph

10998 Commits

Author SHA1 Message Date
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
Zachary Turner 633a29cffb Further reduce header footprint of Debugger.h.
llvm-svn: 231202
2015-03-04 01:58:01 +00:00
Ed Maste 151315f471 Restore accidental deletion of header comment character
llvm-svn: 231197
2015-03-04 01:29:18 +00:00
Ed Maste 2ac86d6fee Another configure+make fix for r230963
llvm-svn: 231188
2015-03-04 01:05:52 +00:00
Ed Maste 9cfa627353 Try fixing configure+make build on FreeBSD after r230963
llvm-svn: 231180
2015-03-04 00:06:26 +00:00
Zachary Turner 90aff47cb7 Fix errors building on linux.
llvm-svn: 231169
2015-03-03 23:36:51 +00:00
Chaoren Lin dd4b678499 Accidental semicolon in python.
llvm-svn: 231163
2015-03-03 23:14:27 +00:00
Zachary Turner a78bd7ffc1 Don't #include FormatManager.h from Debugger.h
Debugger.h is a huge file that gets included everywhere, and
FormatManager.h brings in a ton of unnecessary stuff and doesn't
even use anything from it in the header.

llvm-svn: 231161
2015-03-03 23:11:11 +00:00
Chaoren Lin 2fd9fe7225 Remove unnecessary platform specific code from TestGlobalVariables.
llvm-svn: 231159
2015-03-03 22:46:20 +00:00
Ed Maste 8702e92d0c Fix FreeBSD build after r231145
llvm-svn: 231157
2015-03-03 22:44:18 +00:00
Zachary Turner 93749ab3cf Further reduce the header footprint of Process.h
No functional change here, only deletes unnecessary headers
and moves one function's body from the .h file to the .cpp.

llvm-svn: 231145
2015-03-03 21:51:25 +00:00
Zachary Turner af0f45f1c9 Don't #include ClangPersistentVariables.h from Process.h
Nothing from this header file was even being referenced in
Process.h anyway, so it was a completely unnecessary include.

llvm-svn: 231131
2015-03-03 21:05:17 +00:00
Chaoren Lin 6efb8bd947 [TestGlobalVariables] LD_LIBRARY_PATH should be process working directory.
Summary:
The inferior can load the library now, but the remote test is still failing
because of a module loading problem in LLDB.

Reviewers: ovyalov, sivachandra, clayborg

Subscribers: lldb-commits

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

llvm-svn: 231120
2015-03-03 20:11:48 +00:00
Zachary Turner 32abc6edac Reduce header footprint of Target.h
This continues the effort to reduce header footprint and improve
build speed by removing clang and other unnecessary headers
from Target.h.  In one case, some headers were included solely
for the purpose of declaring a nested class in Target, which was
not needed by anybody outside the class.  In this case the
definition and implementation of the nested class were isolated
in the .cpp file so the header could be removed.

llvm-svn: 231107
2015-03-03 19:23:09 +00:00
Chaoren Lin d9c054d001 Fix TestQuoting on remote targets.
Summary: Needed to transfer stdout.txt to host before reading.

Reviewers: ovyalov, clayborg

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 231101
2015-03-03 19:10:39 +00:00
Zachary Turner 88c6b62e9c Don't #include ClangASTContext.h from Module.h
This is part of a larger effort to reduce header file footprints.
Combined, these patches reduce the build time of LLDB locally by
over 30%.  However, they touch many files and make many changes,
so will be submitted in small incremental pieces.

Reviewed By: Greg Clayton
Differential Revision: http://reviews.llvm.org/D8022

llvm-svn: 231097
2015-03-03 18:34:26 +00:00
Ilia K 9f11852b2d Fix and enable some tests on Linux (MI)
Summary:
Fix and enable some lldb-mi tests on Linux:

Fixed:
# MiExecInterpreterTestCase.test_lldbmi_thread_step_in
# MiExecTestCase.test_lldbmi_exec_step
# MiStackTestCase.test_lldbmi_stack_info_frame tests.

Also I enabled the following tests on Linux:
# MiExecTestCase.test_lldbmi_exec_step_instruction
# MiSignalTestCase.test_lldbmi_stopped_when_interrupted

All test pass on OS X and Linux.

Reviewers: abidh, vharron, clayborg

Reviewed By: clayborg

Subscribers: vharron, lldb-commits, clayborg, abidh

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

llvm-svn: 231072
2015-03-03 15:32:39 +00:00
Ilia K 3dadd9db90 Improve MiStackTestCase tests
Summary:
Improve MiStackTestCase tests.

All tests pass on OS X.

Reviewers: clayborg, abidh

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, abidh

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

llvm-svn: 231071
2015-03-03 15:17:44 +00:00
Ilia K c6c716ac9d Allow to pass an executable file via lldb-mi arguments (MI)
Summary:
# Allow to pass an executable file via lldb-mi arguments
# Add tests
# Fix (gdb) prompt in CMIDriver::LocalDebugSessionStartupExecuteCommands
# Fix prompt in CMIDriver::InterpretCommandThisDriver: use the lldb-mi prompt instead of a hard-coded value.

All tests pass on OS X.

Reviewers: abidh, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, abidh

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

llvm-svn: 231070
2015-03-03 15:14:32 +00:00
Tamas Berghammer bd05108e53 Fix execution of platform shell commands on android
* Add missing functionality to the process launcher
* Fixup PATH environment variable to workaround an OS bug
* Add default shell path to the host info structure

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

llvm-svn: 231065
2015-03-03 12:14:45 +00:00
Greg Clayton 786ad18049 Fix a crasher where we might have a N_UNDF symbol with no name and this could cause ObjectFileMachO::ParseSymtab() to crash.
<rdar://problem/19989491>

llvm-svn: 231048
2015-03-03 01:40:46 +00:00
Zachary Turner 44a14d95c2 [CMake] Refactor LLDB main CMake file.
The existing state of affairs was getting a little unwieldy.

All of LLDB's utility functions and initial configuration was in
the root CMake file.  I split this up into 3 separate files and
moved them to relevant subfolders under cmake/modules.

Also, I deleted the add_lldb_definitions() function.  It seemed
to be somewhat useless and did not serve any real purpose that
I was able to figure out.

llvm-svn: 231010
2015-03-02 20:45:26 +00:00
Chaoren Lin ac8263dbf0 Applying D7950 to four near copies of the file.
Summary:
Using std::thread/random instead of pthread/rand.
Two of them also suffered from the synchronization problem in D7916.

Reviewers: clayborg, zturner, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 230993
2015-03-02 19:12:18 +00:00
Zachary Turner 3cb611b59e [Windows] Fix getcwd() on Windows.
Windows doesn't define getcwd(), so this test executable failed
to compile.

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

llvm-svn: 230983
2015-03-02 18:33:50 +00:00
Robert Flack ab3269d275 Reduce the number of components initialized by lldb-server to reduce static binary size.
Separate out the necessary component initialization for lldb-server such that the linker can greatly reduce the binary size. With this patch the size of lldb-server on my 64 bit linux release build drops from 46MB to 26MB.

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

llvm-svn: 230963
2015-03-02 15:14:50 +00:00
Pavel Labath 6100f61bce Fix build breakage on win7-msvc caused by r230955
llvm-svn: 230958
2015-03-02 13:39:39 +00:00
Pavel Labath 00b7f95b12 Fix handling of backslashes in Args parsing
Summary:
Presently Args::SetCommandString allows quotes to be escaped with backslash. However, the
backslash itself is not removed from the argument, nor there is a way to escape the backslash
itself. This leads to surprising results:

"a b" c"   -> 'a b', 'c'  # Here we actually have an unterminated quote, but that is ignored
"a b\" c"  -> 'a b\" c'   # We try to escape the quote. That works but the backslash is not removed.
"a b\\" c" -> 'a b\\" c'  # Escaping the backslash has no effect.

This change changes quote handling to be more shell-like:
- single quotes and backquotes are literal and there is no way to escape the closing quote or
  anything else inside;
- inside double quotes you can use backslash to escape the closing quote and another backslash
- outside any quotes, you can use backslash to escape quotes, spaces and itself.

This makes the parsing more consistent with what the user is familiar and increases the
probability that pasting the command line from shell to the "process launch" command "just work".

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 230955
2015-03-02 12:46:22 +00:00
Tamas Berghammer 6806fded8c Make it possible to stop the operation thread in NativeProcessLinux
Previously the operation thread is stopped with a cancel event but
pthread_cancel is not supported on android. This CL creates a custom
operation which asks the operation thread to exit without any pthread
call.

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

llvm-svn: 230945
2015-03-02 11:04:03 +00:00
Ilia K f1115fe0c5 Rename CMIDriver::LocalDebugSessionStartupInjectCommands to CMIDriver::LocalDebugSessionStartupExecuteCommands after r230003
llvm-svn: 230944
2015-03-02 10:58:02 +00:00
Vince Harron bc477ddee0 Linux - debugging of local processes via lldb-gdbserver
Instead of lldb calling the ptrace APIs directly, it launches an llgs
instance and communicates with it via the remote debug protocol.

This has two advantages.

There is more code shared between the remote debugging code path
and the local debugging code path. If a feature works in remote, it
probably works locally and vice-versa.

It makes us more architecturally similar to OSX (which also does
local debugging via a connection to debugserver).

This path is called LLGS local. We think that this configuration is
now at parity with (or better than) local linux debugging.

It is currently invoked if you have an environment variable defined
"PLATFORM_LINUX_FORCE_LLGS_LOCAL"

We would like to switch to LLGS local as the default path and only
use the non-LLGS path if someone has an environment variable defined
"PLATFORM_LINUX_DISABLE_LLGS_LOCAL"

Later, if all goes well, we would like to remove non-LLGS local
debugging support to simplify the codebase and avoid confusion.

llvm-svn: 230919
2015-03-01 23:21:29 +00:00
Chaoren Lin 451dd50673 Advertise 32 bit support for PlatformRemoteGDBServer on 64 bit systems.
Reviewers: vharron, clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 230906
2015-03-01 20:48:18 +00:00
Chaoren Lin e56f6dceea Fix attaching to 32 bit inferior with 64 bit llgs.
Summary: Executable module should use inferior architecture instead of host architecture.

Reviewers: ovyalov, vharron, clayborg

Subscribers: lldb-commits

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

llvm-svn: 230887
2015-03-01 04:31:16 +00:00
Vince Harron e6909e7886 Temporarily XFAIL TestLaunchWithShellExpand to get the build green
llvm-svn: 230832
2015-02-28 01:10:57 +00:00
Vince Harron 5a6b8aa4dd Use -fstandalone-debug for few tests to get around a Clang optimization
clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD targets.
Other targets do not, which causes several tests to fail.  This flag
enables FullDebugInfo for all targets.

Fixes the following tests:

TestCallStdStringFunction.py
TestDataFormatterSkipSummary.py
TestDataFormatterStdIterator.py
TestDataFormatterStdList.py
TestDataFormatterStdString.py
TestSBValuePersist.py
TestStringPrinter.py
TestTypeCompletion.py

llvm-svn: 230831
2015-02-28 01:07:50 +00:00
Vince Harron 7863d7634e Fixed pthread linking errors in test binaries
Fixes these tests:

TestBreakAfterJoin.py
TestCreateDuringStep.py
TestExitDuringBreak.py
TestMultipleBreakpoints.py

llvm-svn: 230828
2015-02-28 00:51:06 +00:00
Chaoren Lin c934659736 Casting pid to ::pid_t when invoking syscall.
Summary:
syscalls involving pid/tid on 32 bit binaries are failing with
"Invalid argument" because the uint64_t arguments are too wide.

Reviewers: clayborg, ovyalov, sivachandra

Subscribers: lldb-commits

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

llvm-svn: 230817
2015-02-28 00:20:16 +00:00
Chaoren Lin dd62b2efaa Convert TestWatchLocation to use C++11 library instead of pthread.
Reviewers: clayborg, zturner, ki.stfu, abidh

Subscribers: lldb-commits

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

llvm-svn: 230799
2015-02-27 21:45:51 +00:00
Ilia K 686b1fe65a Fix FileSpec::GetPath to return null-terminated strings
Summary:
Before this fix the FileSpec::GetPath() returned string which might be without '\0' at the end.
It could have happened if the size of buffer for path was less than actual path.

Test case:
```
FileSpec test("/path/to/file", false);
char buf[]="!!!!!!";
test.GetPath(buf, 3);
```

Before fix:
```
   233          FileSpec test("/path/to/file", false);
   234          char buf[]="!!!!!!";
   235          test.GetPath(buf, 3);
   236
-> 237          if (core_file)
   238          {
   239              if (!core_file.Exists())
   240              {
(lldb) print buf
(char [7]) $0 = "/pa!!!"
```

After fix:
```
   233          FileSpec test("/path/to/file", false);
   234          char buf[]="!!!!!!";
   235          test.GetPath(buf, 3);
   236
-> 237          if (core_file)
   238          {
   239              if (!core_file.Exists())
   240              {
(lldb) print buf
(char [7]) $0 = "/p"
```

Reviewers: zturner, abidh, clayborg

Reviewed By: abidh, clayborg

Subscribers: tberghammer, vharron, lldb-commits, clayborg, zturner, abidh

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

llvm-svn: 230787
2015-02-27 19:43:08 +00:00
Ilia K d99b8f3ba8 Skip LaunchInTerminalTestCase test on remote systems
Summary:
This ability was added by @jasonmolenda in [[ http://reviews.llvm.org/rL225748 | r225748 ]] but it was commented out because he hadn't test it.
I tested it on OS X and now we can enable it legally.

This change is made by @chying request.

Reviewers: jasonmolenda, chying, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, chying, jasonmolenda, clayborg

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

llvm-svn: 230782
2015-02-27 19:14:12 +00:00
Chaoren Lin 3ef297aeda Fixes http://reviews.llvm.org/rL230691
Summary: OS X doesn't implement pthread barriers, using a simple atomic flag instead.

Reviewers: ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 230739
2015-02-27 07:48:07 +00:00
Greg Clayton f9da928993 Fixed an infinite recursion bug that could happen when using python operating system plug-ins where we would ask the operating system plug-in to update its threads and this would cause the plugin to run an expression which would eventually run IRForTarget::CreateResultVariable() which would try to get the selected thread and cause re-entrant bug.
<rdar://problem/19924734>

llvm-svn: 230711
2015-02-27 00:12:22 +00:00
Bruce Mitchener 11d86362ae Remove duplicated code for synthetic array members.
Summary:
The code for GetSyntheticArrayMemberFromPointer and
GetSyntheticArrayMemberFromArray was identical, so just collapse the
the methods into one.

Reviewers: granata.enrico, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 230708
2015-02-26 23:55:39 +00:00
Bruce Mitchener 44949ff3e1 [swig] Fix some typos in the build scripts.
Reviewers: zturner, ki.stfu

Reviewed By: zturner, ki.stfu

Subscribers: ki.stfu, lldb-commits

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

llvm-svn: 230706
2015-02-26 23:53:49 +00:00
Chaoren Lin b6cd5fe918 Fix Bug 20400
Summary:
http://llvm.org/bugs/show_bug.cgi?id=20400

The default triple of i686-pc-linux-gnu for 32 bit linux targets is compatible
but not necessarily identical to the inferior binaries.

Applying Azat Khuzhin's solution of using ArchSpec::IsCompatibleMatch() instead
of ArchSpec::IsExactMatch() when comparing ObjectFile and Modules architecture.

Reviewers: vharron

Subscribers: lldb-commits

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

llvm-svn: 230694
2015-02-26 22:15:16 +00:00
Chaoren Lin 3011680752 Add synchronization to TestWatchLocation.
Summary:
There was no guarantee that the three threads haven't already exited by the
time the watchpoint is set.

Reviewers: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 230691
2015-02-26 21:31:27 +00:00
Oleksiy Vyalov b071bee295 Use getProcessTriple inside HostInfoBase::ComputeHostArchitectureSupport instead of getDefaultTargetTriple.
http://reviews.llvm.org/D7893

llvm-svn: 230674
2015-02-26 20:02:13 +00:00
Chaoren Lin f591f69fc3 Can't set watchpoints on launching threads on Linux LLGS.
Summary:
They'll be set anyway when the thread starts running, so the launching threads
should just ignore the set request.

Reviewers: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 230671
2015-02-26 19:48:15 +00:00
Siva Chandra 9aaab55800 Fix a typo Debugger::ExecuteIOHanders to Debugger::ExecuteIOHandlers.
Test Plan: Build LLDB.

Reviewers: zturner, vharron, clayborg

Reviewed By: vharron, clayborg

Subscribers: jingham, lldb-commits

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

llvm-svn: 230663
2015-02-26 19:26:36 +00:00
Enrico Granata b523deaa38 Fix a bug where LLDB could be convinced to attempt to extract a bitfield of size 0, and consequently crash
llvm-svn: 230661
2015-02-26 19:00:23 +00:00
Ilia K 69b95f49f1 Fix handling of double quotes (MI)
Summary:
* Clean CMICmdArgValString::Validate: now it's based on CMIUtilString::SplitConsiderQuotes method:
A bit of introduction:
# Command line is wrapped into CMICmdArgContext.
# CMICmdArgSet is a set of arguments to be parsed. This class contains CMICmdArgContext as a private member.
# MI command is class which is inhereted from CMICmdBase. It contains CMICmdArgSet as a private member.

When command is executed CMICmdBase::ParseArgs() is called. This method adds args for parsing using CMICmdArgSet::Add(). Then CMICmdBase::ParseValidateCmdOptions() is called, which calls CMICmdArgSet::Validate(). Then it gets a number of arguments (using SplitConsiderQuotes().array_length) and for each arguments registered in ParseArgs() tries to validate it using CMICmdArgValBase::Validate(). Every user commands parses this string again (first time it was made in SplitConsiderQuotes) and in case of CMICmdArgValString it was made incorrectly. It searches the first and last quotes (but it should be first and next after first). Besides, it was splitted into 4 cases. 
I'm just using SplitConsiderQuotes directly, and I don't split them by hand again. 

Actually, I think we should do so in every CMICmdArgVal_XXX::Validate() method.

* Enable MiInterpreterExecTestCase.test_lldbmi_target_create test
* Fix MiExecTestCase.test_lldbmi_exec_arguments_set test

All tests pass on OS X.

Reviewers: abidh, emaste, zturner, clayborg

Reviewed By: clayborg

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

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

llvm-svn: 230654
2015-02-26 18:21:22 +00:00
Ilia K da86749a92 Fix process's output to stdout/stderr (MI)
Summary:
* Add CMIUtilString::Escape/Unescape methods (MI)
* Fix process's output to stdout/stderr (MI):
lldb-mi escapes process's output to show it in the following format:
```
~"..."
```

But previously not all characters were escaped by CMICmnLLDBDebuggerHandleEvents::ConvertPrintfCtrlCodeToString and output of
```
printf("'\n` - it's \\n\x12\"\\\"")
```
looked like:
```
~"'\r\n` - it's \n"\""
```

This patch fixes it by using CMIUtilString::Escape method and now it looks like:
```
~"'\r\n` - it's \\n\x12\"\\\""
```

Reviewers: abidh, emaste, clayborg

Reviewed By: clayborg

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

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

llvm-svn: 230652
2015-02-26 18:14:30 +00:00
Ilia K b791226136 Fix comments in tools/lldb-mi/MIDriver.h
llvm-svn: 230648
2015-02-26 17:59:44 +00:00
Bruce Mitchener 832a28c945 [swig] Generate bindings for SBDebugger::*UseColor().
Summary:
These functions were added in 2013, but not added to the SWIG
bindings.

Reviewers: ki.stfu, clayborg

Reviewed By: ki.stfu, clayborg

Subscribers: lldb-commits

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

llvm-svn: 230646
2015-02-26 17:46:16 +00:00
Ilia K 48fd3f62b9 Fix usage of shared_ptr for array which may cause a undefined behaviour (use unique_ptr instead)
llvm-svn: 230630
2015-02-26 13:28:58 +00:00
Robert Flack e08dc42a73 Test commit - fix typo.
llvm-svn: 230629
2015-02-26 13:03:57 +00:00
Tamas Berghammer 2d52afd71c Increase default packet timeout for android to 20s
Differential revision: http://reviews.llvm.org/D7853

llvm-svn: 230626
2015-02-26 11:37:21 +00:00
Oleksiy Vyalov fb9015ddaa Return a current executable's directory from HostInfoAndroid::ComputeSupportExeDirectory.
http://reviews.llvm.org/D7876

llvm-svn: 230604
2015-02-26 02:50:14 +00:00
Enrico Granata 99b0a9cdd7 If we are trying to load the scripting resource for a module whose name happens to be a Python keyword, then prefix the filename with an _ (e.g. a module named def will load _def.py)
Fixes rdar://13893506

llvm-svn: 230602
2015-02-26 01:37:26 +00:00
Greg Clayton bc63aaccf7 Optimize finding the Complete Definition of an ObjC class for debug with .o files with lots of .o files.
When we have a debug map we have an executable with a bunch of STAB symbols and each source file has a N_SO symbol which scopes a bunch of symbols inside of it. We can use this to our advantage here when looking for the complete definition of an objective C class by looking for a symbol whose name matches the class name and whose type is eSymbolTypeObjCClass. If we find one, that symbol will be contained within a N_SO symbol. This symbol gets turned into a symbol whose type is eSymbolTypeSourceFile and that symbol will contain the eSymbolTypeObjCClass which helps us to locate the correct .o file and allows us to only look in that file.

To further accelerate things, if we are looking for the implementation, we can avoid looking at all .o files if we don't find a matching symbol because we have a debug map, which means the objective C symbol for the class can't have been stripped, so we can safely not search all remaining .o files. This will save us lots of time when trying to look for "NSObject" and any other AppKit and Foundation classes that we never have implementation definitions for.

<rdar://problem/19234225>

llvm-svn: 230562
2015-02-25 22:41:34 +00:00
Oleksiy Vyalov 6801be3354 Add qModuleInfo request in order to get module information (uuid, triple,..) by module path from remote platform.
http://reviews.llvm.org/D7709

llvm-svn: 230556
2015-02-25 22:15:44 +00:00
Zachary Turner 49be160531 Revert "Fix warnings found with clang-cl."
SWIG doesn't like enum : unsigned.  Revert this until I can
fix this in a way that swig likes.

llvm-svn: 230531
2015-02-25 19:52:41 +00:00
Zachary Turner 00998f0beb Solve hang on Windows when lldb fails to launch the process.
The DebuggerThread was detecting the launch error, but it was
ignored by ProcessWindows::DoLaunch, causing LLDB to wait forever
in the debugger loop.

This fixes the test case that explicitly attempts to launch a
process from a non-existant path.

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

llvm-svn: 230523
2015-02-25 18:56:47 +00:00
Zachary Turner 171d943ac5 Fix warnings found with clang-cl.
Earlier this week I was able to get clang-cl on Windows to be
able to self host.  This opened the door to being able to
get a whole new slew of warnings for the Windows build.

This patch fixes all of the warnings, many of which were real
bugs.

llvm-svn: 230522
2015-02-25 18:42:47 +00:00
Greg Clayton 1e28adfe75 MacOSX symbol table change to combine the N_GSYM debug map entry with the "_OBJC_CLASS_$_", "_OBJC_METACLASS_$_", and "_OBJC_IVAR_$_" non debug symbols. This allows the symbol that represents the object file to contain the eSymbolTypeObjCClass and eSymbolTypeObjCMetaClass and will help us to be able to efficiently lookup the real definition of an objective C class without loading all .o files linearly to find the .o file that contains the true definition.
llvm-svn: 230509
2015-02-25 17:25:02 +00:00
Greg Clayton 2d9ce1926c Fix the dumping of symbol tables to be correctly alligned for all entries when using "image dump symtab".
llvm-svn: 230508
2015-02-25 17:22:05 +00:00
Hafiz Abid Qadeer ed69e30d68 Add missing "return" statements.
ExecutionContext::GetAddressByteSize() was calling GettAddressByteSize () on Target and Process class but was ignoring the return type. I have added the missing return.
No regression in the test suite. Committed as obvious.

llvm-svn: 230502
2015-02-25 16:01:12 +00:00
Tamas Berghammer 765b5e5bfe Remove use_pthread option from getBuildFlags in the test environment
Removing the option to require the usage of pthread based on an argument
of the getBuildFlags method in lldbtest.py because it can be specified
by a variable in the makefile for the given test case. Using the
variable in the makefile works in all supported platforms.

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

llvm-svn: 230493
2015-02-25 13:26:28 +00:00
Tamas Berghammer 14f4476a88 Truncate target file for stdout and stderr
Add O_TRUNC when opening file for redirecting stdout and stderr of the
process. It is neccessary because if the file exists then on some
platform the original content is kept while it isn't overwritten by the
new data causing pollution of the saved stdout and stderr.

llvm-svn: 230492
2015-02-25 13:21:45 +00:00
Tamas Berghammer 37099e87cb Fix global makefiles for the tests to support android
Two changes are required to compile the tests for android
* Disable the usage of -lpthread as it is included by default on
  android
* Add -pie to the linker flags because android only support position
  independent executables

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

llvm-svn: 230487
2015-02-25 13:02:08 +00:00
Tamas Berghammer 6723ecb552 Add option to set environment variables from dotest.py
Setting environment variables are required when testing on a remote
target requiring different flags then the ones specified on the host OS.

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

llvm-svn: 230485
2015-02-25 12:22:40 +00:00
Ilia K 249420d099 Fix comment in test/tools/lldb-mi/main.cpp
llvm-svn: 230481
2015-02-25 11:04:40 +00:00
Pavel Labath 7257d28025 Skip symlinks to the original file when searching for debug info
Summary:
Symbols::LocateExecutableSymbolFile tries to locate the file in containing the debug info in a
splitdebug configuration. It tries to skip over the original file in its search path, but it was
easily fooled by symlinks. This changes the function to use llvm::sys::fs::equivalent, which can
correctly compare symlinks.

As a side effect, I had to fix one test because the address for the "abort" function resolves on
my system to "__GI_abort" now. With the debug info, the libc on my system contains two symbols
associated with the address of the abort function, and lldb prefers __GI_abort, possibly because
the debug info is associated with it. It would be nice at some point to have it prefer the public
symbol name.

Reviewers: emaste, zturner

Subscribers: lldb-commits

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

llvm-svn: 230476
2015-02-25 10:44:35 +00:00
Ilia K 4dc4ed0a2a Add extra acceptable characters to CMICmdArgValFile (MI)
Summary:
Improve CMICmdArgValFile::IsValidChars to accept extra characters that can be in file name:
```
.'\"`@#$%^&*()_+-={}[]| 
```

Enable MiSyntaxTestCase.test_lldbmi_specialchars test.

All test pass on OS X.

Reviewers: abidh, emaste, zturner, clayborg

Reviewed By: clayborg

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

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

llvm-svn: 230468
2015-02-25 06:34:05 +00:00
Ilia K a5de1433b7 Fix MiSignalTestCase.xxx_remote tests after r230466
llvm-svn: 230467
2015-02-25 06:29:48 +00:00
Ilia K 8e4f69ba54 Fix ImportError in lldb-mi tests on Linux
Summary:
This patch fixes the following error:
```
 File "/home/llvmbb/llvm-build-dir/lldb-x86_64-clang-ubuntu-14.04/llvm/tools/lldb/test/tools/lldb-mi/signal/TestMiSignal.py", line 5, in <module>
    import lldbmi_testcase
ImportError: No module named lldbmi_testcase
```

Reviewers: vharron, abidh, clayborg

Reviewed By: abidh, clayborg

Subscribers: lldb-commits, vharron, clayborg, abidh

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

llvm-svn: 230466
2015-02-25 06:21:35 +00:00
Ilia K e20ede26d2 Fix CommandLineCompletionTestCase.test_watchpoint_xxx tests after r230408
llvm-svn: 230463
2015-02-25 05:47:10 +00:00
Jason Molenda 671a29d30d When FileSpec::Resolve is given a bare file like "ls",
and llvm::sys::fs::make_absolute prepends the current
working directory to that path, leave the original
bare file name unchanged if $cwd/ls doesn't exist.

http://reviews.llvm.org/D7477
<rdar://problem/18775190>

llvm-svn: 230451
2015-02-25 02:35:25 +00:00
Oleksiy Vyalov 946e39a8d1 Fix logging in GDBRemoteCommunicationServerPlatform.
llvm-svn: 230418
2015-02-25 01:11:38 +00:00
Greg Clayton 7d1069d09e If you try to auto-complete "target symbols<TAB>" you get "target symbolsadd" instead of "target symbols ".
Fix this by returning the fact that the "symbols" word is complete if there is nothing else to complete after the "symbols" word.

<rdar://problem/19164599>

llvm-svn: 230408
2015-02-25 00:32:43 +00:00
Greg Clayton 688a3005cf Fixed Xcode project after recent changes:
"After recent changes, some code has become redundant. This revision tries to remove
the un-used code and tidy up the rest.

Following 4 files have been removed. I have updated CMake files and checked that it builds
fine on Linux and Windows. Can somebody update the xcode related file accordingly?

tools/lldb-mi/MICmnStreamStdinLinux.cpp
tools/lldb-mi/MICmnStreamStdinLinux.h
tools/lldb-mi/MICmnStreamStdinWindows.cpp
tools/lldb-mi/MICmnStreamStdinWindows.h"

llvm-svn: 230401
2015-02-24 23:50:21 +00:00
Zachary Turner d64412beb8 [CMake] Clean up lldb-mi CMakeLists.txt.
It was maintaining two huge file lists that are identical except
for 1 file.  Make this work the proper way.

llvm-svn: 230398
2015-02-24 23:36:12 +00:00
Oleksiy Vyalov c282ebd724 Fix qLaunchGDBServer packet parsing in GDBRemoteCommunicationServerPlatform.
llvm-svn: 230390
2015-02-24 22:23:39 +00:00
Zachary Turner 030b8cb413 Resubmit "[CMake] Change lldbAPI to be a CMake OBJECT library."
This resubmits r230380.  The primary cause of the failure was
actually just a warning, which we can disable at the CMake level
in a followup patch on the LLVM side.  The other thing which was
actually an error on the bot should be able to be fixed with
a clean.

llvm-svn: 230389
2015-02-24 22:17:57 +00:00
Zachary Turner 0980447a5f Revert "[CMake] Change lldbAPI to be a CMake OBJECT library."
This reverts commit r230380.  It causes CMake to fail on certain
machines with an error about needing to use string(STRIP_GENEX).

llvm-svn: 230382
2015-02-24 21:28:01 +00:00
Zachary Turner f4f8740eb0 [CMake] Change lldbAPI to be a CMake OBJECT library.
An OBJECT library is a special type of CMake library that produces
no archive, has no link interface, and no link inputs.  It is like
a regular archive, just without the physical output.  To link
against an OBJECT library, you reference it in the *source* file
list of a library using the special syntax $<TARGET_OBJECTS:lldbAPI>.
This will cause every object file to be passed to the linker
independently, as opposed to a single archive being passed to the
linker.

This is *extremely* important on Windows.  lldbAPI exports all of the
SB classes using __declspec(dllexport).  Unfortunately for technical
reasons it is not possible (well, extremely difficult) to get the
linker to propagate a __declspec(dllexport) attribute from a symbol
in an object file in an archive to a DLL that links against that
archive.  The solution to this is for the DLL to link the object files
directly.  So lldbAPI must be an OBJECT library.

This fixes an issue that has been present since the duplicated
lldbAPI file lists were removed, which would cause linker failures.

As a side effect, this also makes LLDB_DISABLE_PYTHON=1 work again
on Windows, which was previously totally broken.

llvm-svn: 230380
2015-02-24 20:58:39 +00:00
Zachary Turner c50508fe81 [CMake] Don't automatically copy python27.dll.
This is generating problems when you have built both debug and
release python.  For now I just want to get CMake to work, I
will work on a more robust fix later.  In the meantime you may
need to copy python27(_d).dll manually to ninja\bin after
building.

llvm-svn: 230379
2015-02-24 20:58:24 +00:00
Ilia K ff115f0ea4 Add comment in MiSignalTestCase.test_lldbmi_stopped_when_stopatentry_local back and revert expecting string.
llvm-svn: 230351
2015-02-24 17:54:34 +00:00
Hafiz Abid Qadeer 2cc248e2c9 Adjust an lldb-mi test to fix failure on Linux.
llvm-svn: 230347
2015-02-24 17:20:43 +00:00
Hafiz Abid Qadeer 04b1b5dc9d Remove redundant code from lldb-mi.
Summary:
After recent changes, some code has become redundant. This revision tries to remove
the un-used code and tidy up the rest.

Following 4 files have been removed. I have updated CMake files and checked that it builds
fine on Linux and Windows. Can somebody update the xcode related file accordingly?

tools/lldb-mi/MICmnStreamStdinLinux.cpp
tools/lldb-mi/MICmnStreamStdinLinux.h
tools/lldb-mi/MICmnStreamStdinWindows.cpp
tools/lldb-mi/MICmnStreamStdinWindows.h

Reviewers: clayborg, ki.stfu

Reviewed By: clayborg, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 230345
2015-02-24 17:08:20 +00:00
Ilia K 2f85244553 Add -exec-abort command (MI); Don't exit on eStateExited
Summary:
Add -exec-abort command + test.

Also, I had fixed an error, when lldb-mi exits on eStateExited. With current patch we can re-run target:
```
-file-exec-and-symbols hello
^done
-exec-run
^running
*stopped,reason="breakpoint-hit"...
-exec-abort
^done
*stopped,reason="exited-normally"...    <- program exits
-exec-run                               <- run again
^running
*stopped,reason="breakpoint-hit"...
```

All tests pass on OS X.

Reviewers: zturner, emaste, abidh, clayborg

Reviewed By: abidh, clayborg

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

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

llvm-svn: 230321
2015-02-24 10:40:45 +00:00
Ilia K 327b6f5942 Fix MiSignalTestCase.test_lldbmi_stopped_when_stopatentry_xxx tests after r230237
llvm-svn: 230320
2015-02-24 10:34:34 +00:00
Tamas Berghammer 912800c400 Create ScopedTimeout class for GDBRemoteCommunication
This new class makes it easier to change the timeout of a
GDBRemoteCommunication instance for a short time and then restore it to
its original value.

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

llvm-svn: 230319
2015-02-24 10:23:39 +00:00
Vince Harron f7839220ee Fix typo that breaks FileSystem::IsLocal
llvm-svn: 230312
2015-02-24 05:24:12 +00:00
Vince Harron 294aeb9a40 Compile fix for FileSystem::IsLocal on Linux
llvm-svn: 230311
2015-02-24 05:14:49 +00:00
Jason Molenda 3f804513e7 Move the copy phases for the xpcservices bundles from the "LLDB"
target to the "desktop" target.  They aren't used for iOS builds.

llvm-svn: 230302
2015-02-24 03:21:38 +00:00
Enrico Granata 4ae3dda605 Update LLDB to read a newer format of Objective-C class information from the dyld shared cache
Also, since most of the time the lack of such information is a serious problem that hinders productive debugging, emit an actual user visible warning when this occurs (once per process)

Fixes rdar://19898507

llvm-svn: 230299
2015-02-24 02:11:06 +00:00
Greg Clayton 736888c84b Avoid crashing by not mmap'ing files on network mounted file systems.
This is implemented by making a new FileSystem function:

bool
FileSystem::IsLocal(const FileSpec &spec)

Then using this in a new function:

DataBufferSP
FileSpec::MemoryMapFileContentsIfLocal(off_t file_offset, size_t file_size) const;

This function only mmaps data if the file is a local file since that means we can reliably page in data. We were experiencing crashes where people would use debug info files on network mounted file systems and that mount would go away and cause the next access to a page that wasn't paged in to crash LLDB. 

We now avoid this by just copying the data into a heap buffer and keeping a permanent copy to avoid the crash. Updated all previous users of FileSpec::MemoryMapFileContentsIfLocal() in ObjectFile subclasses over to use the new FileSpec::MemoryMapFileContentsIfLocal() function.

<rdar://problem/19470249>

llvm-svn: 230283
2015-02-23 23:47:09 +00:00
Chaoren Lin e4bb0b3551 Newline after usage string for lldb-server.
llvm-svn: 230266
2015-02-23 21:48:42 +00:00
Zachary Turner d487bb12d9 [CMake] On Windows, require manual specification of python libs.
Embedding python with MSVC is very finicky, for reasons having
to do with the operating system's CRT, the implementation of
python itself on Windows, and even bugs in CMake.

One side effect of this is that we cannot rely on FindPythonLibs
and FindPythonInterp CMake functions to locate the correct
version of Python.  We must instead manually specify the location
of PYTHON_LIBRARY and PYTHON_INCLUDE_DIR.

As a side effect, this fixes building LLDB in release mode by
specifying -DCMAKE_BUILD_TYPE=Release, which was previously
broken.

llvm-svn: 230262
2015-02-23 21:20:59 +00:00
Ed Maste 56c7a19d41 Remove EOL whitespace from PlatformLinux
This reduces the noise when diffing PlatformFreeBSD and PlatformLinux.

llvm-svn: 230251
2015-02-23 20:18:37 +00:00
Hafiz Abid Qadeer cf0698987b Fix a problem where lldb-mi would not stop the debuggee after -exec-interrupt command.
Summary:
This revision fixes a problem where lldb-mi would not stop the execution after exec-interrupt call.
On Linux, SIGSTOP is used to stop the debuggee process. LLDB stopped the debuggee alright. But when
lldb-mi received the notification of stopping with reason as SIGSTOP, it would resume the process.
This was heppening in CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal. This function aslo
used hard coded numbers for signal istead of symbolic names.

This revision changes code to treat SIGSTOP reason as SIGINT. Also used symbolic names for signals
instead of numbers.

Reviewers: ki.stfu, clayborg

Reviewed By: ki.stfu, clayborg

Subscribers: zturner, lldb-commits

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

llvm-svn: 230237
2015-02-23 18:27:17 +00:00
Ed Maste ff1b5c4244 Add null RegisterContext assertions
This makes these failures slightly more obvious, avoiding the need to
run LLDB under a debugger or rely on a LLDB core.  I encountered these
while bringing up a new OS/arch combination.

llvm-svn: 230236
2015-02-23 18:12:20 +00:00
Ed Maste 3a8ab6ee2a Exit early from DumpELFProgramHeaders if parse fails
This matches the way DumpELFSectionHeaders is implemented and is
recommended by the LLVM coding conventions.

llvm-svn: 230228
2015-02-23 15:33:11 +00:00
Ed Maste aec140380f elf-core: correct "no sections" to "no segments."
The error reported here is that there are no phdr entries, so it's
referring to segments, not sections.

llvm-svn: 230227
2015-02-23 15:28:42 +00:00
Pavel Labath 9349671488 Disable file descriptor leak tests on python >=2.7.8
this version introduced an internal leak, which we cannot reasonably fix.

llvm-svn: 230215
2015-02-23 11:14:28 +00:00
Tamas Berghammer 0f86b74304 Fix the communication in qPlatform_[mkdir,chmod]
With the previous implementation the protocol used by the client and the
server for the response was different and worked only by an accident.
With this change the communication is fixed and the return code from
mkdir and chmod correctly captured by lldb. The change also add
documentation for the qPlatform__[mkdir,chmod] packages.

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

llvm-svn: 230213
2015-02-23 11:03:08 +00:00
Tamas Berghammer 04e6314cf4 Set error status when failed to catch stop after launch
Process::Launch try to catch a stop signal after launching a process. If
it is unsuccessful it destroy the process but previously still reported
that the process launched successfully. This behavior caused a
deadlock. With thic change the process launch error reported correctly.

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

llvm-svn: 230212
2015-02-23 10:59:54 +00:00
Pavel Labath dbb41cf418 Support evaluation of DWARF expressions setting CFA
Summary:
This patch enables evaluation of DWARF expressions setting the CFA during stack unwinding.

This makes TestSigtrampUnwind "almost" pass on linux. I am not enabling the test yet since the
symbol name for the signal trampoline does not get resolved properly due to a different bug, but
apart from that, the backtrace is sane.

I am unsure how this change affects Mac. I think it makes the unwinder prefer the DWARF unwind
plan instead of some custom platform-dependant plan. However, it does not affect the end result
- the stack unwinding works as expected.

Reviewers: jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 230211
2015-02-23 10:29:01 +00:00
Pavel Labath ab970f5e08 UnwindPlan::Row refactor -- add support for CFA set by a DWARF expression
Summary:
This change refactors UnwindPlan::Row to be able to store the fact that the CFA is value is set
by evaluating a dwarf expression (DW_CFA_def_cfa_expression). This is achieved by creating a new
class CFAValue and moving all CFA setting/getting code there. Note that code using the new
CFAValue::isDWARFExpression is not yet present and will be added in a follow-up patch. Therefore,
this patch should not change the functionality in any way.

Test Plan: Ran tests on Mac and Linux. No regressions detected.

Reviewers: jasonmolenda, clayborg

Subscribers: lldb-commits

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

llvm-svn: 230210
2015-02-23 10:19:16 +00:00
Jason Molenda 1bffef3b29 If constructed llvm_build_dir doesn't exist, retry as an iphoneos path.
llvm-svn: 230130
2015-02-21 06:13:51 +00:00
Zachary Turner fc21d41709 Add missing #include. This should fix the Windows build.
llvm-svn: 230128
2015-02-21 04:45:12 +00:00
Chandler Carruth 43edccdfe1 Update for Clang API change in r230123 -- lookup_result was always
const, there was never a need for lookup_const_result. Now that vestigal
type is gone, so switch LLDB to lookup_result and to use the
DeclContextLookupResult rather than the Const variant.

llvm-svn: 230126
2015-02-21 04:31:13 +00:00
Greg Clayton c32f3faae9 Add missing Xcode project files for MICmdCmdSymbol.cpp and MICmdCmdSymbol.h.
llvm-svn: 230110
2015-02-21 00:57:59 +00:00
Greg Clayton ee1b391275 Don't use:
#include <lldb/API/*>"

Please use:

#include "lldb/API/*"

llvm-svn: 230106
2015-02-21 00:39:13 +00:00
Greg Clayton 18232f7ecc Fix the test so it runs correctly when there are spaces in the path to the stdc++ library.
<rdar://problem/19297312>

llvm-svn: 230102
2015-02-21 00:28:32 +00:00
Greg Clayton 7ab0d6f443 Fix this test case so it runs correctly.
<rdar://problem/19286788>

llvm-svn: 230101
2015-02-21 00:23:36 +00:00
Siva Chandra 2da9cd26d6 Fix TestStubSetSID after unification in to a single lldb-server binary.
Summary:
lldb-server needs an explicit 'g' or 'p' argument now. Since lldb-server
is started as a gdbserver in this test, 'g' should be passed to it
explicitly.

Test Plan: ./dotest.py -p TestStubSetSID

Reviewers: flackr, ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 230082
2015-02-20 22:58:00 +00:00
Enrico Granata d02d1e0a04 This should fix the Windows build
llvm-svn: 230080
2015-02-20 22:43:17 +00:00
Enrico Granata b38ef8c2b6 Rename the "glob arguments" feature to "shell expand arguments"
This should not bring any feature change, except changing names of things here and there

llvm-svn: 230077
2015-02-20 22:20:30 +00:00
Greg Clayton b65c6299d4 Make sure things build for iOS after recent changes.
llvm-svn: 230076
2015-02-20 22:20:05 +00:00
Greg Clayton 338d0bdc96 Make sure the public state is eStateStopped when we return from SBTarget::LoadCore() by hijacking the public event queue so we can ensure that the event gets consumed and the public state of the process (StateType SBProcess::GetState()) returns eStateStopped.
llvm-svn: 230066
2015-02-20 21:51:06 +00:00
Enrico Granata 83a1437646 Start the refactoring of globbing
- Add Host::GlobArguments() to perform local-globbing
I implemented this on OSX and Windows in terms of argdumper (Windows implementation is essentially the same as the OSX version + a change in binary name and some string magic)
Other platforms did not specifically chime in, so I left it unimplemented for them for the time being. Please feel free to fill in the blanks

- Add Platform::GlobArguments() to support remote-globbing
For now, no feature change here - but now we have infrastructure to help GDBRemote targets to support globbing - and patches to that effect will follow

No visible feature change

llvm-svn: 230065
2015-02-20 21:48:38 +00:00
Greg Clayton 35824e36f5 Avoid a race condition when loading core files where the process might still be handling the eStateStopped event we post to the private state thread causing us to return from SBTarget::LoadCore() before the process is ready to have API calls used on it.
This fixes a crasher that could happen when loading core files from scripts.

llvm-svn: 230060
2015-02-20 20:59:47 +00:00
Enrico Granata c5515ef1bb Add the new file to the CMakeLists. This should appease the Windows bot
llvm-svn: 230049
2015-02-20 19:54:06 +00:00
Enrico Granata 8fdf78594e Add an OptionValueLanguage class
llvm-svn: 230046
2015-02-20 19:46:30 +00:00
Oleksiy Vyalov 7a9e76216b Introduce FileSystem::CalculateMD5AsString that supports any platform and make existing FileSystem::CalculateMD5 to use it.
http://reviews.llvm.org/D7771

llvm-svn: 230036
2015-02-20 18:34:03 +00:00
Ilia K b6f705b6ed Minor changes after r229901: move the CMICmdCmdStackSelectFrame to the end of header file
llvm-svn: 230028
2015-02-20 17:56:05 +00:00
Ilia K 57d71ac7b3 Forgot to remove initialization of MiTestCaseBase.mydir in r230022
llvm-svn: 230025
2015-02-20 17:21:57 +00:00
Ilia K 4e892f9c6c Refactor lldb-mi tests
Summary:
This patch includes following changes:
* split lldb-mi tests into separate folders. It will make our life simpler because we can modify a test program of certain test and don't worry about other tests
* a bit refactoring
* fix comments
* improve some tests

Reviewers: emaste, clayborg, abidh

Reviewed By: clayborg, abidh

Subscribers: clayborg, lldb-commits, emaste, abidh

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

llvm-svn: 230022
2015-02-20 16:34:33 +00:00
Ilia K c12d88dc8f Add -symbol-list-lines command (MI)
Summary:
Add -symbol-list-lines command + test.

All test passed on OS X.

Reviewers: emaste, abidh, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, abidh, emaste

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

llvm-svn: 230008
2015-02-20 13:07:41 +00:00
Pavel Labath c95f7e2a7c Refactor OptionValue::SetValueFromCString to use llvm::StringRef
Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 230005
2015-02-20 11:14:59 +00:00
Hafiz Abid Qadeer 6d87a9c09e Reduce number of threads in lldb-mi.
LLDB-mi have 3 threads.

1. Wait for input.
2. Process commands.
3. Process events.
This revision merges 1 & 2. Same thread waits on input and then process the
command. This way, no synchronization is needed between first and 2nd. Also it is
easy to check when to exit.

A lot of code will redundant and will be cleaned up gradually.

All lldb-mi tests pass with gcc and clang as test compiler. Also did minimal testing
on command line and works ok. The "quit" and "-gdb-exit" command close the application
without needing any further return.

Reviewed in http://reviews.llvm.org/D7746.

llvm-svn: 230003
2015-02-20 10:20:05 +00:00
Ilia K db9050fd49 Add -stack-select-frame command (MI)
Summary:
Add -stack-select-frame command + 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/D7765

llvm-svn: 229901
2015-02-19 19:26:52 +00:00
Pavel Labath 2a056d8f86 Factor out common URL handling code in PlatformRemoteGDBServer
Summary:
this also gets rid of a compiler warning in release builds by using a dynamically allocated
buffer. Therefore, a size assertion is not necessary (and probably should have been an error in
the first place).

Reviewers: tberghammer

Subscribers: lldb-commits

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

llvm-svn: 229878
2015-02-19 18:10:55 +00:00
Oleksiy Vyalov 8bc34f4d96 Prevent LLGS from crashing when exiting - make NativeProcessLinux to wait until ThreadStateCoordinator is fully stopped before entering ~NativeProcessLinux.
http://reviews.llvm.org/D7692

llvm-svn: 229875
2015-02-19 17:58:04 +00:00
Ilia K be5680f985 Fix usage of m_bThreadInvalid in -thread-info (MI)
llvm-svn: 229868
2015-02-19 16:33:16 +00:00
Ilia K b7bc561ac2 Add -stack-info-frame command (MI)
Summary:
Add -stack-info-frame command + test.

All tests pass on OS X.

Reviewers: emaste, clayborg, abidh

Reviewed By: abidh

Subscribers: lldb-commits, clayborg, emaste, abidh

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

llvm-svn: 229857
2015-02-19 15:14:17 +00:00
Pavel Labath b81e653dce Silence unused variable warnings in release builds
llvm-svn: 229843
2015-02-19 11:41:12 +00:00
Zachary Turner ee69a4bcd0 A few minor path fixes for Windows.
When launching argdumper, there are a few problems with the
current logic.  First, on Windows, the file is called
argdumper.exe, not argdumper.  Second, Windows paths have
backslashes in them, and JSON treats <backslash><char> as an
escape sequence.  To fix the second problem, on Windows we
convert backslashes to forward slashes, since backslash isn't
a valid filename character anyway this shouldn't be a problem.

llvm-svn: 229784
2015-02-18 23:59:11 +00:00
Vince Harron e837626173 Fix TestDataFormatter* on Linux
llvm::StringRef doesn't make a copy of a string, it just holds a
reference. When special_directions_stream went out of scope,
special_directions was holding on to a stale pointer.

Moving special_directions_stream into a higher scope to keep
special_directions pointing to a valid string.

llvm-svn: 229767
2015-02-18 23:16:51 +00:00
Vince Harron ef1df9ec73 Fixed TestProcessLaunch.py for remote targets
Just needed to copy stdio redirect files to/from target

llvm-svn: 229766
2015-02-18 23:16:09 +00:00
Vince Harron ed7cbb26e1 Fixed remaining remote target failures in TestSettings.py
needed to copy an output file back from remote target
skipped test that expects host env vars to be inherited by target
processes

llvm-svn: 229764
2015-02-18 23:14:49 +00:00
Vince Harron 1f4706c36e Fix SettingsCommandTestCase.test_set_error_output_path
target.error-path (and output-path) were getting resolved on the
local file system, which doesn't make any sense for remote targets

So this patch prevents file paths from being resolved on the host
system.

llvm-svn: 229763
2015-02-18 23:12:26 +00:00
Ed Maste 2e3b8c29c9 Add decorator for failure setting prompt on FreeBSD
llvm.org/pr22611

llvm-svn: 229745
2015-02-18 20:55:13 +00:00
Ed Maste 6fbde1f997 Add decorators for failing lldb-mi tests
Tests fail intermittently on FreeBSD and Linux, apparently due to
threading race conditions in lldb-mi.

See comments in http://reviews.llvm.org/D7529 and
http://reviews.llvm.org/D7727 for more information.

llvm.org/pr22411

llvm-svn: 229741
2015-02-18 20:31:30 +00:00
Ed Maste c566b59a56 Add decorator for process launch w/ glob not working on FreeBSD
llvm-svn: 229738
2015-02-18 20:17:21 +00:00
Ed Maste f490804227 Add decorators for failing lldb-mi tests
Tests fail intermittently on FreeBSD and Linux, apparently due to
threading race conditions in lldb-mi.

See comments in http://reviews.llvm.org/D7529 and
http://reviews.llvm.org/D7727 for more information.

llvm.org/pr22411

llvm-svn: 229737
2015-02-18 20:08:07 +00:00
Zachary Turner 568b0de170 Fix warning that not all control-paths return from function.
llvm-svn: 229718
2015-02-18 18:44:03 +00:00
Zachary Turner 39cc7d4437 Don't use AVX/XSTATE API on Windows.
CopyContext is necessary to safely get the XState, but LLDB doesn't currently
use the XState. CopyContext is available as of Windows 7 SP1, so it can't be
used on Vista.  Furthermore, it requires the Windows 8 SDK it compile,
making the baseline for compiling and running LLDB higher than necessary.

Patch by: Adrian McCarthy
Reviewed by: Zachary Turner
Differential Revision: http://reviews.llvm.org/D7572

llvm-svn: 229710
2015-02-18 18:04:50 +00:00
Ed Maste 4db1174f50 Add decorator for fd leak test failing on FreeBSD
An fd leak comes from Python on FreeBSD

FreeBSD ports PR: https://bugs.freebsd.org/197376
Python issue: https://bugs.python.org/issue23458

llvm-svn: 229704
2015-02-18 17:23:52 +00:00
Alex Denisov ced849a639 Fix broken link to 'Obtaining Commit Access'
llvm-svn: 229697
2015-02-18 16:51:30 +00:00
Tamas Berghammer 62ef8a5a88 Add missing exports file and remove unused ones
These files required by the excode project

Patch from: flackr <flackr@google.com>

llvm-svn: 229691
2015-02-18 16:14:02 +00:00
Tamas Berghammer c2c3d7185d Merge lldb-platform and lldb-gdbserver into a single binary
This commit merges lldb-platform and lldb-gdbserver into a single binary
of the same size as each of the previous individual binaries. Execution
mode is controlled by the first argument being either platform or
gdbserver.

Patch from: flackr <flackr@google.com>

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

llvm-svn: 229683
2015-02-18 15:39:41 +00:00
Ilia K e8b362a885 Fix make_symlink in case when symlink already exists (after r229517)
llvm-svn: 229682
2015-02-18 15:30:18 +00:00
Hafiz Abid Qadeer 5de6192e12 Fix line crossing 80 column border.
llvm-svn: 229681
2015-02-18 15:25:25 +00:00
Ilia K 335c29ed0b Fix typo in make_symlink after r229517. It fixes symlinks on a UNIX style platform.
llvm-svn: 229674
2015-02-18 14:16:48 +00:00
Tamas Berghammer 81e9239e07 Remove alias template from GDBRemoteCommunicationServerCommon
It is required because MSVC 2013 doesn't generate correct code for
template aliases.

llvm-svn: 229666
2015-02-18 11:37:46 +00:00
Hafiz Abid Qadeer 019ea8a7c0 Fix some warnings in MSVC build.
Platform.h was causing soem warning due to multiple defined maros.
It already has a define that excludes the singal.h but that was not being
used at correct place. It has been fixed now.

Tested by building on Windows(MSVC) and Linux(gcc).

llvm-svn: 229664
2015-02-18 11:12:11 +00:00
Hafiz Abid Qadeer dfbe605985 Fix a typo.
llvm-svn: 229663
2015-02-18 11:04:17 +00:00
Zachary Turner a12920a414 [CMake] Remove debug message from CMakeLists.txt
llvm-svn: 229592
2015-02-18 00:27:11 +00:00
Oleksiy Vyalov 891f88c1ac Fix TestAttachDenied.py remote execution on Linux.
http://reviews.llvm.org/D7659

llvm-svn: 229587
2015-02-17 23:37:19 +00:00
Oleksiy Vyalov 09daa881ea Make PlatformPOSIX::KillProcess to delegate to a remote platform if connected.
http://reviews.llvm.org/D7660

llvm-svn: 229577
2015-02-17 22:57:56 +00:00
Zachary Turner aeda626d80 [CMake] Create a custom target for generating extension module.
Previously we would create the extension module as a post-build
step of creating liblldb.  As part of this process, we created
symlinks and did other stuff.

This had several longstanding issues related to target
dependencies, such as not re-creating the symlink if liblldb.dll
failed to link, or if the build was Ctrl+C'ed from.

Then, the script that creates the symlinks began to grow to
include other things, such as argdumper, and it would try to
create symlinks before it had finished building the targets it
needed to symlink to.

This patches addresses all of these problems by creating an
explicit target for the script to run, and making it have a
dependency on all the targets it needs to create symlinks from/to.

llvm-svn: 229569
2015-02-17 22:20:29 +00:00
Zachary Turner 7513e82075 Remove the CMake duplication for liblldb.
Previously the CMake had a lot of duplication for the public API
due to some differences regarding how we link on Windows.  This
fixes the issue, so making changes to the public API should be
much easier now.

llvm-svn: 229568
2015-02-17 22:20:20 +00:00
Zachary Turner 7a234a5bbc Add LLDB_API to all of the public API class definitions.
You cannot export a class from a DLL without this on
Windows, so it was causing lldb-mi to fail to link
after recent changes.

Please make sure to include this at the start of every
public type in the future.

llvm-svn: 229523
2015-02-17 19:36:25 +00:00
Ilia K bb0d5aba8e Fix argdumper build in cmake (OS X) after r228636
Previos version of this patch (see r229148) contained two errors:
* make_symlink_darwin_debug passes 2 arguments into make_symlink, but it required 4 arguments (was fixed by r229159)
* make_symlink doesn't work on OS X

As a quick fix, the r229148 and the r229159 were reverted. Now these errors are fixed.

Summary:
This patch fixes the following tests on OS X:

```
  FAIL: test_with_dsym (TestLaunchWithGlob.LaunchWithGlobTestCase)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 456, in wrapper
      return func(self, *args, **kwargs)
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 21, in test_with_dsym
      self.do_test ()
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 42, in do_test
      self.runCmd("process launch -G true -w %s -- fi*.tx?" % (os.getcwd()))
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 1953, in runCmd
      msg if msg else CMD_MSG(cmd))
  AssertionError: False is not True : Command 'process launch -G true -w /Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob -- fi*.tx?' returns successfully
  Config=x86_64-clang
  ======================================================================
  FAIL: test_with_dwarf (TestLaunchWithGlob.LaunchWithGlobTestCase)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 473, in wrapper
      return func(self, *args, **kwargs)
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 28, in test_with_dwarf
      self.do_test ()
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 42, in do_test
      self.runCmd("process launch -G true -w %s -- fi*.tx?" % (os.getcwd()))
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 1953, in runCmd
      msg if msg else CMD_MSG(cmd))
  AssertionError: False is not True : Command 'process launch -G true -w /Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob -- fi*.tx?' returns successfully
```

Reviewers: epertoso, emaste, abidh, clayborg, zturner

Reviewed By: clayborg

Subscribers: abidh, lldb-commits, emaste, epertoso, zturner, clayborg

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

llvm-svn: 229517
2015-02-17 18:25:27 +00:00
Zachary Turner 51f96eeb24 Revert "Revert "I had recently added a new SBFrame::GetVariables() overload with yet another bool argument""
Reverting this commit led to other failures which I did not see at
first.  This turned out to be an easy problem to fix, so I added
SBVariablesOptions.cpp to the CMakeLists.txt.  In the future please
try to make sure new files are added to CMake.

llvm-svn: 229516
2015-02-17 17:55:50 +00:00
Zachary Turner b3b8922cad Revert "I had recently added a new SBFrame::GetVariables() overload with yet another bool argument"
This reverts commit r228975.  It was causing link errors
on the Windows bots, since last Thursday.

http://lab.llvm.org:8011/builders/lldb-x86-win7-msvc/builds/725

Conflicts:
	lldb.xcodeproj/project.pbxproj

llvm-svn: 229514
2015-02-17 17:42:05 +00:00
Pavel Labath 646b064543 Use CloseOnExec in Platform::PutFile
Summary:
This does not fix any outstanding issue that I know of, but there is no reason these files should
_not_ have CloseOnExec.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 229506
2015-02-17 16:07:52 +00:00
Chaoren Lin caf3114245 Send default register number instead of GDB register number in StopReplyPacket.
Summary:
Using GDB register numbers confuses ProcessGDBRemote since the rest of
LLGS (qRegisterInfo, p, P) uses the default register numbers instead.

Test Plan: dosep.py --options --arch x86 ...

Reviewers: ovyalov, vharron, sivachandra

Subscribers: lldb-commits

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

llvm-svn: 229505
2015-02-17 15:41:28 +00:00
Chaoren Lin 6a504f6ea8 Watchpoint debug registers should work in i386 as well.
llvm-svn: 229504
2015-02-17 15:41:26 +00:00
Chaoren Lin e0c6ab5947 Fix small assignment mistake.
llvm-svn: 229503
2015-02-17 15:41:23 +00:00
Pavel Labath df50f9440d Handle trailing spaces on "settings set" command more correctly
Summary:
Currently we have some settings which treat "\ " on settings set commands specially. E.g., it is
a valid way of specifying an argument of " " to a target. However, this fails if "\ " is the last
argument as CommandObjectSettingsSet strips trailing whitespace. This resulted in a surprising
argument of "\" to the target.

This patch disables the training whitespace removal at a global
level. Instead, for each argument type we locally determine whether whitespace stripping makes
sense. Currently, I strip whitespace for all simple object type except of regex and
format-string, with the rationale that these two object types do their own complex parsing and we
want to interfere with them as least as possible. Specifically, stripping the whitespace of a
regex "\ " will result in a (surprising?) error "trailing backslash". Furthermore, the default
value of dissasembly-format setting already contains a trailing space and there is no way for the
user to type this in manually if we strip whitespace.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 229382
2015-02-16 13:13:39 +00:00
Ilia K 6188448299 Rename MiStackTestCase tests according to "test_lldbmi_<command_name>" format
llvm-svn: 229380
2015-02-16 13:00:59 +00:00
Tamas Berghammer c6ec76e38f Disable LaunchNativeProcess in PlatformLinux for non Linux hosts
llvm-svn: 229379
2015-02-16 12:59:49 +00:00
Tamas Berghammer 1c6a1ea9b2 Enable process launching on android from lldb-gdbserver
Currently it is uses the same code used on linux. Will be replaced with
android specific code if needed.

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

llvm-svn: 229371
2015-02-16 10:34:30 +00:00
Chaoren Lin a06c799729 Fix TestRegisters on remote target.
Summary:
Using spawnSubprocess instead of forkSubprocess, so that the subprocess
spawns on the target and not the host.

Requires http://reviews.llvm.org/D7660 for cleanup.

Test Plan: TestRegisters.py passing.

Reviewers: ovyalov, vharron, clayborg

Subscribers: lldb-commits

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

llvm-svn: 229357
2015-02-16 06:17:51 +00:00
Oleksiy Vyalov 71d08b3f2d Extract SBAttachInfo into own set of files - SBAttachInfo.h, SBAttachInfo.cpp and SBAttachInfo.i.
llvm-svn: 229346
2015-02-16 00:04:19 +00:00
Ismail Pazarbasi 323e3b6ae0 os.remove shouldn't fail, if file doesn't exist
Summary:
os.remove might throw an exception (of type OSError), if given file
doesn't exist. Catch the exception, and ignore it //iff// errno is
ENOENT. Rethrow the exception, if errno is not ENOENT.

Reviewers: emaste

Subscribers: llvm-commits

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

llvm-svn: 229334
2015-02-15 21:50:28 +00:00
Greg Clayton 60038bebf1 Correctly handle N_INDR nlist entries and don't rely on the trie information in order to reproduce them since this dyld trie info can be missing.
<rdar://problem/19749670>

llvm-svn: 229201
2015-02-14 00:51:13 +00:00
Jason Molenda c980fa92eb Change the default disassembly format again. First attempt at
changing it was in r219544 - after living on that for a few 
months, I wanted to take another crack at this.

The disassembly-format setting still exists and the old format
can be user specified with a setting like

${current-pc-arrow}${addr-file-or-load}{ <${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>}: 

This patch was discussed in http://reviews.llvm.org/D7578

<rdar://problem/19726421>

llvm-svn: 229186
2015-02-13 23:24:21 +00:00
Ilia K a7e79c1b44 Fix build: revert r229148 "Fix argdumper build in cmake (OS X) after r228636" and r229159 "Fix build: make_symlink_darwin_debug passes 2 arguments into make_symlink, but it requires 4 arguments"
llvm-svn: 229166
2015-02-13 22:30:11 +00:00
Ilia K 98c22539f2 Fix build: make_symlink_darwin_debug passes 2 arguments into make_symlink, but it requires 4 arguments
llvm-svn: 229159
2015-02-13 21:54:52 +00:00
Ilia K 14a92711ce Fix argdumper build in cmake (OS X) after r228636
Summary:
This patch fixes the following tests on OS X:

```
  FAIL: test_with_dsym (TestLaunchWithGlob.LaunchWithGlobTestCase)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 456, in wrapper
      return func(self, *args, **kwargs)
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 21, in test_with_dsym
      self.do_test ()
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 42, in do_test
      self.runCmd("process launch -G true -w %s -- fi*.tx?" % (os.getcwd()))
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 1953, in runCmd
      msg if msg else CMD_MSG(cmd))
  AssertionError: False is not True : Command 'process launch -G true -w /Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob -- fi*.tx?' returns successfully
  Config=x86_64-clang
  ======================================================================
  FAIL: test_with_dwarf (TestLaunchWithGlob.LaunchWithGlobTestCase)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 473, in wrapper
      return func(self, *args, **kwargs)
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 28, in test_with_dwarf
      self.do_test ()
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 42, in do_test
      self.runCmd("process launch -G true -w %s -- fi*.tx?" % (os.getcwd()))
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 1953, in runCmd
      msg if msg else CMD_MSG(cmd))
  AssertionError: False is not True : Command 'process launch -G true -w /Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob -- fi*.tx?' returns successfully
```

Reviewers: epertoso, emaste, abidh, clayborg, zturner

Reviewed By: clayborg

Subscribers: abidh, lldb-commits, emaste, epertoso, zturner, clayborg

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

llvm-svn: 229148
2015-02-13 20:28:27 +00:00
Vince Harron 4a8abd3f94 Fix TestProcessIO.py when run against a remote target
Fixed test case to copy redirected stdout/stderr files from remote
target to host

llgs wasn't bothering to put the pty master file handle in the right
place if stdout/stderr were redirected to a file. It is still needed
for stdin.

Corrected some log message text

llvm-svn: 229141
2015-02-13 19:15:24 +00:00
Ilia K 069dafa4df Add test that checks (gdb) prompt in case of unknown command (MI)
llvm-svn: 229139
2015-02-13 19:13:42 +00:00
Ilia K 576a4a7ea4 Fix test_lldbmi_prompt test by enabling ShowPrompt in CMICmnStreamStdin by default
llvm-svn: 229137
2015-02-13 19:11:39 +00:00
Ilia K b4a110f051 Fix -data-read-memory-bytes command (MI)
Summary:
* Add IsHexadecimalNumber method to CMIUtilString (MI)
* Add number format (dec,hex,auto) to CMICmdArgValNumber (MI)
* Fix -data-read-memory-bytes to pass address in hex format (MI)
* Fix output begin/end/offset fields format in -data-read-memory-bytes
* Fix CMICmdArgValNumber::ExtractNumber to extract 64bit value
* + tests

All tests passed on OS X

Reviewers: abidh, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, zturner, clayborg, abidh

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

llvm-svn: 229132
2015-02-13 18:42:25 +00:00
Ilia K a4897fe79c Add missing prompt when command doesn't exist (MI)
It fixes the following example:
```
$ bin/lldb-mi --interpreter
(gdb)
-not-found
^error,msg="Driver. Received command '-not-found'. It was not handled. Command 'not-found' not in Command Factory"
-not-found
^error,msg="Driver. Received command '-not-found'. It was not handled. Command 'not-found' not in Command Factory"
```

After the fix it looks like:
```
$ bin/lldb-mi --interpreter
-not-found
^error,msg="Driver. Received command '-not-found'. It was not handled. Command 'not-found' not in Command Factory"
(gdb)
-not-dounf
^error,msg="Driver. Received command '-not-dounf'. It was not handled. Command 'not-dounf' not in Command Factory"
(gdb)
```

llvm-svn: 229131
2015-02-13 18:36:48 +00:00
Ilia K cc39d3f4bd Fix Arg0 argument after r229110. The problem was that Arg0ValueChangedCallback isn't twitching when Arg0 was updated, therefore target was launched with empty 1st argument or without it at all. In this patch I update Arg0 by hand.
llvm-svn: 229125
2015-02-13 17:07:55 +00:00
Ilia K 8f37ca56d6 Add -exec-arguments command
Summary:
This patch adds -exec-arguments command for lldb-mi. -exec-arguments command allows to specify arguments for executable file in MI mode. Also it contains tests for that command.

Btw, new added files was formatted by clang-format.

Reviewers: abidh, zturner, clayborg

Reviewed By: clayborg

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

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

llvm-svn: 229110
2015-02-13 14:31:06 +00:00
Tamas Berghammer f5f2ace211 Fix configure+make build broken by r228943 (part 2)
llvm-svn: 229104
2015-02-13 12:27:24 +00:00
Hafiz Abid Qadeer 095b128671 Fix for http://llvm.org/bugs/show_bug.cgi?id=21744
GetVariableInfo () collected the values of the variable in a list. But it also
tried to generate the name/value pairs for children. This caused generation of
a wrong value string for may items. This function has been fixed to put value in
the list only.

The handling of --print-value related option has been moved to caller.

GetVariableInfo2 and MIResponseFormVariableInfo3 have been removed. They were
almost the duplicate of functions of similar names. I dont see any difference in
the output of -stack-list-locals and -stack-list-arguments. So these functions
just seemed unnecessary.

Char variable was being printed as a string which caused garbage output. This has
been fixed.

Some misc. cleanup.

Test cases have been added that check -stack-list-locals for struct, array and
pointers. Modified other tests which depended on hard coded line numbers.

Reviewed in http://reviews.llvm.org/D7589

llvm-svn: 229102
2015-02-13 11:53:50 +00:00
Ilia K c9a475d447 Fix build after r229094: replace llvm/PassManager.h -> llvm/IR/LegacyPassManager.h
llvm-svn: 229100
2015-02-13 10:49:18 +00:00
Tamas Berghammer e3c3135463 Fix configure+make build broken by r228943
llvm-svn: 229098
2015-02-13 10:39:23 +00:00
Chandler Carruth 80b5f793e1 Disable a warning for the python modules as the python C API headers
trigger this warning. With this, 'ninja' succeeds without warnings for
me on Linux.

llvm-svn: 229096
2015-02-13 10:22:00 +00:00
Chandler Carruth d066d3a7b4 Fix the last two warnings I see on Linx building 'lldb': mismatched
signed and unsigned types in comparisons.

For the text offset, use the addr_t type that is used elsewhere to get
these kinds of offsets, and which it is being compared against. This
seems to make things more consistent.

For the other, the numbers are clearly small and uninteresting, so just
cast them to the most boring 'int' type.

llvm-svn: 229085
2015-02-13 08:16:15 +00:00
Chandler Carruth 40927d0dcd Fix four missing 'override' specifiers found with the Clang
'-Winconsistent-missing-override' warning. I suggest folks use this to
ensure that override is consistently used to mark virtual function
overrides.

llvm-svn: 229084
2015-02-13 08:07:00 +00:00
Chandler Carruth f7888ab386 Remove an unused variable found with a Clang warning.
llvm-svn: 229083
2015-02-13 08:04:18 +00:00
Greg Clayton d6346e6f3e Add a ModuleList::ForEach(...) which takes the module list mutex calls the std::function argument with each module. If you return true in the callback, iteration will continue, if you return false, iteration will stop and the lock will be released.
<rdar://problem/19213054>

llvm-svn: 229008
2015-02-13 01:19:24 +00:00
Enrico Granata e0d951db44 I had recently added a new SBFrame::GetVariables() overload with yet another bool argument
We talked about it internally - and came to the conclusion that it's time to have an options class

This commit adds an SBVariablesOptions class and goes through all the required dance

llvm-svn: 228975
2015-02-12 23:09:17 +00:00