Commit Graph

9162 Commits

Author SHA1 Message Date
Deepak Panickal 5780657be8 Update CMakeLists.txt and Makefiles for building/linking the Hexagon ABI and Dynamic Loader
llvm-svn: 213568
2014-07-21 17:24:05 +00:00
Deepak Panickal 8006d319c2 Add the Hexagon DSP breakpoint opcode to PlatformWindows and PlatformLinux
llvm-svn: 213567
2014-07-21 17:22:12 +00:00
Deepak Panickal 2526ee5a2d ABI for the Hexagon DSP
llvm-svn: 213566
2014-07-21 17:21:01 +00:00
Deepak Panickal ca238a7b82 Dynamic loader for the Hexagon DSP
llvm-svn: 213565
2014-07-21 17:19:12 +00:00
Zachary Turner 07b21d7a69 Rename dosep.ty to dosep.py
llvm-svn: 213555
2014-07-21 16:16:31 +00:00
Zachary Turner 37373b0c98 Remove spurious debugging message from CMake.
llvm-svn: 213553
2014-07-21 16:10:20 +00:00
Saleem Abdulrasool 6747c7d01b linux process: silence GCC switch coverage warning
Add missing entry for eExecMessage message type to silence GCC switch coverage
warning.

llvm-svn: 213470
2014-07-20 05:28:57 +00:00
Saleem Abdulrasool e1401eb747 build: fix cmake warning with newer CMake
Hoist the compatibility macros out a level and re-use them when adding link
dependencies.  Silences a warning from CMake.

llvm-svn: 213469
2014-07-20 05:28:55 +00:00
Jim Ingham 4ac0443fd9 Add the ability to suppress the creation of a persistent
result variable and use in in "Process::LoadImage" so that,
for instance, "process load" doesn't increment the return
variable number.

llvm-svn: 213440
2014-07-19 01:09:16 +00:00
Jim Ingham 6971b861d7 In Process::LoadImage, use the same function call both to call dlopen and to collect
the error if there is one.

llvm-svn: 213436
2014-07-19 00:37:06 +00:00
Greg Clayton 759e7441af LLDB now correctly handles virtual inheritance.
Test case added as well.

<rdar://problem/16785904>

llvm-svn: 213433
2014-07-19 00:12:57 +00:00
Zachary Turner 2f12195b1d Allow the user to override the LLDB_TEST_COMPILER at CMake level.
llvm-svn: 213421
2014-07-18 22:46:22 +00:00
Zachary Turner be9c423b95 Test commit. Having trouble committing from one machine but not
another, attempting to fix it.

llvm-svn: 213413
2014-07-18 21:06:51 +00:00
Zachary Turner a6473a7994 Fix a bug with order of operations.
llvm-svn: 213411
2014-07-18 21:03:06 +00:00
Zachary Turner c9bf0c70b5 Make lldb -P work on Windows.
lldb -P, which outputs its python path, works by using Host-layer
facilities to get information about the loaded python module.  This
Host functionality was unimplemented on Windows, so this patch
implements it.  Additionally, it removes a pexpect dependency from
the test runner and uses an equivalent invocation of subprocess.

Reviewed by: Todd Fiala

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

llvm-svn: 213410
2014-07-18 20:36:08 +00:00
Greg Clayton d46bb62610 Fixing warnings shouldn't introduce a crasher.
Fix the warning the correct way without making things crash when ENABLE_MUTEX_ERROR_CHECKING is non enabled.

<rdar://problem/17703039>

llvm-svn: 213394
2014-07-18 18:32:45 +00:00
Joerg Sonnenberger 968697d161 Use PRIx64.
llvm-svn: 213366
2014-07-18 11:58:19 +00:00
Zachary Turner 05c30880b6 Use the designated PYTHON_EXECUTABLE during build.
We were hardcoding "python" as the command to run the swig wrapper
scripts.  We should be using PYTHON_EXECUTABLE instead.

llvm-svn: 213354
2014-07-18 07:06:13 +00:00
Zachary Turner 045fde58d1 Fixes a number of issue related to test portability on Windows.
99% of this CL is simply moving calls to "import pexpect" to a more
narrow scope - i.e. the function that actually runs a particular
test.  This way the test suite can run on Windows, which doesn't have
pexpect, and the individual tests that use pexpect can be disabled on
a platform-specific basis.

Additionally, this CL fixes a few other cases of non-portability.
Notably, using "ps" to get the command line, and os.uname() to
determine the architecture don't work on Windows.  Finally, this
also adds a stubbed out builder_win32 module.

The full test suite runs correctly on Windows after this CL, although
there is still some work remaining on the C++ side to fix one-shot
script commands from LLDB (e.g. script print "foo"), which currently
deadlock.

Reviewed by: Todd Fiala

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

llvm-svn: 213343
2014-07-18 01:02:02 +00:00
Greg Clayton 26a15efa77 Fixed the objective C symbol parsing in ObjectFileMachO.
This fixes all of the hidden ivar test cases and any case where we try to find the full definition of an objective C class.

This also means hidden ivars show up again.

<rdar://problem/15458957>
llvm.org/pr20270
llvm.org/pr20269
llvm.org/pr20272

llvm-svn: 213328
2014-07-17 22:51:31 +00:00
Jim Ingham cf973791a1 ReadPointedString takes a Stream not a DataBuffer.
llvm-svn: 213314
2014-07-17 21:53:48 +00:00
Zachary Turner fa59e62012 Create an _d suffixed symlink when doing a debug Windows build.
_lldb is built as an extension module on Windows.  Normally to load
an extension module named 'foo', Python would look for the file
'foo.pyd'.  However, when a debug interpreter is used, Python will
look for the file 'foo_d.pyd'.  This change checks the build
configuration and creates the correct symlink name based on the
build configuration.

llvm-svn: 213306
2014-07-17 20:36:14 +00:00
Jim Ingham 3ac7cf3be9 In Process::LoadImage, if dlopen returns 0x0 fetch the error with dlerror and report
that in the returned Error.

llvm-svn: 213294
2014-07-17 18:55:25 +00:00
Sean Callanan 2683aca12e Fixed our install-headers script to set version
numbers correctly.

<rdar://problem/17708687>

llvm-svn: 213284
2014-07-17 17:26:38 +00:00
Sean Callanan 0feb17ec5c Two fixes in the Objective-C language runtime:
- First, when logging, be helpful by printing
  the real name of the class;

- Second, up the limit for number of classes
  from 16k to 128k, and put in an assertion
  (and better error handling when not in a
  debug configuration) when we cross that
  limit the next time.

<rdar://problem/17052976>

llvm-svn: 213218
2014-07-17 01:20:37 +00:00
Greg Clayton a1bce2ef1a Modify the EFI KDP debugging to not use any dynamic loader since it does manual dynamic loading itself via python modules.
Also track down the required binary by trying to locate the main executable module through LLDB's symbol and executable file locating code.

<rdar://problem/16570258>

llvm-svn: 213199
2014-07-16 21:16:27 +00:00
Greg Clayton 0fdd3ae54d ^C wasn't interrupting an expression during a long evaluation or deadlock.
The problem was that we have an IOHandler thread that services the IOHandler stack. The command interepter is on the top of the stack and it receives a "expression ..." command, and it calls the IOHandlerIsComplete() callback in the command interpereter delegate which runs an expression. This causes the IOHandlerProcessSTDIO to be pushed, but since we are running the code from the IOHandler thread, it won't get run. When CTRL+C is pressed, we do deliver the interrupt to the IOHandlerProcessSTDIO::Interrupt() function, but it was always writing 'i' to the interrupt pipe, even if we weren't actively reading from the debugger input and the pipes. This fix works around the issue by directly issuing the async interrupt to the process if the process is running.

A longer term more correct fix would to be run the IOHandler thread and have it just do the determination of the input and when complete input is received, run the code that handles that input on another thread and syncronize with that other thread to detect when more input is desired. That change is too big to make right now, so this fix will tide us over until we can get there.

<rdar://problem/16556228>

llvm-svn: 213196
2014-07-16 21:05:41 +00:00
Zachary Turner 4041116579 Fix some warnings in the Windows build.
llvm-svn: 213194
2014-07-16 20:28:24 +00:00
Todd Fiala 17096d7669 Add Host::MAX_THREAD_NAME_LENGTH constant.
This value gets set to a max uint32_t value when there is no known limit; otherwise,
it is set to a value appropriate for the platform.  For the moment, only
Linux, FreeBSD and NetBSD set it to 16.  All other platforms set it to
the max uint32_t value.

Modifies the Process private state thread names to fit within a 16-character limit
when the max thread name length is <= 16.  These guarantee that the thread names
can be distinguished within the first 16 characters.  Prior to this change, those
threads had names in the final dotted name segment that were not distinguishable
within the first 16 characters.

llvm-svn: 213183
2014-07-16 19:03:16 +00:00
Zachary Turner 0152e73a73 Fix build broken as a result of r213171.
r213171 renames the 'clangRewriteCore' library to 'clangRewrite'.
This change simply updates the makefiles to reference the correct
library name.

llvm-svn: 213181
2014-07-16 18:53:18 +00:00
Todd Fiala f9ad21d22a gdb-remote test noise suppression on MacOSX.
This change adds a member to the base test case for gdb-remote that
indicates whether a stub makes two X stop notification reports on kill
commands.  This is set to true for debugserver tests.

The test for killing an attached process after it's first stop notification
has been modified to look at that flag and add an extra X packet matcher
so the "unmatched packet warning" doesn't get emitted for the second X on
MacOSX with debugserver.

I also broke those tests out of the monolithic TestLldbGdbServer mega test
case and put it in its own, new TestGdbRemoteKill.py file and test case.

Tested:
Ubuntu 14.04 x86_64, clang-3.5 built lldb, no test failures.
MacOSX 10.9.4, Xcode 6.0 Beta 3 built lldb, no test failures.

llvm-svn: 213166
2014-07-16 16:15:42 +00:00
Todd Fiala cfee963282 Add kalimba as a platform.
This change comprises of additions and some minor changes in order that
"kalimba" is listed as a supported platform and that debugging any
kalimbas results in PlatformKalimba being associated with the target.

The changes are as follows:

* The PlatformKalimba implementation itself
* A tweak to ArchSpec
* .note parsing for Kalimba in ObjectFileELF.cpp
* Plugin registration
* Makefile additions

Change by Matthew Gardiner

Minor tweak for cmake and Xcode by Todd Fiala

Tested:
Ubuntu 14.04 x86_64, clang 3.5-built lldb, all tests pass.
MacOSX 10.9.4, Xcode 6.0 Beta 1-built lldb, all tests pass.

llvm-svn: 213158
2014-07-16 15:03:10 +00:00
Greg Clayton 2c156f852c Fixed the an objective C test case so it passes correctly.
Fixed the test case to use a runtime function prototype that will be correct ([NSString stringWithCString: "new"]) instead of one that won't (expression str = [NSString stringWithFormat: @"%cew", 'N']). The runtime doesn't track vararg functions correctly so we can't reconstitute the function correctly.

Also fixed some expressions that used "str_id" whose type was "id" and do the necessary casting since "id" doesn't have any methods.

llvm-svn: 213113
2014-07-16 00:42:06 +00:00
Greg Clayton 0d830b4226 TestObjCMethods.FoundationTestCase was failing due to an error, fixed now.
<rdar://problem/16322133>
llvm.org/pr20267

llvm-svn: 213111
2014-07-16 00:39:15 +00:00
Greg Clayton 325948cc48 Fix compile warning.
llvm-svn: 213106
2014-07-15 23:27:56 +00:00
Jim Ingham 0aca5f0934 The following files:
LinuxThread.cpp
LinuxThread.h
NativeRegisterContext.h
ProcessLinux.cpp
ProcessLinux.h
ProcessMonitor.cpp
ProcessMonitor.h

Were inserted in the CopyFiles phase of the "desktop" aggregate target.  That caused them to get
copied to /usr/shared/man/man1 on install, which isn't right.  Not sure why they were there...
I removed them.  If this was supposed to achieve some other purpose, we should discuss how to do
that correctly on the mailing list.

<rdar://problem/17642262>

llvm-svn: 213094
2014-07-15 21:24:58 +00:00
Greg Clayton 45a44f3c4d Any commands that are executed through the public interface using SBCommandInterpreter::HandleCommand() are assumed to be in non-interactive mode.
Any commands that want interactivity (stdin) will need to be executed through the normal command interpreter using the debugger's in/out/err file handles, or by using "command source".

Individual commands through the API will have their STDIN disabled. The STDOUT and STDERR will be redirected into the SBCommandReturnObject argument to SBCommandInterpreter::HandleCommand() as usual.

This helps with a deadlock situation in an IDE (Xcode) where the IDE was managing the breakpoint actions by setting a breakpoint callback and doing things manually.

<rdar://problem/17386271>

llvm-svn: 213023
2014-07-15 00:25:59 +00:00
Greg Clayton fb8b37a49d If Process::Finalize() has been called, don't track process state changes.
<rdar://problem/17540766>

llvm-svn: 213007
2014-07-14 23:09:29 +00:00
Greg Clayton 52edb364a1 lldb.LLDB_ARCH_DEFAULT now works correctly on Macs with haswell enabled kernels.
<rdar://problem/17604133>

llvm-svn: 213004
2014-07-14 22:53:02 +00:00
Todd Fiala 24189d4c86 Modified gdb-remote tests to run with automatically-chosen ports.
Now that llgs supports communicating the 0-port choose-a-port
mechanism and can communicate that back to a caller via the
--named-pipe option (at parity with debugserver), we use this
mechanism to always start llgs and debugserver gdb-remote
protocol tests without needing to use some port arbitration
mechanism.  This eliminates some potential intermittent failures vs. the
previous random port and collision-avoidance strategy used.

llvm-svn: 212923
2014-07-14 06:24:44 +00:00
Ed Maste c25d5cc777 Fix lldb-gdbserver build
s_listen_thread had the wrong type.

llvm-svn: 212884
2014-07-12 21:46:39 +00:00
Todd Fiala a6a362a086 llgs: modify to accept --native-regs flag.
This is the last flag sent by lldb-platform that was not accepted
by llgs and is accepted by debugserver.

Conditionalized out a bit more code in prep for Windows
support one day based on _WIN32 define.

Updated the lldb-gdbserver usage string to represent
recent updates to command line arguments (and some older
ones like --attach pid).

Implements https://github.com/tfiala/lldb/issues/37

llvm-svn: 212879
2014-07-12 17:34:24 +00:00
Ed Maste 78d117eb63 Add FreeBSD failure decorator for TestCallStopAndContinue
The testrun now completes successfully on my FreeBSD 11.0-CURRENT
laptop.  There are some intermittent failures on the FreeBSD buildbot
still, which should be addressed in later commits.

llvm.org/pr20274

llvm-svn: 212878
2014-07-12 15:41:03 +00:00
Ed Maste 8abef69ad9 Add FreeBSD decorator for TestMultipleDebuggers
llvm.org/pr20282

llvm-svn: 212877
2014-07-12 15:21:55 +00:00
Todd Fiala 289ca249f0 llgs: implement --setsid.
The --setsid (-S) option changes the session id for the lldb-gdbserver process.
This is used by tools such as lldb-platform and allows the user to prevent
llgs from being in the same session as a calling terminal session.
This will prevents terminal group control signals from affecting
lldb-gdbserver.

See also:
https://github.com/tfiala/lldb/issues/38

llvm-svn: 212873
2014-07-12 01:12:44 +00:00
Greg Clayton 2740787dc9 lldb needs to support DW_op_piece masks for values in subregister and also to be able to piece together a value that is spread across multiple registers.
Patch from Adrian Prantl.

<rdar://problem/16040521> 

llvm-svn: 212867
2014-07-12 00:24:33 +00:00
Greg Clayton 44362e06d1 Allow generic ARM cores to match any more specific ARM architecture.
<rdar://problem/15932248>

llvm-svn: 212863
2014-07-12 00:11:34 +00:00
Greg Clayton 7248ac026c Remove assert now that we have a 'i' character that might come through as well as the 'q' character on the interrupt pipe.
<rdar://problem/15840749>

llvm-svn: 212856
2014-07-11 23:15:11 +00:00
Todd Fiala 67041194b9 Added llgs --named-pipe support and program_name-version_number printout support.
Added a unit test to test debugserver and llgs compliance on --named-pipe support.

Modified llgs to implement --named-pipe support.  (Note: need to revisit with
new generic pipe support).

llvm-svn: 212854
2014-07-11 22:50:13 +00:00
Greg Clayton a39390699c Don't crash when a SBType is handed out through the API and later used after the module that owns the type is deleted.
The fix adds a std::weak_ptr<Module> into the TypeImpl and fills in the weak pointer when possible. It also checks to make sure the module is still alive prior to using it which should make our API safer to use.

<rdar://problem/15455145> 

llvm-svn: 212853
2014-07-11 22:43:15 +00:00