Commit Graph

2694 Commits

Author SHA1 Message Date
Jim Ingham d555bacca3 Add support for looking up ivar offset from the ObjC runtime.
llvm-svn: 133831
2011-06-24 22:03:24 +00:00
Johnny Chen b5491a6e60 Add fuzz calls for SBBreakpointLocation.
llvm-svn: 133810
2011-06-24 19:00:22 +00:00
Johnny Chen 1bd3d731d9 Add fuzz calls for SBBreakpoint.
llvm-svn: 133809
2011-06-24 18:49:27 +00:00
Greg Clayton 17cc8b9d88 Remove an assertion and replace with safe code that emits a warning.
llvm-svn: 133786
2011-06-24 03:47:23 +00:00
Greg Clayton 0c74e78d63 Fixed SBTarget attach calls to properly deal with being connected to a remotely
connected process connection.

Also added support for more kinds of continue packet when multiple threads
need to continue where some want to continue with signals.

llvm-svn: 133785
2011-06-24 03:21:43 +00:00
Peter Collingbourne 44c9b3758f ++ cannot be used to increment an enum, so do it another way
llvm-svn: 133781
2011-06-24 01:12:22 +00:00
Johnny Chen 2f675dcb39 Add fuzz calls for SBBlock.
llvm-svn: 133780
2011-06-24 00:21:36 +00:00
Johnny Chen 4d1f660ace Start adding API calls to the invalid SB API object after default construction.
It should not crash lldb.

This checkin adds calls for SBAddress.

llvm-svn: 133778
2011-06-24 00:06:53 +00:00
Johnny Chen 9d2f340249 Add an initial test file for the newly added data formatter command.
main.cpp is contributed from Enrico.

Modify CommandObjectType.cpp to set status on the CommandReturnObject when succeeded as well.

llvm-svn: 133772
2011-06-23 23:14:10 +00:00
Johnny Chen b7373c92e6 o lldbtest.py:
Assign the test method name to self.testMethodName.  This can be useful for the
test directory (see test/types for a good example) which houses a bunch of executables
compiled from different source files.  The default build action is to create a.out as
the binary executable, which can confuse the module cacheing mechanism and result in
the debugger getting a stale image as the target to be debugged, and chaos ensues.

o AbstractBase.py, TestThreadAPI.py:

Use self.testMethodName to our advantage.

o TestLoadUnload.py:

Add expected failure marker to test case test_modules_search_paths().

llvm-svn: 133768
2011-06-23 22:11:20 +00:00
Greg Clayton bb7f31fa29 Centralized all of the format to c-string and to format character code inside
the FormatManager class. Modified the format arguments in any commands to be
able to use a single character format, or a full format name, or a partial 
format name if no full format names match.

Modified any code that was displaying formats to use the new FormatManager
calls so that our help text and errors never get out of date.

Modified the display of the "type format list" command to be a bit more
human readable by showing the format as a format string rather than the single
character format char.

llvm-svn: 133765
2011-06-23 21:22:24 +00:00
Johnny Chen 02028fa190 For now, use 'b.out' compiled from main2.cpp as the executable name for test_run_to_address_with_dsym/dwarf()
to distinguish between other test cases which use 'a.out' compiled from main.cpp.

llvm-svn: 133764
2011-06-23 21:22:01 +00:00
Peter Collingbourne 08405b69e8 Fix header paths
llvm-svn: 133755
2011-06-23 20:37:26 +00:00
Johnny Chen 4acd7b4936 Refactorings of the test/types directory to more elegantly express the uniqueness of
executable names given to each test method.

llvm-svn: 133749
2011-06-23 20:10:23 +00:00
Charles Davis 402491558b Fix typo spotted by Elias Pipping.
llvm-svn: 133744
2011-06-23 18:47:17 +00:00
Greg Clayton f60f375250 Another patch from Enrico Granata.
Added a fix for where you might have already displayed something with a given
type, then did a "type format add ...", then you display the type again. This
patch will figure out that the format changed and allow us to display the
type with the correct new format.

llvm-svn: 133743
2011-06-23 18:38:25 +00:00
Greg Clayton 4a33d3188c Committing type format code for Enrico Granata.
This commit adds a new top level command named "type". Currently this command
implements three commands:

type format add <format> <typename1> [<typename2> ...]
type format delete <typename1> [<typename2> ...]
type format list [<typename1> [<typename2>] ...]

This allows you to specify the default format that will be used to display
types when you use "frame variable" or "expression", or the SBValue classes.

Examples:

// Format uint*_t as hex
type format add x uint16_t uint32_t uint64_t

// Format intptr_t as a pointer
type format add p intptr_t

The format characters are the same as "printf" for the most part with many
additions. These format character specifiers are also used in many other 
commands ("frame variable" for one). The current list of format characters
include:

a - char buffer
b - binary
B - boolean
c - char
C - printable char
d - signed decimal
e - float
f - float
g - float
i - signed decimal
I - complex integer
o - octal
O - OSType
p - pointer
s - c-string
u - unsigned decimal
x - hex
X - complex float
y - bytes
Y - bytes with ASCII

llvm-svn: 133728
2011-06-23 17:59:56 +00:00
Charles Davis b185890192 When installing the Python modules:
- Respect DESTDIR.
- Use the realpath function on the path before prepending DESTDIR.
- Don't depend on liblldb.{so,dylib} being installed already.
- Don't put the DESTDIR into the _lldb.so symlink.

Patch by Elias Pipping!

llvm-svn: 133689
2011-06-23 05:40:38 +00:00
Greg Clayton 084db10d4d Fixed an issue for ARM where data symbols would alway return invalid addresses.
llvm-svn: 133684
2011-06-23 04:25:29 +00:00
Peter Collingbourne 09aff6bcad Remove -MT options from SWIG invocation
SWIG on Darwin does not support -MT, and it only means that we lose
the .d target, which doesn't seem to be used or needed.

Pointed out by Charles Davis.

llvm-svn: 133660
2011-06-22 22:39:02 +00:00
Johnny Chen bfae99cf29 Modify the test cases (there are a bunch of them) under test/types so that they
employ different executable names when creating the target for lldb to debug.
Comparing the log files for the same test case with success/failure results show
that the failed one was setting the breakpoint on some different address than the
succeeded one, leading us to suspect that the file system maybe think it knows better
and caches the wrong executable file (they were all named 'a.out' before) which lldb
subsequently reads from.

Now './dotest.py -v types' passes without specifying the '-w' option.

rdar://problem/9644488
rdar://problem/9649573

llvm-svn: 133649
2011-06-22 21:15:10 +00:00
Jim Ingham 6cffdd2fd3 Trivial fix - insert a space between the frame name and the instruction output.
llvm-svn: 133647
2011-06-22 21:13:28 +00:00
Johnny Chen fdfa26fba0 Add docstring to test_SBSymbolContextList(self) explaining that upon default construction, the API object is valid.
llvm-svn: 133644
2011-06-22 20:57:52 +00:00
Jim Ingham ad63637f3f Reverting switch to the AsyncOutputStream for the Thread Trace Logger. This change caused the logger to crash. Presumably we're printing at a time the debugger isn't ready to print.
llvm-svn: 133629
2011-06-22 18:23:52 +00:00
Greg Clayton 336c2869fb Bump Xcode project version to 64.
llvm-svn: 133605
2011-06-22 03:27:35 +00:00
Johnny Chen 554332d3a6 This newly introduced test file (for debugging purpose) needs to handle the case
where the environment variables for log files (DEBUG_LLDB_LOG and DEBUG_GDB_REMOTE_LOG)
are not defined.

llvm-svn: 133603
2011-06-22 02:49:56 +00:00
Johnny Chen e98f7f2cfa Recent change to SBSymbolContextList (r133498) makes the default constructor return
a valid SB API object.  Modify the test case to accommodate.

llvm-svn: 133602
2011-06-22 02:39:46 +00:00
Greg Clayton 1a38ea763a Add a 10 second timeout to ensure that we don't lock up if we never get to the
process entry point.

llvm-svn: 133598
2011-06-22 01:42:17 +00:00
Greg Clayton 1da6f9d7f1 Fixed an issue where SBFrame::GetDisassembly() was returning disassembly that
contained the current line marker. This is now an option which is not enabled
for the API disassembly call.

llvm-svn: 133597
2011-06-22 01:39:49 +00:00
Johnny Chen 0ebe5c539f I messed up the test case id to turn logging on and then off. It is "test_long_type_with_dsym",
not "test_long_long_type_with_dsym".

llvm-svn: 133562
2011-06-21 22:40:34 +00:00
Johnny Chen 97d774076e Add logging of 'commands' category, too.
llvm-svn: 133556
2011-06-21 22:16:07 +00:00
Greg Clayton c1869a5ee1 Don't print out the baton pointer value for simple Baton classes.
llvm-svn: 133541
2011-06-21 20:47:20 +00:00
Johnny Chen e1ba3123c1 rdar://problem/9649573 has captured the log files when running test_long_long_type_with_dsym() (which luckily failed) and the test session files for test failures.
llvm-svn: 133538
2011-06-21 19:59:45 +00:00
Johnny Chen fce70bb43b Add a test file "TestFailures.py" to try to capture test failures which occur when running
with no delay between successive test cases.  This one happend to capture a test failure where
the inferior shoud stop at a breakpoint but did not (radar will be filed to capture the log files
as well as the test session files):

[12:40:37] johnny:/Volumes/data/lldb/svn/trunk/test $ DEBUG_LLDB_LOG=/tmp/lldb.log DEBUG_GDB_REMOTE_LOG=/tmp/gdb-remote.log ./dotest.py -v -p TestFailures.py
LLDB-63
Path: /Volumes/data/lldb/svn/trunk
URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
Repository Root: https://johnny@llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 133529
Node Kind: directory
Schedule: normal
Last Changed Author: jmolenda
Last Changed Rev: 133500
Last Changed Date: 2011-06-20 19:57:15 -0700 (Mon, 20 Jun 2011)



Session logs for test failures/errors/unexpected successes will go into directory '2011-06-21-12_40_42'
Command invoked: python ./dotest.py -v -p TestFailures.py
----------------------------------------------------------------------
Collected 10 tests

 1: test_char_type_with_dsym (TestFailures.DebugIntegerTypesFailures)
    Test that char-type variables are displayed correctly. ... ok
 2: test_char_type_with_dwarf (TestFailures.DebugIntegerTypesFailures)
    Test that char-type variables are displayed correctly. ... ok
 3: test_int_type_with_dsym (TestFailures.DebugIntegerTypesFailures)
    Test that int-type variables are displayed correctly. ... ok
 4: test_int_type_with_dwarf (TestFailures.DebugIntegerTypesFailures)
    Test that int-type variables are displayed correctly. ... ok
 5: test_long_long_type_with_dsym (TestFailures.DebugIntegerTypesFailures)
    Test that 'long long'-type variables are displayed correctly. ... FAIL
 6: test_long_long_type_with_dwarf (TestFailures.DebugIntegerTypesFailures)
    Test that 'long long'-type variables are displayed correctly. ... ok
 7: test_long_type_with_dsym (TestFailures.DebugIntegerTypesFailures)
    Test that long-type variables are displayed correctly. ... TestFailures.DebugIntegerTypesFailures.test_long_type_with_dsym
FAIL
 8: test_long_type_with_dwarf (TestFailures.DebugIntegerTypesFailures)
    Test that long-type variables are displayed correctly. ... FAIL
 9: test_short_type_with_dsym (TestFailures.DebugIntegerTypesFailures)
    Test that short-type variables are displayed correctly. ... ok
10: test_short_type_with_dwarf (TestFailures.DebugIntegerTypesFailures)
    Test that short-type variables are displayed correctly. ... ok

======================================================================
FAIL: test_long_long_type_with_dsym (TestFailures.DebugIntegerTypesFailures)
    Test that 'long long'-type variables are displayed correctly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 102, in test_long_long_type_with_dsym
    self.long_long_type()
  File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 129, in long_long_type
    self.generic_type_tester(set(['long long']))
  File "/Volumes/data/lldb/svn/trunk/test/types/AbstractBase.py", line 67, in generic_type_tester
    "stop reason = breakpoint"])
  File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 863, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : Process should be stopped due to breakpoint

======================================================================
FAIL: test_long_type_with_dsym (TestFailures.DebugIntegerTypesFailures)
    Test that long-type variables are displayed correctly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 87, in test_long_type_with_dsym
    self.long_type()
  File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 125, in long_type
    self.generic_type_tester(set(['long']))
  File "/Volumes/data/lldb/svn/trunk/test/types/AbstractBase.py", line 67, in generic_type_tester
    "stop reason = breakpoint"])
  File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 863, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : Process should be stopped due to breakpoint

======================================================================
FAIL: test_long_type_with_dwarf (TestFailures.DebugIntegerTypesFailures)
    Test that long-type variables are displayed correctly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 94, in test_long_type_with_dwarf
    self.long_type()
  File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 125, in long_type
    self.generic_type_tester(set(['long']))
  File "/Volumes/data/lldb/svn/trunk/test/types/AbstractBase.py", line 67, in generic_type_tester
    "stop reason = breakpoint"])
  File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 863, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : Process should be stopped due to breakpoint

----------------------------------------------------------------------
Ran 10 tests in 5.617s

FAILED (failures=3)
Session logs for test failures/errors/unexpected successes can be found in directory '2011-06-21-12_40_42'
[12:40:47] johnny:/Volumes/data/lldb/svn/trunk/test $ 

llvm-svn: 133537
2011-06-21 19:47:11 +00:00
Johnny Chen d0abdab8d1 Fix the log channel for gdb-remote. It should be "gdb-remote" now, instead of "process.gdb-remote".
llvm-svn: 133534
2011-06-21 19:25:45 +00:00
Jason Molenda 98322e64c3 Replace examine-threads.c with a similar little utility I wrote a
while back.  By default its output will be less verbose than the
old examine-threads.c but adding the '-v' command line flag will
give all the information that examine-threads.c provided plus some.

Of note, this implementation can take a process name -- and it will
use the libproc API so it can match program names longer than 16
characters.

llvm-svn: 133500
2011-06-21 02:57:15 +00:00
Greg Clayton fe356d356a Added the ability to find functions from either a SBModule (find functions
only in a specific module), or in a SBTarget (all modules for a target).

llvm-svn: 133498
2011-06-21 01:34:41 +00:00
Johnny Chen ed492022f4 For now, insert some delays between succesive test cases in the test/types directory
if not already specified by the test driver (via ./dotest -w).  Remove the AbstractBase.setUp()
method definition when/if we find out the cause of the failures if no delays are inserted
between these test cases.

llvm-svn: 133495
2011-06-21 00:53:00 +00:00
Johnny Chen e5cc4b6330 Simplify the the generic AbstractBase.py test base for testing variable types.
We still have the the issue where running:

    ./dotest.py -v types

we have test failures where the inferior either runs to exited with status 0 or
the inferior stops but not because of breakpoint (for example):

runCmd: process status
output: Process 90060 stopped
* thread #1: tid = 0x2d03, 0x000000010000e2ca, stop reason = EXC_BAD_ACCESS (code=2, address=0x10000e2ca)
  frame #0: 0x000000010000e2ca

There are two cases where the inferior stops for the breakpoint (good), but the expression parser
prints out the wrong information.  The two failures are:

Failure-TestFloatTypesExpr.FloatTypesExprTestCase.test_double_type_with_dsym.log
Failure-TestFloatTypesExpr.FloatTypesExprTestCase.test_double_type_with_dwarf.log

I'll file a radar on the two expression parser misbehave, while continue investigating why the
inferior stops for the wrong reason or does not stop at all.

For now, you'll need to do:

    ./dotest.py -v -w types

llvm-svn: 133488
2011-06-21 00:13:15 +00:00
Peter Collingbourne d155c0b451 Remove duplicate m_monitor field from LaunchArgs
Fixes segfault when launching process on Linux.

llvm-svn: 133484
2011-06-20 23:55:58 +00:00
Peter Collingbourne 6f2b85221d Set LLDB_SESSION_DIRNAME to absolute path
This is to ensure that session files are written to the correct
directory if the -r option is given.

llvm-svn: 133483
2011-06-20 23:55:53 +00:00
Jim Ingham 91da589d7e The "-r" option should work for both "-n" and "-s", but it was only set to work for "-s".
llvm-svn: 133479
2011-06-20 23:38:11 +00:00
Johnny Chen 3343c13c6e Minor module-level docstring change.
llvm-svn: 133476
2011-06-20 22:33:35 +00:00
Johnny Chen dd68ab83b9 Test lldb Python API object's default constructor and make sure it is invalid
after initial construction.

There are two exceptions to the above general rules, though; the API objects are
SBCommadnReturnObject and SBStream.

llvm-svn: 133475
2011-06-20 22:30:48 +00:00
Johnny Chen 91016396b9 Change to get around the nested ifeq woes on OS X Snow Leopard:
../make/Makefile.rules:217: *** missing `endif'.  Stop.

llvm-svn: 133466
2011-06-20 20:08:26 +00:00
Peter Collingbourne aa14adc639 Add dependency tracking/clean rule to interpreter makefile
llvm-svn: 133463
2011-06-20 19:07:07 +00:00
Peter Collingbourne 3b3531618b Enable the "make test" rule in the root Makefile
llvm-svn: 133462
2011-06-20 19:06:57 +00:00
Peter Collingbourne b0589f16a4 Add a default rule to test/Makefile which runs the test suite
llvm-svn: 133461
2011-06-20 19:06:51 +00:00
Peter Collingbourne d6824de00e Modify TestHelp to search for LLDB-Info.plist in the correct place
This is required to run the test suite outside of the source tree
or on a case sensitive file system.

llvm-svn: 133460
2011-06-20 19:06:45 +00:00
Peter Collingbourne 7477e10dc8 Create a _lldb.so symlink in the bin directory
This is required to run the test suite without installing.

llvm-svn: 133459
2011-06-20 19:06:35 +00:00