Commit Graph

2631 Commits

Author SHA1 Message Date
Greg Clayton 4e4294bdee Added a new format for displaying an array of characters: eFormatCharArray
This us useful because sometomes you have to show a single character as: 'a'
(using eFormatChar) and other times you might have an array of single 
charcters for display as: 'a' 'b' 'c', and other times you might want to 
show the contents of buffer of characters that can contain non printable
chars: "\0\x22\n123". 

This also fixes an issue that currently happens when you have a single character
C string (const char *a = "a"; or char b[1] = { 'b' };) that was being output
as "'a'" incorrectly due to the way the eFormatChar format output worked.

llvm-svn: 133316
2011-06-17 23:50:44 +00:00
Greg Clayton c662ec8bd3 Fixed variable parsing to not parse block variables over and over due to an
issue in the way block variables are marked as parsed. In the DWARF parser we
always parse all blocks for a function at once, so we can mark all blocks as
having all variables parsed and avoid recursive function calls to try and
reparse things that have already been handled.

Fixed an issue with how variables get scoped into blocks. The DWARF parser can
now handle abtract class definitions that contain concrete static variables.
When the concrete instance of the class functions get instantiated, they will
track down the concrete block for the abtract block and add the variable to
each block.

llvm-svn: 133302
2011-06-17 22:10:16 +00:00
Johnny Chen f733f7d730 Test case test_connect_remote() has been passing consistently for some times.
Let's remove the @expectedFailure marker from it.

llvm-svn: 133294
2011-06-17 21:17:56 +00:00
Johnny Chen 61c71e75cd Modify a bunch of docstrings to be more correct. Check the SBError.Success() after attaching.
Also eat the stdout of the spawned "hello_world" process if not in TraceOn() mode.

llvm-svn: 133280
2011-06-17 19:38:48 +00:00
Johnny Chen a807902031 Add a bunch of test cases to TestHelloWorld.py to exercise combinations of dwarf/dsym debug setup.
Among them are test cases to exercise SBTarget.AttachToProcessWithName(); we attach to "hello_world",
and verify that, after attachment, the currently selected target indeed matches "hello_world".

llvm-svn: 133279
2011-06-17 19:21:30 +00:00
Johnny Chen 9f3552083d Localize the finding of our to-be-debugged executable in one spot during the setUp() phase.
Change the executable name to be "hello_world".

llvm-svn: 133277
2011-06-17 18:47:58 +00:00
Greg Clayton f3dd93c888 Added the notion of an system root for SDKs. This is a directory where all
libraries and headers exist. This can be specified using the platform select
function:

platform select --sysroot /Volumes/remote-root remote-macosx

Each platform subclass is free to interpret the sysroot as needed.

Expose the new SDK root directory through the SBDebugger class. 

Fixed an issue with the GDB remote protocol where unimplemented packets were
not being handled correctly.

llvm-svn: 133231
2011-06-17 03:31:01 +00:00
Johnny Chen b0f5372bb3 Modify docstring.
llvm-svn: 133230
2011-06-17 03:22:58 +00:00
Greg Clayton 73bf5dbd16 Improved the packet throughput when debugging with GDB remote by over 3x on
darwin (not sure about other platforms).

Modified the communication and connection classes to not require the
BytesAvailable function. Now the "Read(...)" function has a timeout in
microseconds.

Fixed a lot of assertions that were firing off in certain cases and replaced
them with error output and code that can deal with the assertion case.

llvm-svn: 133224
2011-06-17 01:22:15 +00:00
Johnny Chen 2cd8327605 o TestHelloWorld.py:
Add a test case for the SBTarget::AttachToProcessWithID() API call.

o main.c:

  The change goes with the added test case test_with_dwarf_and_attach_to_process_with_id_api() above.

o SBTarget.cpp:

  Checks whether we're in synchronous mode.  If yes, let's wait for the process to stop right after attaching.

llvm-svn: 133223
2011-06-17 00:51:15 +00:00
Johnny Chen 0d4f6dd01e o lldbutil.py:
For the print_stacktrace(thread, string_buffer = False) function, if we have debug info
  for a frame function, let's also emit the args for the current function.

o TestFrameUtils.py:

  Add stronger assertTrue for frame0's args.

o TestPrintStackTraces.py:

  Launch the inferior with ["abc", "xyz"] and expect '(int)argc=3' in the stack traces, since
  by design the inferior is built with debug info.

llvm-svn: 133204
2011-06-16 22:07:48 +00:00
Greg Clayton df509331c8 Add some extra linker flags to LLDB.framework so we can track down why we
aren't getting debug info from the liblldb-core.a file in our build server
builds.

llvm-svn: 133193
2011-06-16 21:22:36 +00:00
Caroline Tice d61c10bc79 Add 'batch_mode' to CommandInterpreter. Modify InputReaders to
not write output (prompts, instructions,etc.) if the CommandInterpreter
is in batch_mode.

Also, finish updating InputReaders to write to the asynchronous stream,
rather than using the Debugger's output file directly.

llvm-svn: 133162
2011-06-16 16:27:19 +00:00
Johnny Chen 5a0bee7c5f The extra burden for the Python API test case to assign its process object to self.process
in order to have its process cleaned up (terminated) upon tearDown is gone for good.
Let's simplify a bunch of Python API test cases.

llvm-svn: 133097
2011-06-15 22:14:12 +00:00
Johnny Chen 5b67ca8cc4 Simplify the base test class. Remove keyword argument setCookie from TestBase.runCmd() and
remove the self.runStarted attribute since the automatic shutdown of processes associated
with the targets are now performed automatically.

llvm-svn: 133092
2011-06-15 21:38:39 +00:00
Johnny Chen 3794ad95a7 Add an API to SBDebugger class:
bool SBDebugger::DeleteTarget(lldb::SBTarget &target);

which is used in the test tearDown() phase to cleanup the debugger's target list
so that it won't grow larger and larger as test cases are executed.  This is also
a good opportunity to get rid of the arcane requirement that test cases exercising
the Python API must assign the process object to self.process so that it gets
shutdown gracefully.  Instead, the shutdown of the process associated with each
target is now being now automatically.

Also get rid of an API from SBTarget class:

    SBTarget::DeleteTargetFromList(lldb_private::TargetList *list);

llvm-svn: 133091
2011-06-15 21:24:24 +00:00
Jim Ingham 691bcc2a62 Made GetConditionText const everywhere. Made it return NULL when there's no condition
like the doc's say it should.  Make sure we have a condition before we set up a test whether
we have one, so we only present a "could not parse condition" error if we actually have a condition.

llvm-svn: 133088
2011-06-15 21:16:00 +00:00
Jim Ingham 57f29f8014 Added a few trivial mods.
llvm-svn: 133084
2011-06-15 21:01:30 +00:00
Caroline Tice 15356e7f4f Replace direct uses of the Debugger's output stream with
uses of the asynchronous stream.

llvm-svn: 133076
2011-06-15 19:35:17 +00:00
Caroline Tice 8f7eb81bf6 Add an introduction to the scripting example web page.
llvm-svn: 133061
2011-06-15 16:37:40 +00:00
Johnny Chen 67a3e9e40c Update usage comment.
llvm-svn: 133020
2011-06-14 22:23:54 +00:00
Johnny Chen 25e68e3c1b Primitive attach support for linux
This patch is a starting point for the attach functionality.

Signed-off-by: Johnny Chen <johnny.chen@apple.com>
llvm-svn: 133006
2011-06-14 19:19:50 +00:00
Caroline Tice c1338e8d38 Add error message; clean up comment.
llvm-svn: 132997
2011-06-14 16:36:12 +00:00
Peter Collingbourne 6a520222d0 Improve error reporting in ProcessMonitor::Launch
llvm-svn: 132972
2011-06-14 03:55:58 +00:00
Peter Collingbourne 6234320933 Fix mistakes relating to ProcessMonitor::DupDescriptor
llvm-svn: 132971
2011-06-14 03:55:54 +00:00
Peter Collingbourne 4aeb47e23c If ProcessMonitor::Launch fails, post semaphore to notify caller
llvm-svn: 132970
2011-06-14 03:55:49 +00:00
Peter Collingbourne d736854419 Fix typo: curret -> current
llvm-svn: 132969
2011-06-14 03:55:45 +00:00
Peter Collingbourne 059640b521 Generalise pattern for matching IsValid signature
Previously the IsValid pattern matched only function signatures of
the form:
    def IsValid(*args): ...

However under SWIG 1.3.40 on Linux the signature reads:
    def IsValid(self): ...

The new pattern matches both signature types by matching only up to
the left paren.

llvm-svn: 132968
2011-06-14 03:55:41 +00:00
Peter Collingbourne eb994b27ff Declare CompareHistoryEvents and IsCurrentHistoryEvent as pure virtual functions
Fixes the Linux build.

llvm-svn: 132967
2011-06-14 03:55:38 +00:00
Peter Collingbourne 933f6f617d Add license header to InferiorCallPOSIX.cpp
llvm-svn: 132966
2011-06-14 03:55:34 +00:00
Peter Collingbourne 91322f1938 Fix typo: fucntion -> function
llvm-svn: 132965
2011-06-14 03:55:29 +00:00
Greg Clayton c0094b1be3 Remove assert() calls that were firing off and crashing the LLDB framework.
llvm-svn: 132960
2011-06-14 01:53:36 +00:00
Johnny Chen 143b39fba4 Removed unneeded method breakAfterLaunch() from the TestBase class to simplify our base class.
It was introduced to work around some debugger infrastructure bug which has long since been fixed.

llvm-svn: 132951
2011-06-13 23:19:35 +00:00
Caroline Tice 1f499bc039 Cleaning up the Python script interpreter: Use the
embedded_interpreter.py file rather than keeping it
all in a string and compiling the string (easier to maintain,
easier to read, remove redundancy).

llvm-svn: 132935
2011-06-13 21:33:00 +00:00
Caroline Tice 6e8dc334db More prompt-timing cleanups: Make multi-line expressions
use the asynchronous stream mechanism rather than writing
directly to the Debugger's output & error streams.

llvm-svn: 132930
2011-06-13 20:20:29 +00:00
Greg Clayton 792415b3b7 Make the size accessor const.
llvm-svn: 132829
2011-06-10 02:22:01 +00:00
Greg Clayton b677cb893d Header file cleanup and moved an inline to the implementation file.
llvm-svn: 132828
2011-06-10 01:37:29 +00:00
Greg Clayton c54dab63f2 Added an llvm::StringRef accessor.
llvm-svn: 132827
2011-06-10 01:32:06 +00:00
Greg Clayton 40df35ef1b Explicitly set the value to NULL when adding a string map entry.
llvm-svn: 132823
2011-06-10 00:00:19 +00:00
Greg Clayton c3ae1cefc0 I modified the StringMap that was being used to unique our debugger C strings
to have the value for the map be a "const char *" instead of an unused uint32_t.
This allows us to store the uniqued mangled/demangled counterpart in this map
for mangled names. This also speeds up the mangled/demangled counterpart lookup
that used to be maintained in a STL map by having direct access to the data.
If we eventually need to associate other strings to strings to more data, we
can make the value of the StringMap have a more complex value.

Added the start of a history source and history event class. It isn't being
used by anything yet, but might be shortly.

llvm-svn: 132813
2011-06-09 22:34:34 +00:00
Johnny Chen 4b6fed4bab Comment out the debug stmts.
llvm-svn: 132808
2011-06-09 22:09:52 +00:00
Johnny Chen e2b5cfd826 Add rich comparison methods for the SBAddress object.
If two SBAddress's have the same module and file address, they are considered equal.

Add a test snippet 'sa1 == sa2' to exercise the rich comparison methods for SBAddress.

llvm-svn: 132807
2011-06-09 22:04:56 +00:00
Johnny Chen f5fe34ff9c Remove extra whitespace.
llvm-svn: 132692
2011-06-06 21:36:56 +00:00
Greg Clayton a658fd26c3 Created a std::string in the base StopInfo class for the description and
cleaned up all base classes that had their own copy. Added a SetDescription
accessor to the StopInfo class.

llvm-svn: 132615
2011-06-04 01:26:29 +00:00
Greg Clayton 54e8ac5562 Make sure we are ok to stop in a thread plan and have no stop reason for
the thread we were running on (other thread crashed or had exceptional stop
reason).

llvm-svn: 132599
2011-06-03 22:12:42 +00:00
Greg Clayton 3b292a1ed3 Don't codesign with lldb_codesign for non MacOSX SDKs.
llvm-svn: 132597
2011-06-03 22:08:56 +00:00
Johnny Chen c95f5de211 Add InferiorCallPOSIX.cpp/.h into the xcode project file to fix build error.
llvm-svn: 132594
2011-06-03 21:27:28 +00:00
Peter Collingbourne 6b5f17a586 Fix some order-of-initialisation warnings
llvm-svn: 132588
2011-06-03 20:41:09 +00:00
Peter Collingbourne 10bc01032c Implement RegisterContextLinux_x86_64::{Read,Write}AllRegisterValues
llvm-svn: 132587
2011-06-03 20:41:02 +00:00
Peter Collingbourne 5a6fa540dc Move SaveFrameZeroState and RestoreSaveFrameZero implementations to Thread base class
llvm-svn: 132586
2011-06-03 20:40:54 +00:00