Commit Graph

2930 Commits

Author SHA1 Message Date
Johnny Chen efee1cdc2b Fix comment.
llvm-svn: 135737
2011-07-22 00:51:54 +00:00
Johnny Chen 989b7efd8a Add BasicFormatter and ChildVisitingFormatter utility classes to the lldbutil.py module
which provide some convenient ways to print an SBValue object.  Use that in TestValueAPI.py
to print the 'days_of_week' char* array variable.

For an example:

cvf = lldbutil.ChildVisitingFormatter(indent=2)
print cvf.format(days_of_week)

produces:

(const char *[7]) days_of_week = 0x00000001026a5060 (location)
  (const char *) [0] = "Sunday"
  (const char *) [1] = "Monday"
  (const char *) [2] = "Tuesday"
  (const char *) [3] = "Wednesday"
  (const char *) [4] = "Thursday"
  (const char *) [5] = "Friday"
  (const char *) [6] = "Saturday"

llvm-svn: 135736
2011-07-22 00:47:58 +00:00
Enrico Granata d55546b27a when typing a summary string you can use the %S symbol to explicitly indicate that you want the summary to be used to print the target object
(e.g. ${var%S}). this might already be the default if your variable is of an aggregate type
new feature: synthetic filters. you can restrict the number of children for your variables to only a meaningful subset
 - the restricted list of children obeys the typical rules (e.g. summaries prevail over children)
 - one-line summaries show only the filtered (synthetic) children, if you type an expanded summary string, or you use Python scripts, all the real children are accessible
 - to provide a synthetic children list use the "type synth add" command, as in:
   type synth add foo_type --child varA --child varB[0] --child varC->packet->flags[1-4]
   (you can use ., ->, single-item array operator [N] and bitfield operator [N-M]; array slice access is not supported, giving simplified names to expression paths is not supported)
 - a new -S option to frame variable and target variable lets you override synthetic children and instead show real ones

llvm-svn: 135731
2011-07-22 00:16:08 +00:00
Johnny Chen 6cbb8d684f Add test scenario of SBValue APIs for the 'days_of_week' global variable.
llvm-svn: 135716
2011-07-21 23:02:00 +00:00
Johnny Chen 6853cf66d1 Add test scenario for exercising SBValue API: TypeIsPointerType() and GetByteSize().
llvm-svn: 135699
2011-07-21 19:31:59 +00:00
Johnny Chen becabe0e81 Initialize the all important automatic variable 'lldb::ConnectionStatus status' before
invoking the Read(...) method to read in bytes.  Similar to r135461.

llvm-svn: 135695
2011-07-21 19:00:59 +00:00
Jim Ingham 9411ddb65f If we are telling only one thread to run in debugserver, and that thread has been suspended from outside
the debugger, resume it before running so we will actually make progress.

llvm-svn: 135655
2011-07-21 01:54:41 +00:00
Enrico Granata 6d54d89af1 essentials contains two small summaries that you might really want to use; lldb contains some basic summaries for use in debugging LLDB itself. to use them, you must type category enable lldb
llvm-svn: 135653
2011-07-21 01:40:17 +00:00
Greg Clayton 5b88216ddc More KDP fixes and logging cleanup.
llvm-svn: 135652
2011-07-21 01:12:01 +00:00
Johnny Chen c7ed223d2a Change docstring wording: from 'method' to 'function'.
llvm-svn: 135648
2011-07-21 00:50:54 +00:00
Johnny Chen 3a31573f31 Add docstring for SBInstructionList class.
llvm-svn: 135647
2011-07-21 00:48:02 +00:00
Johnny Chen 098ca0e7e6 Add docstring for SBCommandReturnObject class.
llvm-svn: 135642
2011-07-21 00:32:12 +00:00
Johnny Chen ad4fe1b46e Add docstring for SBCommandInterpreter class.
llvm-svn: 135631
2011-07-20 22:50:58 +00:00
Johnny Chen 2e16d5dc8f Add docstring for SBBroadcaster class.
llvm-svn: 135630
2011-07-20 22:29:58 +00:00
Johnny Chen 424e55933a Add a note.
llvm-svn: 135615
2011-07-20 20:28:36 +00:00
Johnny Chen 15a6ac4821 Minor modification.
llvm-svn: 135606
2011-07-20 19:29:08 +00:00
Johnny Chen a17c7e0517 Skip the remaining -Y? (skipping ? layers of summaries) tests if using a known version
of Apple gcc build which produces wrong namespace for std::string in debug info.

llvm-svn: 135597
2011-07-20 18:29:32 +00:00
Greg Clayton 07e66e3ebe Added KDP resume, suspend, set/remove breakpoint, and kernel version support.
Also we now display a live update of the kexts that we are loading.

llvm-svn: 135563
2011-07-20 03:41:06 +00:00
Greg Clayton 87b0c1e63c Remove extra launch arguments.
llvm-svn: 135560
2011-07-20 02:22:21 +00:00
Greg Clayton 0c54d8a97c Added register reading support for ARM, i386 and x86_64.
llvm-svn: 135557
2011-07-20 01:32:50 +00:00
Johnny Chen 5cb19e7725 Add some docstrings for SBFileSpec class.
llvm-svn: 135553
2011-07-20 01:06:37 +00:00
Johnny Chen 8957729268 Add some docstrings for SBError class.
llvm-svn: 135547
2011-07-20 00:23:11 +00:00
Johnny Chen 2494f555b6 A more succinct assertTrue.
llvm-svn: 135544
2011-07-20 00:14:20 +00:00
Johnny Chen cd1211ef81 Minor change; add an assertTrue stmt.
llvm-svn: 135542
2011-07-20 00:11:54 +00:00
Johnny Chen 755e083ef6 Add some docstrings for SBSourceManager class.
llvm-svn: 135539
2011-07-19 23:35:10 +00:00
Johnny Chen e012858bd6 Add some docstrings for SBStream class.
llvm-svn: 135536
2011-07-19 23:24:36 +00:00
Johnny Chen fdc4a86c05 Move the rest of the SB headers to interface files.
They are not docstring'ed yet.

llvm-svn: 135531
2011-07-19 22:41:47 +00:00
Enrico Granata 2dee16e883 type category list now supports a regular expression argument that filters categories to only include the ones matching the regex
type summary list now supports a -w flag with a regular expression argument that filters categories to only include the ones matching the regex
in category and summary listings, categories are printed in a meaningful order:
 - enabled ones first, in the order in which they are searched for summaries
 - disabled ones, in an unspecified order
type summary list by default only expands non-empty enabled categories. to obtain a full listing, you must use the -w flag giving a "match-all" regex

llvm-svn: 135529
2011-07-19 22:35:10 +00:00
Johnny Chen 0f5196844d Rearrange the %include SWIG directives into two groups. One is the pure .h headers and the other is the .i interface files.
The objective is to move the .h header into .i interface file eventually.

llvm-svn: 135526
2011-07-19 21:49:34 +00:00
Enrico Granata 9df29e32c9 Applied Matt Johnson patch to ValueObject and FormatManager
llvm-svn: 135523
2011-07-19 20:57:44 +00:00
Greg Clayton 72c66dde39 Avoid calling accessor function more than once when result is already in
a local.

llvm-svn: 135512
2011-07-19 20:06:26 +00:00
Greg Clayton 9189b20875 Added some more functionality to SocketAddress and modified
ConnectionFileDescriptor to use it.

llvm-svn: 135511
2011-07-19 20:03:42 +00:00
Johnny Chen 4480530a0f Patch by Matt Johnson to silence G++ warnings!
Used hand merge to apply the diffs.  I did not apply the diffs for FormatManager.h and
the diffs for memberwise initialization for ValueObject.cpp because they changed since.
I will ask my colleague to apply them later.

llvm-svn: 135508
2011-07-19 19:48:13 +00:00
Johnny Chen 8a4fc74728 Fix build error for StringSummaryFormat undefined symbols.
llvm-svn: 135503
2011-07-19 19:39:02 +00:00
Enrico Granata 20edcdbe8a The implementation of categories is now synchronization safe
Code cleanup:
 - The Format Manager implementation is now split between two files: FormatClasses.{h|cpp} where the
   actual formatter classes (ValueFormat, SummaryFormat, ...) are implemented and
   FormatManager.{h|cpp} where the infrastructure classes (FormatNavigator, FormatManager, ...)
   are contained. The wrapper code always remains in Debugger.{h|cpp}
 - Several leftover fields, methods and comments from previous design choices have been removed
type category subcommands (enable, disable, delete) now can take a list of category names as input
 - for type category enable, saying "enable A B C" is the same as saying
    enable C
    enable B
    enable A
   (the ordering is relevant in enabling categories, and it is expected that a user typing
    enable A B C wants to look into category A, then into B, then into C and not the other
    way round)
 - for the other two commands, the order is not really relevant (however, the same inverted ordering
   is used for consistency)

llvm-svn: 135494
2011-07-19 18:03:25 +00:00
Greg Clayton ad440da346 Abstract "struct sockaddr", "struct sockaddr_in", "struct sockaddr_in6" and
"struct sockaddr_storage" into a new host class called SocketAddress. This
will allow us to control the host specific implementations (such as how to
get the length) into a single Host specific class.

llvm-svn: 135488
2011-07-19 16:44:54 +00:00
Greg Clayton a63d08c9ff Modified the LocateMacOSXFilesUsingDebugSymbols(...) function to locate
an executable file if it is right next to a dSYM file that is found using
DebugSymbols. The code also looks into a bundle if the dSYM file is right
next to a bundle.

Modified the MacOSX kernel dynamic loader plug-in to correctly set the load
address for kext sections. This is a tad tricky because of how LLDB chooses
to treat mach-o segments with no name. Also modified the loader to properly
handle the older version 1 kext summary info.

Fixed a crasher in the Mach-o object file parser when it is trying to set
the section size correctly for dSYM sections.

Added packet dumpers to the CommunicationKDP class. We now also properly 
detect address byte sizes based on the cpu type and subtype that is provided.
Added a read memory and read register support to CommunicationKDP. Added a
ThreadKDP class that now uses subclasses of the RegisterContextDarwin_XXX for
arm, i386 and x86_64. 

Fixed some register numbering issues in the RegisterContextDarwin_arm class
and added ARM GDB numbers to the ARM_GCC_Registers.h file.

Change the RegisterContextMach_XXX classes over to subclassing their
RegisterContextDarwin_XXX counterparts so we can share the mach register 
contexts between the user and kernel plug-ins.

llvm-svn: 135466
2011-07-19 03:57:15 +00:00
Enrico Granata 1490c6fd8f Fixed a bug where deleting a regex summary would not immediately reflect in the variables display
The "systemwide summaries" feature has been removed and replaced with a more general and
powerful mechanism.
Categories:
 - summaries can now be grouped into buckets, called "categories" (it is expected that categories
   correspond to libraries and/or runtime environments)
 - to add a summary to a category, you can use the -w option to type summary add and give
   a category name (e.g. type summary add -f "foo" foo_t -w foo_category)
 - categories are by default disabled, which means LLDB will not look into them for summaries,
   to enable a category use "type category enable". once a category is enabled, LLDB will
   look into that category for summaries. the rules are quite trivial: every enabled category
   is searched for an exact match. if an exact match is nowhere to be found, any match is
   searched for in every enabled category (whether it involves cascading, going to base classes,
   ...). categories are searched into the order in which they were enabled (the most recently
   enabled category first, then the second most and so on..)
 - by default, most commands that deal with summaries, use a category named "default" if no
   explicit -w parameter is given (the observable behavior of LLDB should not change when
   categories are not explicitly used)
 - the systemwide summaries are now part of a "system" category

llvm-svn: 135463
2011-07-19 02:34:21 +00:00
Johnny Chen 74549c82ad Initialize the all important automatic variable 'lldb::ConnectionStatus status' before
invoking the Read(...) method to read in bytes.  This seems to fix the infinite looping
I was seeing on SnowLeopard while running the test suite.

llvm-svn: 135461
2011-07-19 01:13:00 +00:00
Johnny Chen 349f076330 Add SWIG interface files for SBSymbol, SBSymbolContext, and SBSymbolContextList.
llvm-svn: 135459
2011-07-19 01:07:06 +00:00
Johnny Chen f74cb50cda Add SWIG Python interface files for SBLineEntry, SBListener, and SBModule.
llvm-svn: 135441
2011-07-18 23:11:07 +00:00
Johnny Chen d84a9a1249 Missed the interface file for SBFunction in the previous checkin.
llvm-svn: 135436
2011-07-18 22:15:37 +00:00
Johnny Chen 0eca544b45 Add SWIG Python interface files for SBDebugger, SBCompileUnit, and SBEvent.
llvm-svn: 135432
2011-07-18 22:11:53 +00:00
Johnny Chen 5de6a790f2 Add SWIG Python interface files for SBAddress, SBBlock, SBBreakpoint, and SBBreakpointLocation.
llvm-svn: 135430
2011-07-18 21:30:21 +00:00
Sean Callanan 22c52d9a98 Removed a redundant dyn_cast. Thanks to Felipe
Cabecinhas.

llvm-svn: 135429
2011-07-18 21:30:18 +00:00
Johnny Chen 357033b337 Add SWIG Python interface files for SBProcess, SBThread, and SBFrame.
llvm-svn: 135419
2011-07-18 20:13:38 +00:00
Johnny Chen 9a5b16b87c Fix header documentations.
llvm-svn: 135417
2011-07-18 19:15:22 +00:00
Johnny Chen 67ae7bdb54 Add two new interface files SBValue.i and SBValueList.i, instead of directly swigging the header files.
llvm-svn: 135416
2011-07-18 19:08:30 +00:00
Johnny Chen 482ad087ef Cleaned up the interface file for SBTarget.
llvm-svn: 135405
2011-07-18 17:53:20 +00:00
Enrico Granata 03f16a09bf Runtime errors in Python scripts were not being shown; this fix makes them print out to ease correcting errors
llvm-svn: 135395
2011-07-18 16:24:10 +00:00