Commit Graph

10284 Commits

Author SHA1 Message Date
Greg Clayton 7bd4c60043 Abstract the details from regex.h a bit more by not allowing people to specify compile and execute flags for regular expressions. Also enable better regular expressions if they are available by check if the REG_ENHANCED is available and using it if it is.
Since REG_ENHANCED is available on MacOSX, this allow the use of \d (digits) \b (word boundaries) and much more without affecting other systems.

<rdar://problem/12082562>

llvm-svn: 226704
2015-01-21 21:51:02 +00:00
Kate Stone 2136ace961 Fixed a makefile rule used by several tests
Now quotes dsymutil path, required when running tests where the toolchain is in a path that contains a space

llvm-svn: 226695
2015-01-21 19:30:00 +00:00
Zachary Turner 02b882a69b Revert "Some fixes for linking Python on Windows."
This reverts commit r226679.  For some reason it was
not generating the same behavior as manually specifying
the include dir, library path, and exe path, and it was
causing the test suite to fail to run.

llvm-svn: 226683
2015-01-21 18:30:40 +00:00
Zachary Turner f3a7da349c Some fixes for linking Python on Windows.
CMake FindPythonLibs will look for multiple versions of Python
including both debug and release, and build up a list such as
(debug <debugpath> optimized <optimizedpath>).  This confuses
the logic we have in CMake to copy the correct python dll to
the output directory so that it need not be in your system's PATH.

To alleviate this, we manually split this list and extract out
the debug and release versions of the python library, and copy
only the correct one to the output directory.

llvm-svn: 226679
2015-01-21 17:53:10 +00:00
Enrico Granata ed3228aa5f Allow individual ValueObjects to pick their preferred display language
Most of the time, we can use context information just fine to choose a language (i.e. the language of the frame that the root object was defined in, if any); but in some cases, synthetic children may be fabricated as root frame-less entities, and then we wouldn't know any better

This patch allows (internal) synthetic child providers to set a display language on the children they generate, should they so choose

llvm-svn: 226634
2015-01-21 01:47:13 +00:00
Jason Molenda e527c5810c Adding compact unwind as a source of unwind information
introduced subtle bugs in two places in 
RegisterContextLLDB::GetFullUnwindPlanForFrame where 
it specifically wanted to get an eh_frame unwind plan
and was using "Get CallSite UnwindPlan" as synonymous
with that.  But now we have two different types of 
unwind plan that can be returned in that case, and
compact unwind won't behaves as needed.

<rdar://problem/19528559> 

llvm-svn: 226631
2015-01-21 01:26:28 +00:00
Zachary Turner 83887fb7dc Fix some platform specific paths in TestSettings.py.
We were referring to hardcoded paths /bin/ls and /bin/cat.  For
the purposes of this test, the actual value it's set to doesn't
matter, and it might as well be a non-existent path.  All that
matters is that the before and after values have to match, and
that trailing whitespace is stripped.  On Windows FileSpec
(correctly) converts /bin/ls to D:\bin\ls though, so the before
and after values won't match.  So this patch just correctly builds
up a valid path in a platform-agnostic manner, and verifies that
it matches before and after the set.

llvm-svn: 226625
2015-01-21 00:40:27 +00:00
Greg Clayton 6746950645 Add missing case statement to quiet a compiler warning.
llvm-svn: 226617
2015-01-20 22:41:14 +00:00
Zachary Turner 0c426319f6 XFAIL pexpect tests on Windows.
At some point we will need to either provide a pexpect equivalent
on Windows, or provide some other method of doing out-of-process
tests.

Even with a pexpect replacement, it may be worth re-evaluating
some of these tests to see if they would be better served as
in-process tests.  The larger issue of coming up with a pexpect
replacement on Windows is tracked in http://llvm.org/pr22274.

llvm-svn: 226614
2015-01-20 22:36:03 +00:00
Greg Clayton e72ea04b4d Remove unused function:
lldb::pid_t
Host::LaunchApplication (const FileSpec &app_file_spec);

This had use of a function FSPathMakeRef(const UInt8*, FSRef *, ...) that was deprecated in 10.8. 

Removing this fucntion since it wasn't used and was causing warnings.

llvm-svn: 226608
2015-01-20 21:05:21 +00:00
Greg Clayton 87e36a7a08 Update the deployment target on MacOSX to be 10.8. The change is mainly to get the REG_ENHANCED stuff in regex.h and shouldn't affect other targets.
llvm-svn: 226607
2015-01-20 20:45:49 +00:00
Zachary Turner 2d53c31eb7 Don't remove backslashes from arguments unless the following char is recognized.
This fixes file paths on Windows, as you can now write, for example,
file d:\foo\bar.txt, but does not break the case that this tokenization
logic was originally designed for, which is to allow escaping of things
like quotes and double quotes, so that all of the escapable characters
can appear in the same string together.

Reviewed by: Jim Ingham, Greg Clayton
Differential Revision: http://reviews.llvm.org/D7018

llvm-svn: 226587
2015-01-20 17:53:36 +00:00
Ed Maste 135f6abd48 Fix help test cases after r226068
From: Ilia K <ki.stfu@gmail.com>
Differential Revision: http://reviews.llvm.org/D7066

llvm-svn: 226568
2015-01-20 15:13:01 +00:00
Jason Molenda 3bc66f1f47 Fix creation of StringRef in FileSpec::ResolveUsername()
so it doesn't assume that the SmallVector<char> will have
nul terminator.  It did not in at least one case.
Caught by ASAN instrumentation.

llvm-svn: 226544
2015-01-20 04:20:42 +00:00
Jason Molenda 65e0642d03 Don't mention a "--core-file" argument to target create. It is
"--core".

<rdar://problem/19518164> 

llvm-svn: 226543
2015-01-20 03:06:17 +00:00
Greg Clayton ee3626ec16 Added an Xcode target so we build the "lldb-mi" executable as part of the "desktop" and "desktop no xpc" targets.
Include paths were switched to be user include paths, if this breaks the linux build we will need to fix the Makefiles/cmake stuff.

<rdar://problem/19198581> 

llvm-svn: 226530
2015-01-20 00:04:26 +00:00
Jim Ingham d5ac1ab65d Fix a race condition where you could set the selected thread & target in the
CommandInterpreter's execution context AFTER the process had started running
and before it initially stopped.  Also fixed one test case that was implicitly
using this (and an abuse of the async mode) to accidentally succeed.

<rdar://problem/16814726>

llvm-svn: 226528
2015-01-19 23:51:51 +00:00
Vince Harron db93444f26 Print out the full output of gtest
This patch fixes a bug that prevented all gtest output from being
displayed.

Submitted for Tamas Berghammer

llvm-svn: 226477
2015-01-19 18:18:24 +00:00
Vince Harron 81f0746cac Fixed Linux build error in gtest
llvm-svn: 226471
2015-01-19 17:31:22 +00:00
Chandler Carruth 215d939ada Update to reflect the API change to createMCSymbolizer in LLVM r226416.
This should fix the LLDB build since that change.

llvm-svn: 226427
2015-01-19 03:07:25 +00:00
Nico Weber 74e7fb9aae Try to fix the Windows build after r226362.
llvm-svn: 226372
2015-01-17 06:32:54 +00:00
Enrico Granata 5b8cacdb5f Commit fix for a static analyzer issue where a string pointer could theoretically be NULL..
llvm-svn: 226366
2015-01-17 02:46:20 +00:00
Vince Harron eb303ee5df Added Connection::GetURI()
This function returns a URI of the resource that the connection is connected to. This is especially important for connections established by accepting a connection from a remote host.

Also added implementations for ConnectionMachPort, ConnectionSharedMemory, 
Also fixed up some documentation in Connection::Write
Renamed ConnectionFileDescriptorPosix::SocketListen to ConnectionFileDescriptorPosix::SocketListenAndAccept
Fixed a log message in Socket.cpp

Differential Review: http://reviews.llvm.org/D7026

llvm-svn: 226362
2015-01-17 02:20:29 +00:00
Jason Molenda 35c998718c Add comments explaining the unwind setup in
ABIMacOSX_i386::CreateFunctionEntryUnwindPlan, 
ABIMacOSX_i386::CreateDefaultUnwindPlan,
ABISysV_x86_64::CreateFunctionEntryUnwindPlan,
ABISysV_x86_64::CreateDefaultUnwindPlan

llvm-svn: 226347
2015-01-16 23:54:15 +00:00
Enrico Granata 8bfb5544cf Several improvements to the shush script
llvm-svn: 226343
2015-01-16 23:16:22 +00:00
Vince Harron ded5ff6fce Compile fix for WIN32
llvm-svn: 226301
2015-01-16 19:07:30 +00:00
Enrico Granata baa15585ca Add a utility script that executes an inferior process tucking its output away somewhere safe, and not letting error messages escape
This has potential to be useful in build automation environments

llvm-svn: 226300
2015-01-16 18:59:54 +00:00
Greg Clayton ef5c9503e3 Take extra care to ensure we don't deref a NULL pointer.
llvm-svn: 226299
2015-01-16 18:59:48 +00:00
Vince Harron 76861ea8f7 minor refactoring to remove unneeded/unspecific header files
Differential review: http://reviews.llvm.org/D6919

llvm-svn: 226249
2015-01-16 06:47:43 +00:00
Jason Molenda bcc5785958 Fixes to DNBArchImpl in debugserver to correctly get/set
the register state when debugging AArch32 programs (armv7
programs running on an armv8 processor).  Most notably,
there is no "fpscr" register in the register context -
there is an fpsr and an fpcr.

Also fix a bug where the floating point values could not
be written in armv7 processes.
<rdar://problem/18977767> 

llvm-svn: 226244
2015-01-16 02:31:35 +00:00
Vince Harron 014bb7da79 Add Socket::Get[Remote/Local]IpAddress and unit tests
Differential Revision: http://reviews.llvm.org/D6917

llvm-svn: 226234
2015-01-16 00:47:08 +00:00
Nico Weber 0a3a7ccb3a Give lldb a clean null build.
`ninja lldb` used to always run "echo -n", which on OS X results in literally
echoing "-n" to the screen.  Just remove the command from add_custom_target,
then it only adds an alias and `ninja lldb` now reports "no work to do".

Other than that, no intended behavior change.

llvm-svn: 226233
2015-01-16 00:35:05 +00:00
Jason Molenda 3f194f7997 Add comment regarding which i386 registers are non-volatile instead of
just pointing to the standard document regarding this.

llvm-svn: 226231
2015-01-16 00:27:25 +00:00
Zachary Turner f194c50fc3 Some fixes for thread stepping on Windows.
This hooks up the changes necessary to set the trap flag on the
CPU and properly manage the process and thread's resume state
and private state so that the ThreadPlan does its thing.

Stepping still doesn't work as of this change, because there are
some issues with stack frames where it doesn't update the thread's
frame list correctly when it breaks inside of a function, but
I will try to fix that separately.

llvm-svn: 226221
2015-01-15 22:54:08 +00:00
Zachary Turner 8f3f7beac4 During source manager test, write back the file using binary mode.
On Windows, opening with "w" opens it as text instead of binary.
This causes translation of newline characters, so that "\n" turns
into "\r\n", which in turn leads to git detecting that the file
has changed and wanting to commit it.

llvm-svn: 226220
2015-01-15 22:53:44 +00:00
Greg Clayton d237ae4b2f Fixed the regex test case after recent modifications to the "help" command output.
<rdar://problem/18527567>

llvm-svn: 226218
2015-01-15 22:52:17 +00:00
Vince Harron e6c5dcf512 UriParser - fixed potential buffer overrun
Switched from ::strtoul to StringConvert::ToUInt32
Changed port output parameter to be -1 if port is unspecified

llvm-svn: 226204
2015-01-15 20:57:01 +00:00
Vince Harron 5275aaa0cc Moved Args::StringToXIntYZ to StringConvert::ToXIntYZ
The refactor was motivated by some comments that Greg made
http://reviews.llvm.org/D6918

and also to break a dependency cascade that caused functions linking
in string->int conversion functions to pull in most of lldb

llvm-svn: 226199
2015-01-15 20:08:35 +00:00
Nico Weber 92b25b9649 Fix a -Wnull-conversion warning.
llvm-svn: 226181
2015-01-15 17:55:24 +00:00
Nico Weber f37054fbde Fix build after clang r226128.
llvm-svn: 226180
2015-01-15 17:51:05 +00:00
Sylvestre Ledru a9a57804ea In commit clang r226096, DefinitionRequired has been removed. Do the same in lldb implementation
llvm-svn: 226162
2015-01-15 11:50:50 +00:00
Jim Ingham d919163a69 Fix a little thinko in r226017 - the code to actually add the demangled name to the Mangled object got
moved into the #else branch of the #if/#elif/#endif, so it wasn't getting done in the #if case anymore.

Keep the code to add the demangled name outside of the #if, and then just free the demangled_name
and set it back to NULL in the Windows case.

<rdar://problem/19479499>

llvm-svn: 226088
2015-01-15 03:34:31 +00:00
Greg Clayton f7bb1fba36 Don't crash when we can't find a block for some reason, just try and do the right thing and fail gracefully.
<rdar://problem/19196221>

llvm-svn: 226087
2015-01-15 03:13:44 +00:00
Greg Clayton 103f309504 Don't crash when we run into lexical block address range problems, just ignore the bad ranges and log an error message asking the user to file a bug.
<rdar://problem/19021931>

llvm-svn: 226085
2015-01-15 03:04:37 +00:00
Greg Clayton 2501e5e2ea Modified LLDB to be able to lookup global variables by address.
This is done by adding a "Variable *" to SymbolContext and allowing SymbolFile::ResolveSymbolContext() so if an address is resolved into a symbol context, we can include the global or static variable for that address.

This means you can now find global variables that are merged globals when doing a "image lookup --verbose --address 0x1230000". Previously we would resolve a symbol and show "_MergedGlobals123 + 1234". But now we can show the global variable name.

The eSymbolContextEverything purposely does not include the new eSymbolContextVariable in its lookup since stack frame code does many lookups and we don't want it triggering the global variable lookups.

<rdar://problem/18945678> 

llvm-svn: 226084
2015-01-15 02:59:20 +00:00
Ed Maste 19c55b5d12 Fix build after r226068: cannot initialize 'int' with 'nullptr_t'
llvm-svn: 226076
2015-01-15 02:07:28 +00:00
Jim Ingham d762df8c24 Make sure that when a breakpoint is hit but its condition is not met,
the hit count is not updated.
Also, keep the hit count for the breakpoint in the breakpoint.  We were
using just the sum of the location's hit counts, but that was wrong since if a shared library is
unloaded, and the location goes away, the breakpoint hit count should not suddenly drop
by the number of hits there were on that location.

llvm-svn: 226074
2015-01-15 01:41:04 +00:00
Kate Stone a487aa4cdb Three related changes to help:
The default help display now shows the alias collection by default, and hides commands whose named begin with an underscore.  Help is primarily useful to those unfamiliar with LLDB and should aim to answer typical questions while still being able to provide more esoteric answers when required.  To that latter end an argument to include the hidden commands in help has been added, and instead of having a help flag to show aliases there is now one to hide them.  This final change might be controversial as it repurposes the -a shorthand as the opposite of its original meaning.

The previous implementation of OutputFormattedHelpText was easily confused by embedded newlines.  The new algorithm correctly breaks on the FIRST newline or LAST space/tab before the target column count rather than treating all whitespace interchangeably.

Command interpreters now have the ability to specify help prologue text and a command prefix string.  Neither are used in the current LLDB sources but are required to support REPL-like extensions where LLDB commands must be prefixed and additional help text is required to explain how to access traditional debugging commands.

<rdar://problem/17751929>
<rdar://problem/16953815>
<rdar://problem/16953841>
<rdar://problem/16930173>
<rdar://problem/16879028>

llvm-svn: 226068
2015-01-15 00:52:41 +00:00
Enrico Granata 02d87608c1 Reenable the logic to take an integer value and attempt to "po" it as an ObjC object
While there is quite a bit of potential for mishaps due to tagged pointers, and after quite some internal discussion, this seems a saner behavior given how "po" stands for "print OBJECT". The argument being that we should make at least some sensible attempt to print the thing the user passed as-if it was an object

Fixes rdar://19423124

llvm-svn: 226062
2015-01-14 23:58:18 +00:00
Zachary Turner d46476b52a Only set the StopInfo on Windows if the stop is valid for this thread.
llvm-svn: 226054
2015-01-14 22:58:19 +00:00
Zachary Turner 4f1a39584e Don't try to link libpthread on Windows.
llvm-svn: 226053
2015-01-14 22:58:09 +00:00
Zachary Turner 12947b7e25 Fix a number of tests on Windows.
These fix various issues with path handling and disable a few tests
which use features of LLVM which are not yet supported on Windows.

llvm-svn: 226042
2015-01-14 21:42:53 +00:00
Greg Clayton 6e7ab02cff Specify ObjC++ when running heap commands in case we are stopped in a frame with another language.
This ensures the expression gets runs with the correct language.

<rdar://problem/18816647>

llvm-svn: 226041
2015-01-14 21:37:19 +00:00
Vince Harron 4d2857321d Fixes compilation/run error with BUILD_SHARED_LIBS=TRUE
BUILD_SHARED_LIBS=TRUE currently isn't working for Linux x86_64
This patch fixes the link errors and also some runtime errors

Test Plan:
CC=clang CXX=clang++ cmake -GNinja -DBUILD_SHARED_LIBS=TRUE -DCMAKE_LINKER=ld.gold -DCMAKE_BUILD_TYPE=Debug ../../llvm
ninja
ninja check-lldb

llvm-svn: 226039
2015-01-14 21:01:15 +00:00
Ed Maste 55f74e829b test: Add workaround for FreeBSD libedit vs readline issue
If stdout is not a terminal Python executes
    rl_variable_bind ("enable-meta-key", "off");

This produces a warning with FreeBSD's libedit because the
enable-meta-key variable is unknown.  Not an issue on Apple because
cpython commit f0ab6f9f0603 added a #ifndef __APPLE__ around the call.
See http://bugs.python.org/issue19884 for more information.

For now we just discard the warning output to get the tests working
again on FreeBSD.

llvm-svn: 226037
2015-01-14 20:32:33 +00:00
Greg Clayton 456f2712b3 Typing "gui" will crash programs that don't give LLDB a real terminal.
We now verify that the debugger's input file is a valid terminal file descriptor before allowing the "gui" command to try to run. 

Xcode would crash if you typed "gui" at the command line prior to this fix.

<rdar://problem/18775851>

llvm-svn: 226027
2015-01-14 19:45:21 +00:00
Zachary Turner a45fa2ccaa Implement demangling on Windows.
llvm-svn: 226017
2015-01-14 18:34:43 +00:00
Zachary Turner e2dcbd001c Add null pointer checks to some SBStream functions.
llvm-svn: 226016
2015-01-14 18:34:35 +00:00
Oleksiy Vyalov 4771829225 Extend PipePosix with support for named pipes/timeout-based IO and integrate it with GDBRemoteCommunication / lldb-gdbserver - include reviews fixes.
http://reviews.llvm.org/D6954

llvm-svn: 225923
2015-01-14 01:31:27 +00:00
Jason Molenda bed7f07080 Save & restore the array of which registers have already been
saved/restored across a mid-function epilogue.  We ignore 
repeated push/pops of a register so once we saw one 'pop %rbp',
we'd ignore it the second time we saw it.
<rdar://problem/19417410>

llvm-svn: 225853
2015-01-13 23:48:53 +00:00
Oleksiy Vyalov d5f8b6a6ca Extend PipePosix with support for named pipes/timeout-based IO and integrate it with GDBRemoteCommunication / lldb-gdbserver.
http://reviews.llvm.org/D6954

llvm-svn: 225849
2015-01-13 23:19:40 +00:00
Greg Clayton 332e8b1cd4 Fixed an issue where if the operating system python plug-in is changed at runtime, it wouldn't cause the process to reload the new operating system plug-in, now it does.
This is currently controlled by a setting:

(lldb) settings set target.process.python-os-plugin-path <path>

Or clearing it with:

(lldb) settings clear target.process.python-os-plugin-path 

The process will now reload the OperatingSystem plug-in.

This was implemented by:
- adding the ability to set a notify callback for when an option value is changed
- added the ability for the process plug-in to load the operating system plug-in on the fly
- fixed bugs in the Process::GetStatus() so all threads are displayed if their thread IDs are larger than 32 bits
- adding a callback in ProcessProperties to tell when the "python-os-plugin-path" is changed by the user
- fixing a crasher in ProcessMachCore that happens when updating the thread list when the OS plugin is reloaded

llvm-svn: 225831
2015-01-13 21:13:08 +00:00
Jason Molenda 26cc634dbf Enhance the eh_frame unwind instruction augmenter so that
it will do the right thing on x86 routines with a mid-function
epilogue sequence (where the unwind rules need to be reinstalled
after the epilogue has completed).
<rdar://problem/19417410> 

llvm-svn: 225773
2015-01-13 07:39:03 +00:00
Jason Molenda 91805e6f56 Add an additional check to UnwindAssembly_x86::AugmentUnwindPlanFromCallSite
which will verify if the eh_frame instructions include details about
the prologue or not.  Both clang and gcc include prologue instructions
but there's no requirement for them to do so -- and I'm sure we'll
have to interoperate with a compiler that doesn't generate prologue
info at some point.

I don't have any compilers that omit the prologue instructions so the
testing was of the "makre sure augmented unwind info is still created".
With an eh_frame without prologue, this code should reject the 
augmentation scheme altogether and we should fall back to using assembly
instruction profiling.

llvm-svn: 225771
2015-01-13 06:07:07 +00:00
Jason Molenda 34549b8f75 Change the x86 assembly instruction unwind parser to
step through the complete function looking for any epilogue
instructions.  If we find an epilogue sequence, re-instate
the correct unwind instructions if there is more code past
that epilogue -- this will correctly handle an x86 function
with multiple epilogues in it.

NB there is still a bug with the "eh_frame augmented" 
UnwindPlans and mid-function epilogues.  Looking at that next.

<rdar://problem/18863406> 

llvm-svn: 225770
2015-01-13 06:04:04 +00:00
Jason Molenda 5155e5070c Don't run functionalities/tty under sudo / as root.
The terminal window will be opened under the ownership
of the real userid and it won't be able to open the
socket talking back to lldb -- the testsuite will hang
here.

The same thing probably should be done for lldb when run
on a remote system over ssh.  I added a line for that 
but commented it out for now because I haven't
tested it.

llvm-svn: 225748
2015-01-13 00:54:59 +00:00
Oleksiy Vyalov 1777c12206 Fix XCode build on OSX - add OptionValueChar.cpp
http://reviews.llvm.org/D6941

llvm-svn: 225733
2015-01-12 23:50:51 +00:00
Zachary Turner 3e7442b676 Add support for character option types.
This will allow, in a subsequent patch, the addition of a global
setting that allows the user to specify a single character that
LLDB will recognize as an escape character when processing arg
strings to accomodate differences in Windows/non-Windows path
handling.

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

llvm-svn: 225694
2015-01-12 20:44:02 +00:00
Eric Christopher acbb6e64e8 More [-Werror,-Winconsistent-missing-override] fixes.
llvm-svn: 225651
2015-01-12 19:09:48 +00:00
Vince Harron 88f67808ae Fix for lldb-platform linking error on OSX/CMake
Tested on Linux and OSX

Submitted for Bob Campbell

llvm-svn: 225611
2015-01-11 18:38:25 +00:00
Vince Harron e38b24a72b Got C++ unit tests running on Linux again
llvm-svn: 225604
2015-01-11 09:42:12 +00:00
Jason Molenda 9e6d12b98c Add RegisterNumber.cpp.
llvm-svn: 225585
2015-01-10 10:39:27 +00:00
Jason Molenda 24b96b3a05 Forgot to include RegisterNumber.h in prev commit.
llvm-svn: 225579
2015-01-10 04:20:14 +00:00
Jason Molenda a05677126d Hoist the RegisterNumber class out of RegisterContextLLDB and make
it more generally available. 

Add checks to UnwindAssembly_x86::AugmentUnwindPlanFromCallSite() so
that it won't try to augment an UnwindPlan that already describes
the function epilogue.

Add a test case for backtracing out of _sigtramp on Darwin systems.
This could probably be adapted to test the same thing on linux/bsd but 
the function names of sigtramp and kill are probably platform
specific and I'm not sure what they should be.

llvm-svn: 225578
2015-01-10 04:01:03 +00:00
Greg Clayton ad6b82dd53 Add C++ breakpoint tests where names are partially specified to ensure we don't regress on this again.
Top of tree never regressed, but we have internal branches that we constantly merge and we need to make sure we don't regress.

<rdar://problem/19429907>

llvm-svn: 225572
2015-01-10 01:35:02 +00:00
Greg Clayton f44404407f Respect the fact that the result object claims it doesn't want to be interactive by not forwarding STDIN to the python invocation when it isn't desired.
This fixes an issue of running "script" commands via SBDebugger::HandleCommand(...) and SBCommandInterpreter::HandleCommand(...) deadlocking Xcode.

<rdar://problem/18075038>

llvm-svn: 225567
2015-01-10 00:42:12 +00:00
Siva Chandra 0f1b4997ce [TestInferiorAssert] Differentiate DWARF and DSYM tests with suffixes.
Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 225564
2015-01-10 00:25:23 +00:00
Stephane Sezer 24a14c93e6 Modify dotest.py to be able to run without an lldb build.
Summary: This will ease llgs development a bit by not requiring an lldb/lldb.py build to launch the tests. Also, we can now use LLDB_DEBUGSERVER_PATH to point to a debug server to use to run the tests. I used that to point to a ds2 build and run llgs tests against ds2.

Reviewers: clayborg, tfiala, vharron

Subscribers: lldb-commits

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

llvm-svn: 225549
2015-01-09 21:54:27 +00:00
Zachary Turner f16ae603e8 Fix issues with LLDB's interpreter and MS ABI guard variables.
MS ABI guard variables end with @4IA, so this patch teaches the
interpreter about that.  Additionally, there was an issue with
TurnGuardLoadIntoZero which was causing some guard uses of a
variable to be missed.  This fixes that by calling
Instruction::replaceAllUsesWith() instead of trying to replicate
that function.

llvm-svn: 225547
2015-01-09 21:12:22 +00:00
Zachary Turner 898e10e4d3 Change int32_t to uint32_t to fix warnings.
Variable was being declared as signed, but treated as unsigned at
every point of use.

Patch by Dan Sinclair
Differential Revision: http://reviews.llvm.org/D6897

llvm-svn: 225540
2015-01-09 20:15:21 +00:00
Zachary Turner 225cc30afe Change auto to size_t to fix warning.
Patch by Dan Sinclair
Differential Revision: http://reviews.llvm.org/D6899

llvm-svn: 225539
2015-01-09 20:15:03 +00:00
Enrico Granata 3f7f2077c3 Make the list of synthetic children thread safe
I have been seeing a few crashes where LLDB tries to acquire a cached synthetic child by index, and crashes in the ClusterManager obtaining a shared_ptr for that ValueObject
That kind of crash most often means that I am holding on to a raw pointer to a ValueObject that was let go from the cluster

The main way that could happen is that the synthetic provider is being updated at the same time that some child is being accessed from the previous provider state

This fixes the problem by making the children be stored in a thread-safe map

Fixes rdar://18627964

llvm-svn: 225538
2015-01-09 19:47:45 +00:00
Greg Clayton b547278cae Fixed an issue where you couldn't delete a user defined regex, python, or multi-word command by adding a new "command delete" command.
This new command will delete user defined regular commands, but not aliases. We still have "command unalias" to remove aliases as they are currently in different buckets. Appropriate error messages are displayed to inform the user when "command unalias" is used on removable user defined commands that points users to the "command delete" command.

Added a test to verify we can remove user defined commands and also verify that "command unalias" fails when used on a user defined command.
<rdar://problem/18248300>

llvm-svn: 225535
2015-01-09 19:08:20 +00:00
Siva Chandra 311c7db8e3 [InlineTest] getRerunArgs returns an empty string if the test was skipped.
Summary:
The main issue that this patch is trying to address is that the current
implementation of getRerunArgs of InlineTest relies on the attribute
'using_dsym' which could be absent if the test was skipped altogether.
[That is, if both dsym and dwarf tests were skipped.]

While at it, the use of deprecated Python module 'new' is eliminated.

Test Plan: [Linux] dotest.py -p TestExprPathSynthetic

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 225496
2015-01-09 01:54:44 +00:00
Enrico Granata 9aa7e8e9ff Dynamic values have been around (and stable and reliable) for long enough that we can turn them on by default
Change the default of prefer-dynamic-value to eDynamicDontRunTarget (i.e. enable dynamic values, but do not run code to do so)

Of course, disable this for the test suite, since testing no-dynamic-values is actually valuable

Fixes rdar://17363061

llvm-svn: 225486
2015-01-09 00:47:24 +00:00
Enrico Granata 20c321caf8 This patch fixes my think-o in ValueObject::UpdateValueIfNeeded() about the right thing to assert()
It also comes with a (rudimentary) test case that gets itself in a failed update scenario, and checks that we don't crash
This is the easiest case I could think of that forces the failed update case Zachary was seeing

llvm-svn: 225463
2015-01-08 19:11:43 +00:00
Mohit K. Bhakkad c9335a3f22 [LLDB][MIPS] Adding SoftwareBreakpointTrapOpcode and RelocationJumpSlotType for MIPS
Patch by Bhushan Attarde

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: petarj, dsanders, mohit.bhakkad, lldb-commits

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

llvm-svn: 225436
2015-01-08 09:46:29 +00:00
Jason Molenda 4535ecb1f3 Have AssemblyParse_x86::get_non_call_site_unwind_plan track
which registers have been spilled (saved to the stack) - and
if we see that same register being saved to the stack again,
don't record that, it's something specific to this stack frame.

I found a code sequence for i386 where clang did a push %esi
and then later in the function it did movl %esi, -0x7c(%ebp)
and that second save of a scratch value overrode the original
push location.

<rdar://problem/19171178> 

llvm-svn: 225431
2015-01-08 06:41:12 +00:00
Jason Molenda 341f0e6ee0 Rearrange RegisterContextLLDB::SavedLocationForRegister a tiny bit
so that we will use the UnwindPlan's rule for providing the stack
pointer BEFORE we use the trick of using the callee's CFA address
as the stack pointer.  When we're in a _sigtramp frame, the CFA of
the _sigtramp stack frame is not the same as the stack pointer value
when the async interrupt occurred -- we need to use the eh_frame
rules for retrieving the correct value.

<rdar://problem/18913548> 

llvm-svn: 225427
2015-01-08 03:57:48 +00:00
Vince Harron ede5965b2a Added documentation for test timeout
Differential Revision: http://reviews.llvm.org/D6669

Submitted for Chaoren Lin

llvm-svn: 225425
2015-01-08 02:11:26 +00:00
Enrico Granata 1a4d078583 Fix a problem where a ValueObject could fail to update itself, but since it was previously valid, we'd have an old checksum to compare aginst no new checksum (because failure to update), and assert() and die. Fix the problem by only caring about this assertion logic if updates succeed
llvm-svn: 225418
2015-01-08 00:29:12 +00:00
Greg Clayton 7099558499 Fix inlined test cases so they print out the correct command to run when they fail instead of printing out incorrect information.
To fix this I added a new method to TestBase:

    def getRerunArgs(self):
        return " -f %s.%s" % (self.__class__.__name__, self._testMethodName)
        
The InlineTest which inherits from TestBase then overrides this function with a custom version which does the right thing.

llvm-svn: 225407
2015-01-07 22:25:50 +00:00
Vince Harron 878a2ce554 lldb-platform - static link all llvm dependencies
Differential Revision: http://reviews.llvm.org/D6797

lldb-gdbserver statically links all llvm dependencies. This allows
dead stripping code and reduces total binary size.

This change modifies lldb-plaform to static link llvm dependencies
like lldb-gdbserver.

llvm-svn: 225398
2015-01-07 21:35:07 +00:00
Oleksiy Vyalov 0ddd41cd2d Make DynamicLoaderPOSIXDYLD::DidAttach to deduce a target executable by pid if no executable hasn't been assigned to a target so far.
http://reviews.llvm.org/D6740

llvm-svn: 225332
2015-01-07 01:28:37 +00:00
Vince Harron 3218c0fb94 Adds UriParser::Parse and unit tests
This can be used to parse URIs passed to 'platform connect'

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

llvm-svn: 225317
2015-01-06 23:38:24 +00:00
Greg Clayton 009597d048 Fix needed for the new terminal test I previously checked in. It was crashing due to a NULL dereference.
llvm-svn: 225316
2015-01-06 23:33:34 +00:00
Ed Maste b8602af602 Put FreeBSD note types in their own namespace
Note types are inherently OS-specific, but some note type names are
common to both FreeBSD and Linux. 

llvm-svn: 225299
2015-01-06 22:13:48 +00:00
Zachary Turner c8761f4807 Remove a lock acquisition from ProcessWindows::OnExitProcess.
This was causing a race condition where DoDestroy() would acquire
the lock and then initiate a shutdown and then wait for it to
complete.  But part of the shutdown involved acquiring the same
lock from a different thread.  So the main thread would timeout
waiting for the shutdown to complete and return too soon.

The end result of this is that SBProcess::Kill() was broken on
Windows.

llvm-svn: 225297
2015-01-06 20:56:12 +00:00
Greg Clayton 8646421daa Added a test case for launching a process in a separate terminal window to ensure we don't regress on this.
A recent POSIX host thread issue where HostThreadPosix::Join() wasn't returning the thread result was responsible for this regression, yet we had no test case covering this so it wasn't discovered.

llvm-svn: 225284
2015-01-06 19:17:58 +00:00
Greg Clayton ad7aa8147a More fixes to ensure if we are asked to launch a x86_64h process on darwin, that darwin-debug knows what to do and how to handle it.
llvm-svn: 225225
2015-01-06 00:25:18 +00:00