Commit Graph

8137 Commits

Author SHA1 Message Date
Jason Molenda 135e55f8f3 Fix log message for new invalidation checks in PlanValidAtAddress().
Thanks to Ed and Greg for catching the incorrect logging statements.

llvm-svn: 196322
2013-12-03 21:59:39 +00:00
Greg Clayton 2ec3db36f5 Updated the build settings for lldb-platform and lldb-gdbserver to include libxml2.
llvm-svn: 196320
2013-12-03 21:12:28 +00:00
Greg Clayton fd9acf6a48 Fix test to compile and run on iOS.
llvm-svn: 196313
2013-12-03 20:55:25 +00:00
Greg Clayton fa3082e728 Fixed up the framework includes to all be done in the extra linker options. We had a mix where some were being included via Xcode GUI and some were done in the extra linker flags.
llvm-svn: 196309
2013-12-03 19:41:45 +00:00
Greg Clayton aec167d79e Remove print statement when successfully setting the platform's working directory.
llvm-svn: 196308
2013-12-03 19:22:45 +00:00
Greg Clayton c6b26f0545 <rdar://problem/15566148>
Fix use of std::lower_bound to check for equality if a match is found to ensure we don't return the next breakpoint with an ID greater than the break_id that was asked for.

llvm-svn: 196298
2013-12-03 17:50:20 +00:00
Jason Molenda 977a191e5d #include <Python.h>, not <Python/Python.h>. The latter results in
the build being broken for people using the public Mac OS X 10.9 SDK, 
which does not have the Python framework any longer.  The Xcode project
file already sets the -I and -L flags correctly so that <Python.h> and
-lpython will work correctly with the system's installed Python.

llvm-svn: 196259
2013-12-03 09:01:57 +00:00
Jason Molenda 61cd0729bb Build up UnwindPlan::PlanValidAtAddress to recognize some general
indications that the UnwindPlan is invalid -- for instance, a
complete lack of rows, or a row that fails to define a register to
base the CFA off of.
<rdar://problem/15246247> 

llvm-svn: 196201
2013-12-03 04:46:27 +00:00
Jim Ingham 177553e4c0 Remove the bad assumption that breakpoint locations won't get deleted in BreakpointLocationList::FindByID.
<rdar://problem/15566148>

llvm-svn: 196197
2013-12-03 02:31:17 +00:00
Enrico Granata d28f5a54d9 A few more details on the DataVisualization class in our architectural doc. It is in dire need of expansion, but this is a start at least.
llvm-svn: 196176
2013-12-03 00:30:22 +00:00
Ed Maste 0471dcd274 Fix build on FreeBSD after r196141
This should probably be replaced with build infrastructure support for
a platform-specific canonical Python include path, but for now it should
restore the FreeBSD buildbot.

llvm-svn: 196167
2013-12-02 22:54:15 +00:00
Ed Maste f44e3cd7f1 Ensure parsed debug arange data is sorted
llvm.org/pr18114

llvm-svn: 196146
2013-12-02 20:16:30 +00:00
Greg Clayton 5fb8f79738 Fixed internal code to not link against and code from "lldb/API/*".
lldb_private::Debugger was #including some "lldb/API" header files which causes tools (lldb-platform and lldb-gdbserver) that link against the internals only (no API layer) to fail to link depending on which calls were being used.

Also fixed the current working directory so that it gets set correctly for remote test suite runs. Now the remote working directory is set to: "ARCH/TESTNUM/..." where ARCH is the current architecture name and "TESTNUM" is the current test number. 

Fixed the "lldb-platform" and "lldb-gdbserver" to not warn about mismatched visibility settings by having each have their own exports file which contains nothing. This forces all symbols to not be exported, and also quiets the linker warnings.

llvm-svn: 196141
2013-12-02 19:35:49 +00:00
Jean-Daniel Dupas 48a6060c2c Request for review: Fix build-llvm.pl
Summary:
- Stop to try to rebuild llvm on each invocation by removing the invalid library entry libLLVMArchive.a which no longer exists.
- Remove the useless ranlib invocation. "libtools -static" automatically takes care of the archive table of content.

CC: lldb-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2296

llvm-svn: 196128
2013-12-02 18:32:35 +00:00
Ed Maste c113ff8cba elf: Move elf note parsing to ObjectFileELF.cpp
Separate ELF note implementations were introduced for core files and
GNU build-id.  Move the more general one from elf-core to ObjectFileELF
and use it for build-id as well.

Review: http://llvm-reviews.chandlerc.com/D1902
llvm-svn: 196125
2013-12-02 17:49:13 +00:00
Ed Maste 094e1653cb test: Decorators for pr17910
A number of tests fail to build on FreeBSD because the test build script
defaults to libstdc++ for clang.  On FreeBSD the libstdc++ is rather old
and libc++ should be used instead.

(These tests previously had an @expectedFailureFreeBSD decorator for
pr16696, the umbrella PR for the lack of threaded inferior support on
FreeBSD.  The work to add that support will be committed soon.)

llvm-svn: 196101
2013-12-02 14:26:57 +00:00
Sylvestre Ledru 3b5b16cdff Also silent -Wno-cast-qual in the SWIG Python wrapper. Remove a huge number of warnings
llvm-svn: 195930
2013-11-28 18:11:34 +00:00
Colin Riley 909bb7a3f4 Fix MSVC build
Added _WIN32 guards to new platform features. Using correct SetErrorStringWithFormat within Host when LLDB_DISABLE_POSIX is defined. Also fixed an if defined block.

llvm-svn: 195766
2013-11-26 15:10:46 +00:00
Ed Maste 0d092a446b Add decorator for FreeBSD failing test due to pr18061
The test code locks mutexes from one thread and unlocks them from a
different one, which is not valid (it's either undefined behaviour or is
required to return an error).

See http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html

llvm-svn: 195707
2013-11-26 01:11:14 +00:00
Ed Maste 82a0005b21 Fix compile warnings
llvm-svn: 195685
2013-11-25 21:15:53 +00:00
Ed Maste 426285bfad Remove unused variable
llvm-svn: 195683
2013-11-25 20:48:07 +00:00
Ed Maste ac7270b56b Correct a standalone debug file path
For a file /bin/ls with a .gnu_debuglink entry of "ls.debug" the path
should be /usr/lib/debug/bin/ls.debug, not /usr/lib/debug/bin/ls.

ref: https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html

llvm.org/pr17903
http://llvm-reviews.chandlerc.com/D2169

llvm-svn: 195681
2013-11-25 20:33:56 +00:00
Ed Maste 3fe7186a1b Remove redundant assignment
llvm-svn: 195664
2013-11-25 17:16:34 +00:00
Ed Maste a2b2465e45 test: Fix punctuation in exceptions for log env vars
The Exception text was missing a closing parenthesis, and for consistency
with other Exceptions it should not end with a period.

llvm-svn: 195659
2013-11-25 16:57:16 +00:00
Ed Maste 6cf5b8f18c Fix issue from r166732 found by Andrew Kaylor
From Jim Ingham's email:
  It does look like ThreadPlanStepInRange test is some kind of thinko.
  In practice, in this case it is probably safe to run only one thread
  when doing the "step through" since that generally involved running
  from a shared library stub to its target.  That could deadlock if the
  dynamic loader has to fix up the symbol, and another thread is in the
  middle of doing that.  But that doesn't seem to be very common, or at
  least the code is clearly wrong but I haven't had any reports of this
  causing deadlocks...

llvm-svn: 195657
2013-11-25 16:36:47 +00:00
Ed Maste 502f9020a7 PT_CONTINUE and PT_STEP are process-scope on FreeBSD
Although ptrace() can be passed a PID or TID for PT_CONTINUE and PT_STEP,
the kernel operates on all threads in the process in both cases.  (See
the FOREACH_THREAD_IN_PROC in FreeBSD's sys_process.c:kern_ptrace.)

Make this clear by using the PID from the ProcessMonitor instance.

llvm-svn: 195656
2013-11-25 16:31:23 +00:00
Ed Maste 07b8d259dd test: Add decorator for FreeBSD watchpoint failure
Watchpoints have not yet been implemented for FreeBSD.
llvm.org/pr16706

llvm-svn: 195649
2013-11-25 15:38:26 +00:00
Jason Molenda 906f329724 Change lldb from building against a Python framework out of
the installed SDK to using the current OS installed headers/libraries.
This change is to address the removal of the Python framework
from the Mac OS X 10.9 (Mavericks) SDK, and is the recommended
workaround via https://developer.apple.com/library/mac/technotes/tn2328/_index.html

llvm-svn: 195557
2013-11-23 20:07:29 +00:00
Jason Molenda 612cb6ef2b Add --enable-cxx11 to llvm builds. As of r195239, SmallPtrSet.h /
SmallPtrSet.cpp use different methods if SmallPtrSet.h is included
in C++11 mode.  Building llvm in C++03 mode and lldb in C++11 mode
resulted in a link-time failure with the C++11-mode-specific method
not being found in the llvm build.

llvm-svn: 195544
2013-11-23 04:59:07 +00:00
Greg Clayton 5c6eab21eb Removed printf and puts calls that were left in accidentally.
llvm-svn: 195542
2013-11-23 02:01:06 +00:00
Greg Clayton fb90931b60 Improved platform support.
Improved the detection of a valid GDB server where we actually can connect to a socket, but then it doesn't read or write anything (which happens with some USB mux software).

Host::MakeDirectory() now can make as many intermediate directories as needed.

The testsuite now has very initial support for remote test suite running. When running on a remote platform, the setUp function for the test will make a new directory and select it as the working directory on the remote host. 

Added a common function that can be used to create the short option string for getopt_long calls.

llvm-svn: 195541
2013-11-23 01:58:15 +00:00
Greg Clayton 833d1295f9 <rdar://problem/15540233>
SBPlatform.h was missing from built LLDB.framework, now it is fixed.

llvm-svn: 195517
2013-11-22 23:32:57 +00:00
Greg Clayton b39751bc9f Patch from Todd Fiala for http://llvm.org/bugs/show_bug.cgi?id=17961
llvm-svn: 195500
2013-11-22 21:05:25 +00:00
Greg Clayton ec6829eac0 Patch from Todd Fiala: lldb will seg fault if for some reason there is no unwinder when StackFrameList::GetFramesUpTo() is called.
Mainly patched to stop LLDB from crashing. This can easily happen if you debug to a remote gdbserver that doesn't have any dynamic register info and you don't have a target definition file specified.

llvm-svn: 195499
2013-11-22 21:03:42 +00:00
Greg Clayton d4724cfdb1 Make sure the getopt variables are correctly initialized for any option parsing.
Added a new "--port-offset PORT" option to lldb-platform so it can be used with USB mux type scenarios.

llvm-svn: 195486
2013-11-22 18:55:04 +00:00
Greg Clayton 2b98c56996 Fixed functions to always reply to packets and added a port offset.
Fixed a bunch of issues with many functions that were added for the platform host IO calls where they might not reply to the packet if the packet was malformed.

Cleaned up error codes.

Added a port offset to allow for connections across a USB mux.

llvm-svn: 195485
2013-11-22 18:53:12 +00:00
Greg Clayton 3bd19fb07d Fix ePathTypeSupportExecutableDir for shallow bundle Darwin targets and add "host" logging for the different paths.
llvm-svn: 195484
2013-11-22 18:48:24 +00:00
Greg Clayton 8c8018d36f Only use a PTY master/slave when launching for local processes.
llvm-svn: 195483
2013-11-22 18:47:24 +00:00
Greg Clayton c029382690 Fix File::GetPermissions() to only return the permission bits.
llvm-svn: 195482
2013-11-22 18:46:55 +00:00
Greg Clayton 6d4130e7d9 Fix indentation.
llvm-svn: 195481
2013-11-22 18:46:16 +00:00
Ed Maste bf9b24edc3 Disable stop-hook test on FreeBSD as on Linux
It fails on the buildbot, so skip for now to reduce the noise.

llvm.org/pr15037

llvm-svn: 195459
2013-11-22 13:54:58 +00:00
Ed Maste 53ae4b1433 Remove decorators for llvm.org/pr17225
This issue is no longer reproducible, presumably due to changes in clang.

llvm-svn: 195458
2013-11-22 13:46:43 +00:00
Colin Riley 6c97042044 Fix for PECOFF GetArchitecture
0 as CPU subtype never matches anything (at least, it doesn't match x86_64 windows binaries, of which there are correct arch definitions for). It should be created with LLDB_INVALID_CPUTYPE. 

llvm-svn: 195435
2013-11-22 09:35:12 +00:00
Jim Ingham 1a7ee7044a #include <AvailabilityMacros.h> if you want to use them. This was causing us to skip
the code that should have set thread names on Mac OS X.

<rdar://problem/15517264>

llvm-svn: 195403
2013-11-22 00:51:36 +00:00
Enrico Granata de61cecd1c <rdar://problem/15530080>
Rework data formatters matching algorithm
What happens now is that, for each category, the FormatNavigator generates all possible matches, and checks them one by one
Since the possible matches do not actually depend on the category (whether a match is accepted or not does, but that check can be shifted at a more convenient time),
it is actually feasible to generate every possible match upfront and then let individual categories just scan through those

This commit changes things by introducing a notion of formatters match candidate, and shifting responsibility for generating all of them given a (ValueObject,DynamicValueType) pair
from the FormatNavigator back to the FormatManager
A list of these candidates is then passed down to each category for matching
Candidates also need to remember whether they were generated by stripping pointers, references, typedefs, since this is something that individual formatters can choose to reject
This check, however, is conveniently only done once a "textual" match has been found, so that the list of candidates is truly category-independent

While the performance benefit is small (mostly, due to caching), this is much cleaner from a design perspective

llvm-svn: 195395
2013-11-22 00:02:13 +00:00
Jason Molenda a69c1139e9 Tweak exports list so lldb will still build correctly when
init_lldb is absent (when doing a no-python build).

llvm-svn: 195377
2013-11-21 22:23:46 +00:00
Greg Clayton 904c145d4c Exit if launch doesn't succeed.
llvm-svn: 195371
2013-11-21 19:03:34 +00:00
Greg Clayton dd59dcb6d1 Added the ability to launch the program that was specified on the command line and have it waiting for a NativeProcessProtocol to attach.
llvm-svn: 195370
2013-11-21 18:58:35 +00:00
Greg Clayton be94a04055 Start the correct host abstraction of process and thread.
Added a new "Host/Debug.h" which contains the pure virtual class definitions for NativeProcessProtocol and NativeThreadProtocol. These classes are host layer classes that, over time, every host that supports debugging will implement once.

Then the new "lldb-gdbserver" binary in the tools directory will be able to make a remote debugging binary from these native classes, and we will also be able to have a new lldb_private::Process class that implements native debugging using these classes.

So as soon as linux and MacOSX switch over to using this layer, everyone will get native and remote debugging.

This check-in is primarily to get the needed code in so that poeple can start trying to implement the NativeProcessProtocol and NativeThreadProtocol and use it in the GDBRemoteCommunicationServer class to implement a GDB server for remote debugging.

llvm-svn: 195369
2013-11-21 18:39:32 +00:00
Ed Maste 5341404258 Update cmake for SBPlatform.cpp added in r195273
llvm-svn: 195362
2013-11-21 14:38:22 +00:00