Commit Graph

10230 Commits

Author SHA1 Message Date
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