Commit Graph

2094 Commits

Author SHA1 Message Date
Johnny Chen d3a4e7eee5 Add cases to test that two template instantiations of std::vector<long> and std::vector<short>
in the same compilation module show up as different types for lldb debugger.

llvm-svn: 127904
2011-03-18 20:51:13 +00:00
Caroline Tice 77c13fe304 Fix various small problems with EmulateInstructionARM::EmulateSTRRtSP.
llvm-svn: 127898
2011-03-18 19:41:00 +00:00
Jim Ingham b7603bb48d Relax the constraint on the types of ValueObjects that we'll by default try the
ObjC runtime for print object to Pointer AND Integer (from just pointer.)

llvm-svn: 127841
2011-03-18 00:05:18 +00:00
Caroline Tice 4c753376cb Make all the codee that attempts to read the PC consistently use
ReadCoreReg (which 'does the right thing', adding to pc when needed);
fixed places in code where extra addition was being passed along.

Fix bug in insn tables.

llvm-svn: 127838
2011-03-17 23:50:16 +00:00
Jim Ingham 8268ccab60 Fix a problem where we were looking up the class pointer in the {class/sel -> implementation} cache for a objc_msgSendSuper call - where we should have looked up the class's super-class.
llvm-svn: 127830
2011-03-17 21:04:33 +00:00
Jim Ingham 35944dda10 Get ObjC stepping working again when the process is not the default host architecture.
llvm-svn: 127825
2011-03-17 20:02:56 +00:00
Johnny Chen 0d825132c6 Tidy up the input file given to 'llvm-mc -disassemble' and also append the gdb
assembler code to the memory dump.

llvm-svn: 127823
2011-03-17 19:05:34 +00:00
Johnny Chen 6f6fb3e515 Add a Python script to take an executable, run gdb to disassemble a function,
read the memory contents of the function, and then feed the bytes to the
'llvm-mc -disassemble' command.

It uses the pexpect module located under ToT/test/pexpect-2.4 directory to
automate the interaction with gdb.  This is used initially to test the low
level ARM disassembler of llvm.

llvm-svn: 127785
2011-03-17 00:59:57 +00:00
Johnny Chen dbfc256eec As a simple measure, output the lldb version and the svn info for
which the testsuite is run against.

llvm-svn: 127782
2011-03-17 00:38:22 +00:00
Caroline Tice aaf5ddcf82 Add code to emulate STRH (Register) Arm instruction.
Remove inaccurate comments from EmulateInstruction::Context definition.

Fix contexts in a few arm instruction emulation routines.

llvm-svn: 127770
2011-03-16 22:46:55 +00:00
Caroline Tice fe28f1bff9 Fix various small bugs found in the instruction emulation functions.
llvm-svn: 127712
2011-03-16 00:06:12 +00:00
Sean Callanan e6935b6bdf Updated LLVM/Clang to the latest release, to pick
up AVX disassembly support.

llvm-svn: 127695
2011-03-15 20:57:04 +00:00
Greg Clayton 1a37ae40e1 Now that we have the debug map issues fixed, change the Xcode project to
build lldb, LLDB.framework and debugserver all with just DWARF (no dSYM).

llvm-svn: 127686
2011-03-15 18:51:42 +00:00
Greg Clayton 3690964ca1 Added a fix that should help incorrect type uniquing. There was an issue
for templatized types that could cause parts of a std::vector (and I am sure
other STL types) to be incorrectly uniqued to each other wreaking havoc on 
variable display for types within the same executable module.

llvm-svn: 127662
2011-03-15 04:38:20 +00:00
Greg Clayton 3ad0572d2e Make the first vector of "long" instead of "int" so we can tell the difference
easier since "short" ends up with "short int" in the template allocators.

llvm-svn: 127661
2011-03-15 04:29:42 +00:00
Greg Clayton 8f67fd10e9 Added a test case for unique types. In the test case there are two std::vector
types that have different contents. Currently LLDB is incorrectly uniquing,
on MacOSX, the std::vector _VectorImpl class from the two different vector
templates. The DWARF looks like:

0x0000008e:         DW_TAG_structure_type [7] *
                     DW_AT_name( "_Vector_base<int,std::allocator<int> >" )
                     DW_AT_declaration( 0x01 )
                     DW_AT_sibling( {0x00000103} )

0x00000098:             DW_TAG_structure_type [8] *
                         DW_AT_name( "_Vector_impl" )
                         DW_AT_byte_size( 0x18 )
                         DW_AT_decl_file( "/usr/include/c++/4.2.1/bits/stl_vector.h" )
                         DW_AT_decl_line( 83 )

0x000000a0:                 DW_TAG_inheritance [9]  
                             DW_AT_type( {0x000006fa} ( allocator<int> ) )
                             DW_AT_data_member_location( +0 )
                             DW_AT_accessibility( DW_ACCESS_public )



0x0000011b:         DW_TAG_structure_type [7] *
                     DW_AT_name( "_Vector_base<short int,std::allocator<short int> >" )
                     DW_AT_declaration( 0x01 )
                     DW_AT_sibling( {0x00000190} )

0x00000125:             DW_TAG_structure_type [8] *
                         DW_AT_name( "_Vector_impl" )
                         DW_AT_byte_size( 0x18 )
                         DW_AT_decl_file( "/usr/include/c++/4.2.1/bits/stl_vector.h" )
                         DW_AT_decl_line( 83 )

0x0000012d:                 DW_TAG_inheritance [9]  
                             DW_AT_type( {0x00000f75} ( allocator<short int> ) )
                             DW_AT_data_member_location( +0 )
                             DW_AT_accessibility( DW_ACCESS_public )


In this case it using DIE 0x00000098 for both 0x00000098 and 0x00000125.

This test will help detect this issue once I have a fix for it. I have a fix
that I am testing.

llvm-svn: 127660
2011-03-15 04:25:12 +00:00
Greg Clayton 616f490777 Added a fix to not re-use object files when doing DWARF with debug map.
llvm-svn: 127659
2011-03-15 03:56:33 +00:00
Sean Callanan fb0b7583a7 Updated to LLVM/Clang revision 127600.
llvm-svn: 127634
2011-03-15 00:17:19 +00:00
Stephen Wilson d7b15bd6b7 Fix makefile builds when llvm is configured with -enable-shared.
We were dropping the expansion of -rpath=$(LibDir) on linux, which resulted in
the build not being able to resolve libLLVM.so.  Bring in the definition before
expanding the values hanging off LD.Flags.

Thanks to Jason E. Aten for reporting this!

llvm-svn: 127570
2011-03-13 18:17:16 +00:00
Benjamin Kramer 489ac96fcd Turn labels into actual switch cases.
llvm-svn: 127558
2011-03-13 00:14:32 +00:00
Stephen Wilson 28c16d9a7e Add a missing include.
This change is needed to fix the build on Linux. 

llvm-svn: 127557
2011-03-13 00:00:32 +00:00
Johnny Chen b877f1efe9 Add a test directory stop-hook to test the newly added "target stop-hook" command.
This uses pexpect module to spawn a 'lldb' program and uses pseudo-TTY to talk to
the child application.

The test cases test setting breakpoints, adding a stop-hook with line range, and
verifies that when the inferior stops, the stop-hook will fire off when it is
within range and will not fire off when it is out of range.

llvm-svn: 127519
2011-03-12 01:18:19 +00:00
Johnny Chen b7cfba4cb1 Add pexpect-2.4 (a pure Python module for controlling and automating other programs) to the test directory.
http://pypi.python.org/pypi/pexpect/

llvm-svn: 127484
2011-03-11 20:13:06 +00:00
Johnny Chen 7fdf1d13f0 Discover the 'lldb' executable in the setUp() hook of the base test class.
llvm-svn: 127481
2011-03-11 19:55:31 +00:00
Johnny Chen cd29b050b7 Add a mechanism to discover the full path of the 'lldb' program into the test driver.
This provides a way to potentially provide conversational interactions with 'lldb' in the test suite.

llvm-svn: 127479
2011-03-11 19:47:23 +00:00
Jim Ingham 9575d8446c Add a first pass at a "stop hook" mechanism. This allows you to add commands that get run every time the debugger stops, whether due to a breakpoint, the end of a step, interrupt, etc. You can also specify in which context you want the stop hook to run, for instance only on a particular thread, or only in a particular shared library, function, file, line range within a file.
Still need to add "in methods of a class" to the specifiers, and the ability to write the stop hooks in the Scripting language as well as in the Command Language.

llvm-svn: 127457
2011-03-11 03:53:59 +00:00
Jim Ingham bad87feca2 CommandInterpreter::HandleCommands should take its commands as a "const StringList &" since it doesn't modify it...
Also, don't turn on the immediate output in the temporary result, or you'll get doubled output.

llvm-svn: 127452
2011-03-11 01:51:49 +00:00
Jim Ingham e1e96027a6 Fix a few things in the CommandArguments table.
llvm-svn: 127451
2011-03-11 01:50:30 +00:00
Jim Ingham b2605bc96d Declare some const functions as const.
llvm-svn: 127450
2011-03-11 01:48:52 +00:00
Jim Ingham 17de754181 Fix a typo in a comment.
llvm-svn: 127449
2011-03-11 01:48:09 +00:00
Johnny Chen fdc94ff97e Add test cases to exercise the SBThread.GetProcess() API. We launch the process using the
SBTarget.Launch() API, stop at a breakpoint, get the stopped thread, and verify that the
pid of the stopped thread's process is equal to the pid of the process returned by
SBTarget.Launch().

llvm-svn: 127444
2011-03-11 01:16:03 +00:00
Johnny Chen 24e99aa833 Minor typo fix and TAB removals.
llvm-svn: 127439
2011-03-11 00:28:50 +00:00
Caroline Tice c288e8ca0c Add some explanatory comments.
llvm-svn: 127438
2011-03-11 00:21:55 +00:00
Johnny Chen 2d799cca03 Add a test case test_run_to_address() to exercise the SBThread.RunToAddress(lldb::addr_t addr) API.
The test itself is not working yet.

llvm-svn: 127436
2011-03-11 00:00:15 +00:00
Sean Callanan b3396b226e Fixed the -r parameter to the disassemble command
so that it actually triggers raw output.

llvm-svn: 127433
2011-03-10 23:35:12 +00:00
Johnny Chen f93286f20c Add test cases to TestThreadAPI.py to exercise SBThread.StepOver() by stopping at a breakpoint,
doing three step-over's, then verifying that the correct source line number is reached.

llvm-svn: 127432
2011-03-10 22:32:47 +00:00
Caroline Tice b904ca5015 Add a test case to make sure that all the settings that currently ought to
exist are actually there.

llvm-svn: 127431
2011-03-10 22:29:54 +00:00
Caroline Tice 20bd37f747 The UserSettings controllers must be initialized & terminated in the
correct order.  Previously this was tacitly implemented but not
enforced, so it was possible to accidentally do things in the wrong
order and cause problems.  This fixes that problem.

llvm-svn: 127430
2011-03-10 22:14:10 +00:00
Johnny Chen d9f2c08a0a Test cleanup. Check for the full caller symbol of malloc -- b(int).
llvm-svn: 127421
2011-03-10 19:18:04 +00:00
Stephen Wilson 1636265248 Add Makefile support for the Platform plugins.
This patch supports building the Linux platform plugin, and should also support
the MacOSX plugin as well (the MacOSX side has not been tested, unfortunately).
A small typo was corrected in lldb.cpp to initialize the new platform code on
Linux.

llvm-svn: 127393
2011-03-10 03:08:28 +00:00
Greg Clayton c574ede632 Centralize the GDB remote timeout value into the GDBRemoteCommunication as a
member variable (m_packet_timeout which is a value in seconds). This value is
then used for all packets sent to/from the remote GDB server.

llvm-svn: 127392
2011-03-10 02:26:48 +00:00
Johnny Chen a460316d81 Add test cases for Python SBThread.StepOut() API by stepping out of a malloc call where the call site is at function b().
Verifies that after the thread.StepOut(), we are at the correct line within function b.

llvm-svn: 127374
2011-03-09 23:45:56 +00:00
Sean Callanan b8205b1588 Fixed a bug where the disassembly syntax specified for the
ARM disassembler was wrong, causing the disassembler to fail
to initialize.

llvm-svn: 127302
2011-03-09 01:02:51 +00:00
Johnny Chen 40fa548ee7 There's no sense checking for < 0 with a return type of size_t:
size_t
SBProcess::ReadMemory (addr_t addr, void *buf, size_t size, lldb::SBError &error);

llvm-svn: 127292
2011-03-08 23:46:33 +00:00
Johnny Chen af4ab4231f Add an expectedFailure decorator to the test_connect_remote() test case.
It fails when running within the context of the test suite, but succeeds
when running alone.

llvm-svn: 127290
2011-03-08 23:35:45 +00:00
Greg Clayton e996fd30be LLDB now has "Platform" plug-ins. Platform plug-ins are plug-ins that provide
an interface to a local or remote debugging platform. By default each host OS
that supports LLDB should be registering a "default" platform that will be
used unless a new platform is selected. Platforms are responsible for things
such as:
- getting process information by name or by processs ID
- finding platform files. This is useful for remote debugging where there is 
  an SDK with files that might already or need to be cached for debug access.
- getting a list of platform supported architectures in the exact order they
  should be selected. This helps the native x86 platform on MacOSX select the
  correct x86_64/i386 slice from universal binaries.
- Connect to remote platforms for remote debugging
- Resolving an executable including finding an executable inside platform
  specific bundles (macosx uses .app bundles that contain files) and also
  selecting the appropriate slice of universal files for a given platform.

So by default there is always a local platform, but remote platforms can be
connected to. I will soon be adding a new "platform" command that will support
the following commands:
(lldb) platform connect --name machine1 macosx connect://host:port
Connected to "machine1" platform.
(lldb) platform disconnect macosx

This allows LLDB to be well setup to do remote debugging and also once 
connected process listing and finding for things like:
(lldb) process attach --name x<TAB>

The currently selected platform plug-in can now auto complete any available
processes that start with "x". The responsibilities for the platform plug-in
will soon grow and expand.

llvm-svn: 127286
2011-03-08 22:40:15 +00:00
Stephen Wilson d126c8cc5a Fix ObjectFileElf::GetEntryPointAddress()
ELF object files do not implicitly have a symbol named "start" as an entry
point.  For example, on Linux it is often named "_start", but can be trivially
set to any symbol by passing an --entry argument to the linker.

Use the ELF header to determine the entry point and resolve the associated
section based on that address.

Also, update the linux dynamic loader to call GetEntryPointAddress instead of
GetEntryPoint.

llvm-svn: 127218
2011-03-08 04:12:15 +00:00
Stephen Wilson 8f0daa28d4 Add Makefile support for the new DynamicLoaderStatic plugin.
llvm-svn: 127215
2011-03-08 03:57:00 +00:00
Jim Ingham bd3f260698 I didn't notice there was already an ObjectFile::GetEntryPoint. Move that over to GetEntryPointAddress 'cause that's more consistent with other functions in ObjectFile, do the mutatis mutandi and also in the ELF case I return a section offset address rather than a bare load address.
llvm-svn: 127205
2011-03-08 01:54:01 +00:00
Jim Ingham 5ca40258ea Reverting the part of the debug-in-ofile patch from earlier today that removes them from the shared module list. That was causing a bunch of asserts. Greg is working on a better fix.
llvm-svn: 127201
2011-03-08 01:49:10 +00:00