Commit Graph

1037 Commits

Author SHA1 Message Date
Caroline Tice 04a339a084 Flush the prompts immediately in the breakpoint command input readers, to make
sure they come out at the correct times.

llvm-svn: 117470
2010-10-27 18:34:42 +00:00
Greg Clayton 90f90cdae1 Don't include the ":" character when building the selector identifiers
when making objective C classes from the DWARF.

llvm-svn: 117438
2010-10-27 04:01:14 +00:00
Greg Clayton 73b472d42a Updated the lldb_private::Flags class to have better method names and made
all of the calls inlined in the header file for better performance.

Fixed the summary for C string types (array of chars (with any combo if
modifiers), and pointers to chars) work in all cases.

Fixed an issue where a forward declaration to a clang type could cause itself
to resolve itself more than once if, during the resolving of the type itself
it caused something to try and resolve itself again. We now remove the clang
type from the forward declaration map in the DWARF parser when we start to 
resolve it and avoid this additional call. This should stop any duplicate
members from appearing and throwing all the alignment of structs, unions and
classes.

llvm-svn: 117437
2010-10-27 03:32:59 +00:00
Greg Clayton 307de25449 After a recent fix to not set the default architecture to "x86_64", the string value for the default arch was coming out as a value that shouldn't be user visible. Now we don't show any value when it isn't set.
llvm-svn: 117432
2010-10-27 02:06:37 +00:00
Sean Callanan 11d00c22e9 Removed an inappropriate function lookup path.
Also made type lookup lazy for types that are
hidden behind pointers.

llvm-svn: 117430
2010-10-27 01:36:51 +00:00
Caroline Tice 750cd1755d Clean up the API logging code:
- Try to reduce logging to one line per function call instead of tw
      - Put all arguments & their values into log for calls
      - Add 'this' parameter information to function call logging, making it show the appropriate
        internal pointer (this.obj, this.sp, this.ap...)
      - Clean up some return values
      - Remove logging of constructors that construct empty objects
      - Change '==>' to '=>'  for showing result values...
      - Fix various minor bugs
      - Add some protected 'get' functions to help getting the internal pointers for the 'this' arguments...      

llvm-svn: 117417
2010-10-26 23:49:36 +00:00
Greg Clayton ab7b6d6197 Fixed vAttachWait by fixing a missed "else if".
llvm-svn: 117395
2010-10-26 21:04:55 +00:00
Caroline Tice 6dfb484139 Remove inappropriate if-clause in regex name resolution that was
causing modules that haven't already been parsed from being searched.

llvm-svn: 117383
2010-10-26 18:33:57 +00:00
Jason Molenda e6194f17a1 Add an unwind log Printf to note when an eh_frame section is
loaded/parsed.  Should add timers to this eventually.

Delay getting a full UnwindPlan if it's possible to unwind with
just a fast UnwindPlan.  This keeps us from reading the eh_frame
section unless we hit something built -fomit-frame pointer or we
hit a frame with no symbol (read: no start address) available.

It doesn't look like it is correctly falling back to using the
full UnwindPlan to provide additional registers that the fast
UnwindPlan doesn't supply; e.g. go to the middle of a stack and
ask for r12 and it will show you the value of r12 in frame 0.
That's a bug for tomorrow.

llvm-svn: 117361
2010-10-26 12:01:35 +00:00
Jason Molenda 49ea23e266 Don't indent log lines by frame # spaces if the frame # exceeds 100 - the indentation
gets to be a problem if you have a unbounded stack walk.

Fix the CFA sanity checks.  Add one to the arch default UnwindPlan run which was giving
one extra stack frame on the main thread.  Fix a couple of logging lines that had their
argument order incorrect.

llvm-svn: 117350
2010-10-26 04:14:12 +00:00
Caroline Tice ceb6b1393d First pass at adding logging capabilities for the API functions. At the moment
it logs the function calls, their arguments and the return values.  This is not
complete or polished, but I am committing it now, at the request of someone who
really wants to use it, even though it's not really done.  It currently does not
attempt to log all the functions, just the most important ones.  I will be 
making further adjustments to the API logging code over the next few days/weeks.
(Suggestions for improvements are welcome).


Update the Python build scripts to re-build the swig C++ file whenever 
the python-extensions.swig file is modified.

Correct the help for 'log enable' command (give it the correct number & type of
arguments).

llvm-svn: 117349
2010-10-26 03:11:13 +00:00
Jason Molenda 5c01cb6b77 Get a disassembler based on the correct architecture for assembly
prologue profiling.

Change the log print statements to elide the thread number, make
some of them only print when IsLogVerbose().

Add a couple of sanity checks for impossible CFA values so backtraces
don't go too far off into the weeds.

llvm-svn: 117343
2010-10-26 00:47:17 +00:00
Sean Callanan be3a1b14dc Fixed a problem where function calls on i386 weren't
being generated correctly.

Also added a messy way to single-step through expressions
that I will improve soon.

llvm-svn: 117342
2010-10-26 00:31:56 +00:00
Jim Ingham 40d871fa24 The call function thread plan should allow internal breakpoints to continue on. Also made stopping
in mid-expression evaluation when we hit a breakpoint/signal work.

llvm-svn: 117341
2010-10-26 00:27:45 +00:00
Johnny Chen 8c0142fd62 Add an extra SPC character after '.' for the 'frame variable' help text.
llvm-svn: 117330
2010-10-25 23:57:26 +00:00
Johnny Chen a3a113e2d2 Add comment explaining the options used to invoke the test driver.
llvm-svn: 117318
2010-10-25 21:38:35 +00:00
Johnny Chen e137df2624 A simple config to test both x86_64 and i386 architectures.
llvm-svn: 117304
2010-10-25 20:39:20 +00:00
Greg Clayton 0668d1e039 Don't set the default architecture to x86_64. Leave it NULL so that it isn't set to anything and so that any single architecture binary will adopt that architecture instead of posting an error stating the binary doesn't contain "x86_64".
llvm-svn: 117292
2010-10-25 20:08:15 +00:00
Johnny Chen 567a045fe3 Only prints out the stop reason if it is not invalid.
llvm-svn: 117287
2010-10-25 19:13:52 +00:00
Johnny Chen 4badfb8a1f Also prints out the stop reason string for lldbutil.PrintStackTrace(thread).
llvm-svn: 117281
2010-10-25 18:43:29 +00:00
Johnny Chen ae5de9b269 Skip this test module for the time being until we get a newer clang on lldb tot.
llvm-svn: 117278
2010-10-25 18:26:20 +00:00
Jason Molenda ab4f1924db Check in the native lldb unwinder.
Not yet enabled as the default unwinder but there are no known
backtrace problems with the code at this point.

Added 'log enable lldb unwind' to help diagnose backtrace problems;
this output needs a little refining but it's a good first step.

eh_frame information is currently read unconditionally - the code
is structured to allow this to be delayed until it's actually needed.
There is a performance hit when you have to parse the eh_frame
information for any largeish executable/library so it's necessary
to avoid if possible.

It's confusing having both the UnwindPlan::RegisterLocation struct
and the RegisterConextLLDB::RegisterLocation struct, I need to rename
one of them.

The writing of registers isn't done in the RegisterConextLLDB subclass
yet; neither is the running of complex DWARF expressions from eh_frame
(e.g. used for _sigtramp on Mac OS X).

llvm-svn: 117256
2010-10-25 11:12:07 +00:00
Sean Callanan a242417a90 Fixes to Objective-C built-in type handling.
Specifically, we fixed handling of the objc_class
built-in type, which allowed us to pass
named Objective-C objects to functions,
call variable list -t on objects safely, etc.

llvm-svn: 117249
2010-10-25 00:29:48 +00:00
Sean Callanan 64186e7faa Added a hack so that "unichar" is resolved to
"unsigned short."  As discussed in the comments,
this is pending a better solution to the problem
of types not in the debug information but readily
available through headers.

llvm-svn: 117247
2010-10-24 20:45:49 +00:00
Sean Callanan 672ad94681 Fixed value objects so that they return an
informative message when they have no description.

llvm-svn: 117190
2010-10-23 00:18:49 +00:00
Jim Ingham 65a0e595e6 If we hit a thread specific breakpoint for another thread, don't report the Exception as the stop reason, you have to report no stop reason.
llvm-svn: 117179
2010-10-22 23:28:32 +00:00
Sean Callanan cf5498f1c7 Added a temporary hack to allow casting of Objective-C
method results to int.  This will only last until we
get accurate type information for Objective-C methods
or some way of making their types inferred by the
parser.

llvm-svn: 117178
2010-10-22 23:25:16 +00:00
Johnny Chen 8334dadb62 Add more docstring for the lldbtest.TestBase class.
llvm-svn: 117175
2010-10-22 23:15:46 +00:00
Johnny Chen f3f1e00e24 Just use 'test harness', not 'test harness runtime'.
llvm-svn: 117153
2010-10-22 21:37:51 +00:00
Johnny Chen f4f70bb890 Comment heading changes.
llvm-svn: 117152
2010-10-22 21:31:03 +00:00
Greg Clayton 54180398fa Fix the default prompt to have a space.
llvm-svn: 117150
2010-10-22 21:15:00 +00:00
Johnny Chen a91b9474da Add text about test class cleanup.
llvm-svn: 117148
2010-10-22 21:06:04 +00:00
Johnny Chen d9bebeb2be Comment out the debug statement for printing the SBBreakpoint object.
llvm-svn: 117140
2010-10-22 20:08:56 +00:00
Johnny Chen bc095dbe68 The test should remove 'output.txt' if it exists before launching the inferior
process which is supposed to create the file.

llvm-svn: 117136
2010-10-22 19:51:42 +00:00
Johnny Chen 8c251f4209 Add some more usage text.
llvm-svn: 117129
2010-10-22 19:00:18 +00:00
Jim Ingham 49e80a1142 Changed "run" to alias "process launch --".
Added "po" alias for "expression -o --"

llvm-svn: 117125
2010-10-22 18:47:16 +00:00
Johnny Chen 5bfb8ee64e Add test case for using SBBreakpointLocation to set break condition.
llvm-svn: 117116
2010-10-22 18:10:25 +00:00
Johnny Chen 962b799070 Fix misnamed test method names.
llvm-svn: 117101
2010-10-22 16:17:39 +00:00
Greg Clayton 0188eb9a5f Fixed a error formatting output issue when dumping variables where the error had no space before it and was missing a newline.
llvm-svn: 117086
2010-10-22 02:39:02 +00:00
Jim Ingham 041a12fc31 Add and SB API to set breakpoint conditions.
llvm-svn: 117082
2010-10-22 01:15:49 +00:00
Sean Callanan 6608f07a79 Fixed IRForTarget to not recognize $__lldb variables
as persistent variables.  These are special markers
used by LLDB.

llvm-svn: 117078
2010-10-21 22:41:32 +00:00
Johnny Chen de7cd9229e Mark these test methods to be eligible for running only under the 'darwin' platform.
llvm-svn: 117071
2010-10-21 21:58:02 +00:00
Johnny Chen 05ac744e3d Add more information.
llvm-svn: 117066
2010-10-21 21:39:02 +00:00
Johnny Chen c14e08f437 Rewording of output message.
llvm-svn: 117030
2010-10-21 17:00:35 +00:00
Johnny Chen 096011eebf Add an option '-s session-dir-name' to overwrite the default timestamp-named
directory used to dump the session info for test failures/errors.

Example:

/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -s jason -v array_types

Session info for test errors or failures will go into directory jason
----------------------------------------------------------------------
Collected 4 tests

test_with_dsym_and_python_api (TestArrayTypes.ArrayTypesTestCase)
Use Python APIs to inspect variables with array types. ... ok
test_with_dsym_and_run_command (TestArrayTypes.ArrayTypesTestCase)
Test 'frame variable var_name' on some variables with array types. ... ok
test_with_dwarf_and_python_api (TestArrayTypes.ArrayTypesTestCase)
Use Python APIs to inspect variables with array types. ... ok
test_with_dwarf_and_run_command (TestArrayTypes.ArrayTypesTestCase)
Test 'frame variable var_name' on some variables with array types. ... FAIL

======================================================================
FAIL: test_with_dwarf_and_run_command (TestArrayTypes.ArrayTypesTestCase)
Test 'frame variable var_name' on some variables with array types.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Volumes/data/lldb/svn/trunk/test/array_types/TestArrayTypes.py", line 27, in test_with_dwarf_and_run_command
    self.array_types()
  File "/Volumes/data/lldb/svn/trunk/test/array_types/TestArrayTypes.py", line 62, in array_types
    'stop reason = breakpoint'])
  File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 594, in expect
    self.runCmd(str, trace = (True if trace else False), check = not error)
  File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 564, in runCmd
    msg if msg else CMD_MSG(cmd, True))
AssertionError: False is not True : Command 'thread list' returns successfully

----------------------------------------------------------------------
Ran 4 tests in 3.086s

FAILED (failures=1)
/Volumes/data/lldb/svn/trunk/test $ ls jason
TestArrayTypes.ArrayTypesTestCase.test_with_dwarf_and_run_command.log
/Volumes/data/lldb/svn/trunk/test $ head -10 jason/TestArrayTypes.ArrayTypesTestCase.test_with_dwarf_and_run_command.log 
Session info generated @ Thu Oct 21 09:54:15 2010

os command: [['/bin/sh', '-c', 'make clean; make MAKE_DSYM=NO']]
stdout: rm -rf "a.out" "a.out.dSYM"  main.o main.d
cc -arch x86_64 -gdwarf-2 -O0   -c -o main.o main.c
cc -arch x86_64 -gdwarf-2 -O0  main.o -o "a.out"

stderr: None
retcode: 0

/Volumes/data/lldb/svn/trunk/test $ 

llvm-svn: 117028
2010-10-21 16:55:35 +00:00
Johnny Chen 5858df1315 Get rid of the microsecond field in the timestamp directory name used to dump the
session information files to.  This makes the directory name less intimidating.
Currently, the directory only gets created if there are failures/errors while
running the test suite.

llvm-svn: 116982
2010-10-21 01:03:38 +00:00
Johnny Chen 12672250c1 Add an example of option combination for running a single test method to the help text.
llvm-svn: 116980
2010-10-21 00:47:52 +00:00
Johnny Chen d7e27687c7 Initial check in of best-practice documentation for building test cases.
llvm-svn: 116964
2010-10-20 22:56:32 +00:00
Greg Clayton 58fc50e0e1 Fixed a crasher that could happen if a FileSpec had a filename only, or vice
versa.

llvm-svn: 116963
2010-10-20 22:52:05 +00:00
Johnny Chen 9695636cdb Add more bug info.
llvm-svn: 116950
2010-10-20 21:56:26 +00:00