Commit Graph

3488 Commits

Author SHA1 Message Date
Johnny Chen 2fd89a0956 Get the address and the size of the variable for passing to the Target::CreateWatchpointLocation() method.
llvm-svn: 139614
2011-09-13 18:30:59 +00:00
Greg Clayton cce8671fca Fixed some incorrect return values.
llvm-svn: 139582
2011-09-13 04:03:52 +00:00
Johnny Chen 7313a648e9 Fix compiler warning.
llvm-svn: 139569
2011-09-13 01:15:36 +00:00
Johnny Chen 02ae341043 Add trivial implementation for GetDescription().
llvm-svn: 139568
2011-09-13 01:13:20 +00:00
Jason Molenda 354b9a65f9 In ThreadList::GetSelectedThread, handle the case where we have no
valid threads - can happen if attaching to a process fails in a
certain way.

llvm-svn: 139567
2011-09-13 01:13:16 +00:00
Jason Molenda 542adbfccf Change the macosx Host::FindProcesses() to include all processes
(running under any uid) if lldb is being run as root.  It might be
better to handle this up at the ProcessInstanceInfoMatch class with
its m_match_all_users ivar instead of down here...

llvm-svn: 139566
2011-09-13 00:52:59 +00:00
Jim Ingham e37d605e7d SBSourceManager now gets the real source manager either from the Debugger or Target. Also, move the SourceManager file cache into the debugger
so it can be shared amongst the targets.

llvm-svn: 139564
2011-09-13 00:29:56 +00:00
Johnny Chen 1e49e5e730 Remove an unnecessary 'else { ... }', which adds to vertical as well as horizontal spans,
from CommandObjectFrame::Execute().

llvm-svn: 139561
2011-09-12 23:58:53 +00:00
Johnny Chen 887062aeb3 Watchpoint WIP:
o Rename from OptionGroupWatchpoint::WatchMode to OptionGroupWatchpoint::WatchType,
  and CommandArgumentType::eArgTypeWatchMode to CommandArgumentType::eArgTypeWatchType.
  Update the sources to reflect the change.

o Add a CreateWatchpointLocation() method to Target class, which is currently not implmeneted
  (returns an empty WatchpointLocationSP object).  Add logic to CommandObjectFrame::Execute()
  to exercise the added API for creating a watchpoint location.

llvm-svn: 139560
2011-09-12 23:38:44 +00:00
Greg Clayton d4a2b37091 Huge memory and performance improvements in the DWARF parser.
Address ranges are now split up into two different tables: 
- one in DWARFDebugInfo that is compile unit specific
- one in each DWARFCompileUnit that has exact function DIE offsets

This helps keep the size of the aranges down since the main table will get
uniqued and sorted and have consecutive ranges merged. We then only parse the
compile unit one on demand once we have determined that a compile unit contains
the address in question. We also now use the .debug_aranges section if there 
is one instead of always indexing the DWARF manually.

NameToDIE now uses a UniqueCStringMap<dw_offset> map instead of a std::map.
std::map is very bulky as each node has 3 pointers and the key and value types.
This gets our NameToDIE entry down to 12 bytes each instead of 48 which saves
us a lot of memory when we have very large DWARF.

DWARFDebugAranges now has a smaller footprint for each range it contains to 
save on memory.

llvm-svn: 139557
2011-09-12 23:21:58 +00:00
Johnny Chen 926d086e9b Fix indentations, add some comments.
llvm-svn: 139534
2011-09-12 20:25:57 +00:00
Greg Clayton 98f8c5252e Added GDB/LLDB commands for the "target stop-hook add" command.
llvm-svn: 139529
2011-09-12 19:56:07 +00:00
Johnny Chen 3a9838c07b Fix a bug in OptionGroupWatchpoint.cpp where the '-w' option arg parsing result was not checked
to effect an early error return.

Plus add logic to 'frame variable' command object to check that when watchpoint option is on,
only one variable with exact name (no regex) is specified as the sole command arg.

llvm-svn: 139524
2011-09-12 19:12:06 +00:00
Greg Clayton a76dd62211 Fixed the header guards.
llvm-svn: 139490
2011-09-12 04:20:38 +00:00
Greg Clayton b14eeddaa1 Fixed the logging output to be done consistently across all plug-ins.
Added a new log category for DWARF called "aranges" to log the parsing
of address ranges.

llvm-svn: 139489
2011-09-12 04:05:41 +00:00
Greg Clayton 6372d1cda2 Changed to using an "operator bool" instead of an "operator void*"
and avoid returning a pointer to the current object. In the new 
"operator bool" implementation, check the filename object first 
since many times we have FileSpec objects with a filename, yet no
directory.

llvm-svn: 139488
2011-09-12 04:00:42 +00:00
Greg Clayton 24756648e5 Fixed up the comments in the headerdoc to match the current implementation
of how ConstString objects work, and removed the duplicate and out of date
comments that were in the cpp file.

llvm-svn: 139487
2011-09-12 03:55:58 +00:00
Greg Clayton 38e953dda2 Fixes for Symtab.cpp to take advantage of the new unique C string map
changes that were just submitted.

llvm-svn: 139478
2011-09-11 00:20:09 +00:00
Greg Clayton c0a87652ba Added extra calls to the UniqueCStringMap to allow it to be used
more efficiently when it contains a large number of items. Since
the map is actually a vector of "const char *" and type T values,
it will double in size every time you append to it. The extra
added functions allow the collection to be sized to fit the data
after all entries have been appended, and lookups by name or by
regex have been built in to the class to allow efficient lookup.

llvm-svn: 139477
2011-09-11 00:06:05 +00:00
Greg Clayton 14a3551aea Don't skip the application specific ~/.lldbinit file when the program
name is "lldb". So currently when you startup any application and you
have not specified that you would like to skip loading init files through
the API or from "lldb" options, then LLDB will try and load:

"~/.lldbinit-%s" where %s the basename of your program
"~/.lldbinit"

Then LLDB will load any program specified on the command line and then
source the "./.llbinit" file for any temporary debug session specific
commands.

I want this feature because I have thread and frame formats that do
ANSI color codes that I only want to load when running in a terminal
which is when I am running the "lldb" command line program.

llvm-svn: 139476
2011-09-11 00:01:44 +00:00
Johnny Chen 944cdc09a9 A little bit of cleanup; set watch_mode to eWatchInvalid at the OptionParsingStarting() lifecycle point.
llvm-svn: 139467
2011-09-10 06:22:46 +00:00
Johnny Chen 0a57b2382b Convert OptionGroupVariable.cpp to use the arraysize() template function, as well.
llvm-svn: 139452
2011-09-10 01:19:01 +00:00
Greg Clayton 28469ca3a5 Quick fixes to the PE COFF file loader.
llvm-svn: 139448
2011-09-10 01:04:42 +00:00
Johnny Chen 28dda8eebc Add comment.
llvm-svn: 139447
2011-09-10 01:01:44 +00:00
Johnny Chen 7c575b3b3a Refactoring: replace a bunch of static array size computation or hardcoded constant
with a template function 'arraysize(static_array)', defined in Utils.h.

llvm-svn: 139444
2011-09-10 00:48:33 +00:00
Enrico Granata 78d0638b7d Renaming a bulk of method calls from Get() to something more descriptive
llvm-svn: 139435
2011-09-09 23:33:14 +00:00
Johnny Chen b1d7529e57 Add OptionGroupWatchpoint.cpp/.h (preparatory work) for hooking up watchpoint to the 'frame variable' comand.
To watch a variable for read/write, issue:

    frame variable -w read_write

Note that '-w' option is not working yet. :-)

llvm-svn: 139434
2011-09-09 23:25:26 +00:00
Greg Clayton bf2331c491 Added the ability to introspect types thourgh the public SBType interface.
Fixed up many API calls to not be "const" as const doesn't mean anything to
most of our lldb::SB objects since they contain a shared pointer, auto_ptr, or
pointer to the types which circumvent the constness anyway.

llvm-svn: 139428
2011-09-09 23:04:00 +00:00
Johnny Chen 67b20bbbee Reset the debug status register, only if necessary, before we resume,
which saves unnecessary traffic to the kernel.

llvm-svn: 139410
2011-09-09 21:11:25 +00:00
Johnny Chen 6d487a9b77 Fix compiler warnings for GetGDBStoppointType().
llvm-svn: 139402
2011-09-09 20:35:15 +00:00
Greg Clayton f754f88f6d Added first pass at PE COFF file reading support. It parses the sections
correctly, symbols are coming soon. It also needs to be 32/64 bit hardened
with more testing.

llvm-svn: 139401
2011-09-09 20:33:05 +00:00
Enrico Granata 08633eea20 Adding two new options to the 'help' command:
--show-aliases (-a) shows aliases for commands, as well as built-in commands
 --hide-user-defined (-u) hides user defined commands
by default 'help' without arguments does not show aliases anymore. to see them, add --show-aliases
to have only built-in commands appear, use 'help --hide-user-defined' ; there is currently no way to hide
built-in commands from the help output
'help command' is not changed by this commit, and help is shown even if command is an alias and -a is not specified

llvm-svn: 139377
2011-09-09 17:49:36 +00:00
Johnny Chen 8a8ce4ad2f Fixed the error message:
./build-swig-Python.sh: line 76: INTERFACE_FILES: command not found

when running SWIG, which was introduced during the last checkin.

llvm-svn: 139376
2011-09-09 17:37:06 +00:00
Enrico Granata e6c42ad243 Objective-C runtime wrapper
llvm-svn: 139372
2011-09-09 16:47:15 +00:00
Enrico Granata bac233511d Fixing an issue with Python commands defined interactively
llvm-svn: 139345
2011-09-09 01:41:30 +00:00
Johnny Chen f2bd6a3984 Patch from Pilipe to allow "target create" on the remote-macosx platform!
llvm-svn: 139342
2011-09-09 00:20:12 +00:00
Johnny Chen 13f8dda9bc FreeBSD platform patch from Filipe!
llvm-svn: 139338
2011-09-09 00:10:04 +00:00
Enrico Granata 13f1d56170 Basic infrastructure code to exploit malloc stack logging as available on Mac OS X to track the allocation history of pointers on the target process
llvm-svn: 139337
2011-09-09 00:04:24 +00:00
Johnny Chen e92aa43b3b Patch from Filipe!
One fixes a trailing comma bug (g++ doesn't like them)
The other gets the Error from the result of an expression evaluation and uses it as the error for the Process::LoadImage() method.

llvm-svn: 139336
2011-09-09 00:01:43 +00:00
Johnny Chen 2592b87209 Remove code rot (unused class OptionGroupFrameVariable) from CommandObjectFrameVariable.
Plus minor indentation change.

llvm-svn: 139335
2011-09-08 23:52:06 +00:00
Jim Ingham b7f6b2fa3c Move the SourceManager from the Debugger to the Target. That way it can store the per-Target default Source File & Line.
Set the default Source File & line to main (if it can be found.) at startup.  Selecting the current thread & or frame resets 
the current source file & line, and "source list" as well as the breakpoint command "break set -l <NUM>" will use the 
current source file.

llvm-svn: 139323
2011-09-08 22:13:49 +00:00
Johnny Chen 47f43da196 Watchpoint WIP: on the debugger side, create an instance of either
StopInfoTrace or StopInfoWatchpoint based on the exc_sub_code, as well.

llvm-svn: 139315
2011-09-08 20:52:34 +00:00
Greg Clayton dc55a80da3 Added help on stack frame selection compared to GDB and corrected the register
command help to match the current LLDB.

llvm-svn: 139313
2011-09-08 20:14:22 +00:00
Johnny Chen f8f68a132a Added comments about exception code.
llvm-svn: 139294
2011-09-08 17:07:22 +00:00
Johnny Chen af3d4af4eb Add logic to the DNBArchImplX86_64/DNBArchImplI386::NotifyException() callback method
in order to distinguish the real single step exception from a watchpoint exception
which uses the same exc_type of EXC_BREAKPOINT and exc_code of EXC_I386_SGL.

This is done by checking the debug status register to find out whether the watchpoint
data break event has fired, and, if yes, stuff the data break address into the exception's
exc_sub_code field on the debugserver side for lldb to consume on the other end.

llvm-svn: 139274
2011-09-08 01:16:50 +00:00
Jim Ingham 213b454698 "frame select -r" should return an error if you are already at the top of the stack & try to go up or at the bottom and try to go down.
llvm-svn: 139273
2011-09-08 01:15:09 +00:00
Enrico Granata d769c128b6 other documentation changes
llvm-svn: 139271
2011-09-08 00:50:01 +00:00
Enrico Granata 645a763d72 documentation changes (WIP)
llvm-svn: 139249
2011-09-07 19:20:42 +00:00
Johnny Chen ec6a2d3160 Add logic to MachThreadList::GetThreadID() for the use case of setting a watchpoint
(MachThreadList::EnableHardwareWatchpoint()) where the watchpoint is not associated
with a thread and the current thread, if set, is returned, otherwise we return the
first thread.

Plus minor change to RNBRemote::HandlePacket_z() to use the existing macros to check
the validity of break_id/watch_id.

llvm-svn: 139246
2011-09-07 19:03:50 +00:00
Johnny Chen 9d814e0dd2 Minor change: compare the return val of DNBWatchpointSet() against INVALID_NUB_WATCH_ID
to determine its validity.

llvm-svn: 139209
2011-09-07 00:09:23 +00:00
Enrico Granata 855cd9012c Refactoring of Get() methods in FormatManager/FormatCategory to have explicative names and return shared-pointers instead of bools
Reduced the amount of memory required to avoid loops in DumpPrintableRepresentation() from 32 bits down to 1 bit
 - Additionally, disallowed creating summary strings of the form ${var%S} which did nothing but cause endless loops by definition

llvm-svn: 139201
2011-09-06 22:59:55 +00:00
Johnny Chen 11309a39ea Fill out implementation of Enable/DisableWatchpoint() for ProcessGDBRemote class (Not Tested Yet).
Also update the signature of WatchpointLocation::SetEnable() to take a bool as input arg.

llvm-svn: 139198
2011-09-06 22:38:36 +00:00
Johnny Chen 1ac383c68d Test should print to stdout only if self.TraceOn() is True.
llvm-svn: 139174
2011-09-06 20:32:42 +00:00
Johnny Chen 1d6bad0b47 Add a data type WatchpointLocationList to the repository. A Target contains an instance of watchpoint location list.
Also add a typefed for WatchpointLocationSP to lldb-forward-rtti.h.

llvm-svn: 139166
2011-09-06 20:05:25 +00:00
Johnny Chen 86f97a417d DNBBreakpoint::SetEnabled() should take a bool, not a uint32_t, as its input argument.
Plus for watchpoint related functions, add new macros INVALID_NUB_WATCH_ID and
NUB_WATCH_ID_IS_VALID and use them, instead.

llvm-svn: 139163
2011-09-06 19:52:49 +00:00
Enrico Granata 9128ee2f7a Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
   a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
   in frozen objects ; now such reads transparently move from host to target as required
 - as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
   removed code that enabled to recognize an expression result VO as such
 - introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
   representing a T* or T[], and doing dereferences transparently
   in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
 - as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
   en lieu of doing the raw read itself
 - introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
   this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
   in public layer this returns an SBData, just like GetPointeeData()
 - introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
   the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
   of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
 - added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
 of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
 addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types

llvm-svn: 139160
2011-09-06 19:20:51 +00:00
Johnny Chen 8ed0ef9bae Change the signature of WatchpointLocation ctor so that the second param becomes
'size_t size', instead of 'lldb::tid_t tid'.  Pass size to the StoppointLocation
ctor as well.

llvm-svn: 139131
2011-09-06 02:52:28 +00:00
Johnny Chen 1bd08dd878 Watchpoint work in progress:
Add a virtual method GetHardwareWatchpointHit() to the DNBArchProtocol base class
which consults the architecture to return the watchpoint hit; otherwise return an
invalid index.

Add impl. of the method to X86_64 and I386 subclasses, plus reset the debug status
register before we resume execution of the inferior thread.

llvm-svn: 139034
2011-09-02 21:13:07 +00:00
Greg Clayton 9e315589e9 Added alpha .debug_names and .debug_types support in the DWARF parser.
llvm-svn: 138996
2011-09-02 04:03:59 +00:00
Greg Clayton afacd14b0b Added the ability for DWARF locations to use the ABI plug-ins to resolve
register names when dumping variable locations and location lists. Also did
some cleanup where "int" types were being used for "lldb::RegisterKind"
values.

llvm-svn: 138988
2011-09-02 01:15:17 +00:00
Greg Clayton aeecd9fd55 Added files I forget to checkin with my last checkin.
llvm-svn: 138981
2011-09-01 23:30:34 +00:00
Greg Clayton f9eec20bd3 Added support for accessing and loading our new .debug_names and .debug_types
DWARF accelerator table sections to the DWARF parser. These sections are similar
to the .debug_pubnames and .debug_pubtypes, but they are designed to be hash tables
that are saved to disc in a way that the sections can just be loaded into memory
and used without any work on the debugger side. The .debug_pubnames and .debug_pubtypes
sections are not ordered, contain a copy of the name in the section itself which
makes these sections quite large, they only include publicly exported names (so no
static functions, no types defined inside functions), many compilers put different
information in them making them very unreliable so most debugger ignore these sections
and parse the DWARF on their own. The tables must also be parsed and sorted in order 
to be used effectively. The new sections can be quickly loaded and very efficiently be used 
to do name to DIE lookups with very little up front work. The format of these new
sections will be changing while we work out the bugs, but we hope to have really 
fast name to DIE lookups soon.

llvm-svn: 138979
2011-09-01 23:16:13 +00:00
Greg Clayton f39c67685b Forgot to write out the NULL terminator when putting C string value into
a data using DataEncoder.

Added DataEncoder to the lldb-forward.h file.

llvm-svn: 138950
2011-09-01 18:13:54 +00:00
Greg Clayton 9482865f2a Added a DataEncoder class for the new IR evaluation expression parser so it
can reserve a block of memory and store stuff into it.

llvm-svn: 138949
2011-09-01 18:10:09 +00:00
Jim Ingham 3555b5d717 disassemble with no arguments disassembles at the pc. Also got "disassemble -f" to work, that had gotten broken at some point in the past.
llvm-svn: 138929
2011-09-01 01:11:04 +00:00
Johnny Chen 8d31e5eac5 Renaming: from IsVacantWatchpoint() to IsWatchpointVacant().
llvm-svn: 138907
2011-08-31 21:44:56 +00:00
Johnny Chen a18460635a Renamed the helper method to ClearWatchpointHits() for clarity of its purpose.
llvm-svn: 138899
2011-08-31 21:19:39 +00:00
Johnny Chen e0d4208a8b Add a couple of helper methods to check/clear the debug status register
which contains the watchpoint hit information.

llvm-svn: 138881
2011-08-31 19:05:55 +00:00
Johnny Chen 205395e7e0 Fix the shift amount applied to size_and_rw_bits() for debug control register,
which did not take into account the hardware index.

llvm-svn: 138867
2011-08-31 17:51:43 +00:00
Johnny Chen edce1f3f7d Update comments.
llvm-svn: 138863
2011-08-31 17:29:29 +00:00
Johnny Chen 0399ec26c0 Watchpoint work in progress: add helper methods to DNB arch impl for I386 to implment Enable/DisableHardwareWatchpoint.
llvm-svn: 138847
2011-08-31 00:50:10 +00:00
Johnny Chen ebb9bb4175 Watchpoint work in progress: add helper methods to DNB arch impl for X86_64 to implment Enable/DisableHardwareWatchpoint.
llvm-svn: 138844
2011-08-31 00:27:53 +00:00
Johnny Chen 2cf3222029 Add stubs of incomplete watchpoint implementation with "FIXME" markers.
llvm-svn: 138790
2011-08-30 01:30:03 +00:00
Greg Clayton 9414a367a1 Added the debug registers for i386 and x86_64 in preparation for watchpoints.
llvm-svn: 138770
2011-08-29 21:49:22 +00:00
Johnny Chen c0705f0b4f Remove an extra break statement.
llvm-svn: 138763
2011-08-29 21:01:50 +00:00
Johnny Chen 2bfaa32990 Patch by Filipe for FreeBSD platform plugin!
llvm-svn: 138761
2011-08-29 20:43:14 +00:00
Jim Ingham d3d25d9109 Fix a bunch of places where we were passing Stream *'s but were
never checking them for NULL.  Pass a reference instead.

llvm-svn: 138694
2011-08-27 01:24:54 +00:00
Jim Ingham a6c422b7de Don't change the host's environment, just append our Python Directory
directly to the one in sys.

llvm-svn: 138693
2011-08-27 01:24:08 +00:00
Jim Ingham 650543f9ba Hold onto a shared pointer to the frame CommandObjectFrameVariable::Execute is
analyzing so it won't get deleted on us if a formatter runs code.

llvm-svn: 138692
2011-08-27 01:22:52 +00:00
Johnny Chen 24281181bd Micro-optimization: Update the shift amount only when needed.
llvm-svn: 138678
2011-08-26 23:51:22 +00:00
Johnny Chen 4cd2a8e2f4 Update the test case in light of recent change of LLDB-Info.plist to track Apple Generic Version number
from the Xcode project file.

llvm-svn: 138677
2011-08-26 23:50:10 +00:00
Greg Clayton 8f258513a1 Fixed an assertion that could happen if we happened to parse a mach-o object
file that had a symbol that had a section specified where the section had
zero size. We now honor this section definition for the symbol and don't
assert anymore.

llvm-svn: 138646
2011-08-26 20:01:35 +00:00
Jim Ingham 318c9f2240 Move DIE location reporting into the DWARFDebugInfo class, use it from there in SymbolFileDWARF::ParseType (and eventually in other interesting places as well.)
llvm-svn: 138644
2011-08-26 19:44:13 +00:00
Greg Clayton 05562d1e5c Added code to test hash bucket sizes for an DWARF index that we can write
to a file.

llvm-svn: 138620
2011-08-26 02:44:58 +00:00
Johnny Chen d890bfc962 Add a new attribute self.lldbHere, representing the fullpath to the 'lldb' executable
built locally from the source tree.  This is distinguished from self.lldbExec, which
can be used by test/benchmarks to measure the performances against other debuggers.

You can use environment variable LLDB_EXEC to specify self.lldbExec to the dotest.py
test driver, otherwise it is going to be populated with self.lldbHere.

Modify the regular tests under test dir, i.e., not test/benchmarks, to use self.lldbHere.
Also modify the benchmarks tests to use self.lldbHere when it needs an 'lldb' executable
with debug info to do the performance measurements.

llvm-svn: 138608
2011-08-26 00:00:01 +00:00
Jim Ingham 16746d1f97 Add logging to SymbolFileDWARF::ParseType so that we can tell the type/comp_unit/obj_file were being processed when something goes wrong...
llvm-svn: 138600
2011-08-25 23:21:43 +00:00
Johnny Chen 943ddb730b Modify the impl of ThreadList::GetSelectedThread() so that it tries to fetch the
m_selected_tid thread first, check to see if it is valid (might be null if the
thread just exited), and if not select/return the 0th thread instead.

llvm-svn: 138591
2011-08-25 21:59:59 +00:00
Johnny Chen 689053770b Modify the loggings output oracle to fix test suite failure, after the recent change to CommandInterpreter.cpp.
llvm-svn: 138590
2011-08-25 21:51:45 +00:00
Johnny Chen bbfa68b090 Make ThreadList::GetSelectedThread() select and return the 0th thread if there's no
currently selected thread.  And update the call sites accordingly.

llvm-svn: 138577
2011-08-25 19:38:34 +00:00
Johnny Chen 40e3592961 Initializes (uint64_t)buf variable, patch by Filipe Cabecinhas!
llvm-svn: 138565
2011-08-25 17:40:39 +00:00
Johnny Chen 2c595273e0 Fix compilation error with DEBUG_STACK_FRAMES defined, patch by Filipe Cabecinhas!
With some slight modification.

llvm-svn: 138563
2011-08-25 17:27:02 +00:00
Greg Clayton 447ff1bfdc Make the CFBundleShortVersionString and CFBundleVersion automatically track
the Apple Generic Version number from the Xcode project.

llvm-svn: 138549
2011-08-25 04:13:59 +00:00
Jason Molenda 289673c052 Change old "settings set frame-prompt" and thread-prompt
to frame-format and thread-format.

llvm-svn: 138544
2011-08-25 02:46:44 +00:00
Jason Molenda b1ad65c548 Emit an error message if we're unable to write a value to a register.
(in addition to the previous error message if the value could not be 
parsed as a numbe).  These both generate reasonable errors now -
reg write rip 0x500000000000000000000a
reg write rip 0x5jjjj

llvm-svn: 138543
2011-08-25 01:59:13 +00:00
Jason Molenda bfb36ff9ea Include lldb/commands as a valid logging type in the
'log list' output.

Remove an extraneous \n from one of the lldb/commands
log line.

Add an lldb/commands log indicating whether the command
was successful or not.

llvm-svn: 138530
2011-08-25 00:20:04 +00:00
Greg Clayton e1be996baa Fix so we don't create C++ classes for all objective C classes when we have a
objective C++ source file.

llvm-svn: 138527
2011-08-24 23:50:00 +00:00
Jim Ingham 0f35ac2a54 The Compilation Unit language was being stored in a variable called "class_language"... Changed that to "cu_language".
llvm-svn: 138523
2011-08-24 23:34:20 +00:00
Johnny Chen dd6be27427 Remove skip decorator now that crash has been fixed.
Fix a compie warning for main.cpp.

llvm-svn: 138503
2011-08-24 22:30:47 +00:00
Sean Callanan 737330c1de Fixed a bug where the target for an expression was
not set if the containing function could not be
found.  This caused LLDB to crash later in
expression parsing.

llvm-svn: 138499
2011-08-24 22:18:12 +00:00
Johnny Chen b7bdd1001e Pretty print the run options for dumpSessionInfo(self) client.
llvm-svn: 138466
2011-08-24 19:48:51 +00:00
Johnny Chen ba3b99ef1c Fix compile warning.
llvm-svn: 138465
2011-08-24 19:35:24 +00:00
Johnny Chen 3e15c4d50b Don't display the stdout if not in TraceOn(), i.e, '-t option, mode.
llvm-svn: 138458
2011-08-24 18:19:50 +00:00
Johnny Chen 4ab4a9b897 The plugin impl of getCompiler() should be in unison with the Makefile.rules change.
llvm-svn: 138454
2011-08-24 18:12:53 +00:00
Johnny Chen a68135aed0 Remove the expectedFailure decorator. The test has been passing for some time now.
llvm-svn: 138452
2011-08-24 18:10:09 +00:00
Enrico Granata 65a6a6bea4 Moved the test code for Python commands out of the test case for aliases, into its own dedicated test case (one fill was still lurking in the old folder)
llvm-svn: 138446
2011-08-24 17:46:38 +00:00
Enrico Granata cb2921dbd3 Moved the test code for Python commands out of the test case for aliases, into its own dedicated test case
llvm-svn: 138444
2011-08-24 17:45:40 +00:00
Enrico Granata 45403f31f1 Documentation edits: correcting typos, adding information and general tweaks for readability
llvm-svn: 138442
2011-08-24 17:12:47 +00:00
Enrico Granata c5df00f0b9 Documentation on dynamic types (WIP)
llvm-svn: 138425
2011-08-24 04:53:31 +00:00
Enrico Granata 83cfc9abf8 Minor documentation changes (WIP)
llvm-svn: 138423
2011-08-24 01:49:09 +00:00
Enrico Granata 64997d6c0e More documentation changes (WIP)
llvm-svn: 138421
2011-08-24 01:32:46 +00:00
Johnny Chen 6d1010cb5c Patch by Filipe to build lldb usng 'make'!
llvm-svn: 138403
2011-08-23 22:36:23 +00:00
Johnny Chen 04adb62569 Uniquefy the various data-formatter test class names so that:
./dotest.py -v -f DataFormatterTestCase.test_with_dsym_and_run_command

will not end up running 14 tests.

llvm-svn: 138399
2011-08-23 22:32:45 +00:00
Johnny Chen 4aa4f5dc0a Skip these two cases temporarily while investigating the crash on OSX Lion with clang as the compiler.
llvm-svn: 138393
2011-08-23 22:10:17 +00:00
Johnny Chen 597cbbbd45 Make clang the default compiler for building the test programs.
llvm-svn: 138391
2011-08-23 21:54:10 +00:00
Enrico Granata 129c3db6a7 Fixing commas in enums (build breaker on GCC) as reported by Filipe Cabecinhas
llvm-svn: 138385
2011-08-23 21:29:50 +00:00
Enrico Granata 88da35f881 Improved the user-friendliness of errors shown by the summary feature in certain areas
Renamed format "signed decimal" to be "decimal". "unsigned decimal" remains unchanged:
 - the name "signed decimal" was interfering with symbol %S (use summary) in summary strings.
   because of the way summary strings are implemented, this did not really lead to a bug, but
   simply to performing more steps than necessary to display a summary. this is fixed.
Documentation improvements (more on synthetic children, some information on filters). This is still a WIP.

llvm-svn: 138384
2011-08-23 21:26:09 +00:00
Sean Callanan bccce81340 Added support for persistent types to the
expression parser.  You can use a persistent
type like this:

(lldb) expr struct $foo { int a; int b; };
(lldb) struct $foo i; i.a = 2; i.b = 3; i
($foo) $0 = {
  (int) a = 2
  (int) b = 3
}

typedefs work similarly.

This patch affects the following files:

test/expression_command/persistent_types/*
  A test case for persistent types,
  in particular structs and typedefs.

ClangForward.h
  Added TypeDecl, needed to declare some
  functions in ASTResultSynthesizer.h

ClangPersistentVariables.[h,cpp]
  Added a list of persistent types to the
  persistent variable store.

ASTResultSynthesizer.[h,cpp]
  Made the AST result synthesizer iterate
  across TypeDecls in the expression, and
  record any persistent types found.  Also
  made a minor documentation fix.

ClangUserExpression.[h,cpp]
  Extended the user expression class to
  keep the state needed to report the
  persistent variable store for the target
  to the AST result synthesizers. 

  Also introduced a new error code for
  expressions that executed normally but
  did not return a result.

CommandObjectExpression.cpp
  Improved output for expressions (like 
  declarations of new persistent types) that
  don't return a result.  This is no longer
  treated as an error.

llvm-svn: 138383
2011-08-23 21:20:51 +00:00
Enrico Granata db3485cd06 Short option for --summary-string in 'type summary add' is now -s. This might be a breaking change for those who have summaries defined.
llvm-svn: 138331
2011-08-23 16:13:35 +00:00
Johnny Chen 49996274fd Add some expected failure decorators with radar numbers.
llvm-svn: 138316
2011-08-23 01:00:14 +00:00
Enrico Granata dc9407308e Additional code cleanups ; Short option name for --python-script in type summary add moved from -s to -o (this is a preliminary step in moving the short option for --summary-string from -f to -s) ; Accordingly updated the test suite
llvm-svn: 138315
2011-08-23 00:32:52 +00:00
Enrico Granata 4b49acc5bb Separated FormatNavigator and FormatManager in two different files ; moved FormatCategoryItem enum out of FormatManager.h as a debugger-wide lldb_private enum ; minor style cleanups
llvm-svn: 138307
2011-08-22 23:45:15 +00:00
Sean Callanan 60dbc63a89 Restored the version of LLVM that we previously
rolled back, and the testcase that the rollback
broke.

The new LLVM has a new ARM disassembler, which
may cause instability.  Keeping the old one would
force us into a contorted position vis-a-vis the
LLVM sources we bring in, so we will address
issues on the new one rather than keeping the old
one around.

llvm-svn: 138284
2011-08-22 22:34:22 +00:00
Greg Clayton 944b828abb Finishing the renaming from "MacOSX-Kernel" to "Darwin-Kernel".
llvm-svn: 138283
2011-08-22 22:30:57 +00:00
Greg Clayton d4bfbc9ac0 Renaming "MacOSX-Kernel" to "Darwin-Kernel". The file contents and project
commit will come shortly after this commit.

llvm-svn: 138282
2011-08-22 22:23:48 +00:00
Johnny Chen 81ab3f5d31 Fix the 'target variable' help syntax to output one or more <variable-name>'s.
Add a simple test case for that.

llvm-svn: 138281
2011-08-22 22:22:00 +00:00
Johnny Chen 30123f114a Check the timesatmps of includees python-extensions.swig and python-wrapper.swig and force
a re-SWIG if newer than the SWIG-generated LLDBWrapPython.cpp file.

llvm-svn: 138280
2011-08-22 22:10:57 +00:00
Enrico Granata 0a976141c5 More cleanups ; Separated implementation of FormatManager from class DataVisualization as a front-end by using separate .h/.cpp files - Final aim is to break up FormatManager.h/cpp into several separate files
llvm-svn: 138279
2011-08-22 22:03:47 +00:00
Jim Ingham 586b0bd8bd Don't let Python write its .pyc files, that's not really polite...
llvm-svn: 138262
2011-08-22 19:10:09 +00:00
Enrico Granata 1d887499c4 Code cleanup and refactoring (round 4):
- FormatCategories now are directly mapped by ConstString objects instead of going through
   const char* -> ConstString -> const char*
 - FormatCategory callback does not pass category name anymore. This is not necessary because
   FormatCategory objects themselves hold their name as a member variable

llvm-svn: 138254
2011-08-22 18:36:52 +00:00
Johnny Chen 1dc9a20c16 Modify test cases to use 'target variable' to display global variables.
llvm-svn: 138247
2011-08-22 17:58:14 +00:00
Enrico Granata def5391ae5 - Support for Python namespaces:
If you have a Python module foo, in order to use its contained objects in LLDB you do not need to use
  'from foo import *'. You can use 'import foo', and then refer to items in foo as 'foo.bar', and LLDB
  will know how to resolve bar as a member of foo.
  Accordingly, GNU libstdc++ formatters have been moved from the global namespace to gnu_libstdcpp and a few
  test cases are also updated to reflect the new convention. Python docs suggest using a plain 'import' en lieu of
  'from-import'.

llvm-svn: 138244
2011-08-22 17:34:47 +00:00
Enrico Granata 23e578c94a Fixing a startup error
llvm-svn: 138237
2011-08-22 16:38:44 +00:00
Enrico Granata 5a61fc0da5 Exception-awareness for gnu_libstdcpp formatters ; Documentation update
llvm-svn: 138236
2011-08-22 16:10:25 +00:00
Greg Clayton 56d9a1b31b Added a new plug-in type: lldb_private::OperatingSystem. The operating system
plug-ins are add on plug-ins for the lldb_private::Process class that can add
thread contexts that are read from memory. It is common in kernels to have
a lot of threads that are not currently executing on any cores (JTAG debugging
also follows this sort of thing) and are context switched out whose state is
stored in memory data structures. Clients can now subclass the OperatingSystem
plug-ins and then make sure their Create functions correcltly only enable 
themselves when the right binary/target triple are being debugged. The 
operating system plug-ins get a chance to attach themselves to processes just
after launching or attaching and are given a lldb_private::Process object 
pointer which can be inspected to see if the main executable, target triple,
or any shared  libraries match a case where the OS plug-in should be used.
Currently the OS plug-ins can create new threads, define the register contexts
for these threads (which can all be different if desired), and populate and
manage the thread info (stop reason, registers in the register context) as
the debug session goes on.

llvm-svn: 138228
2011-08-22 02:49:39 +00:00
Johnny Chen 1cd81bf9e5 Fix typos in comment.
llvm-svn: 138179
2011-08-20 01:02:31 +00:00
Johnny Chen 8fff33615d Use os.walk(), available since 2.3, instead of os.path.walk(), removed in 3.0,
to walk the directory tree.  Plus, we can concentrate only on leaf nodes, i.e., files.

llvm-svn: 138178
2011-08-20 01:00:16 +00:00
Enrico Granata e73d96f659 Further fix for SWIG interoperability; making sure the Release() method of SBCommandReturnObject is called at all times
llvm-svn: 138169
2011-08-20 00:26:17 +00:00
Johnny Chen 20f19d1d02 No need to look further if the file is a symbolic link. Look for the real file.
Plus add some comments.

llvm-svn: 138159
2011-08-20 00:12:13 +00:00
Enrico Granata 274fd6e965 Fixed some SWIG interoperability issues
llvm-svn: 138154
2011-08-19 23:56:34 +00:00
Greg Clayton 756f8ae520 Fixed an issue where even if the communication object had Clear() called on
it, it could try and call through to an installed callback.

llvm-svn: 138146
2011-08-19 23:28:37 +00:00
Greg Clayton 7d47a66379 Added the ability to create a SBCommandReturnObject object from a pointer
and also to later release the ownership of the pointer object. This was needed
for SWIG interaction.

llvm-svn: 138133
2011-08-19 23:06:38 +00:00
Enrico Granata 58ad33440a Taking care of an issue with using lldb_private types in SBCommandInterpreter.cpp ; Making NSString test case work on Snow Leopard ; Removing an unused variable warning
llvm-svn: 138105
2011-08-19 21:56:10 +00:00
Enrico Granata d64d0bc0ea - Now using ${var} as the summary for an aggregate type will produce "name-of-type @ object-location" instead of giving an error
e.g. you may get "foo_class @ 0x123456" when typing "type summary add -f ${var} foo_class"
- Added a new special formatting token %T for summaries. This shows the type of the object.
  Using it, the new "type @ location" summary could be manually generated by writing ${var%T} @ ${var%L}
- Bits and pieces required to support "frame variable array[n-m]"
  The feature is not enabled yet because some additional design and support code is required, but the basics
  are getting there
- Fixed a potential issue where a ValueObjectSyntheticFilter was not holding on to its SyntheticChildrenSP
  Because of the way VOSF are being built now, this has never been an actual issue, but it is still sensible for
  a VOSF to hold on to the SyntheticChildrenSP as well as to its FrontEnd

llvm-svn: 138080
2011-08-19 21:13:46 +00:00
Johnny Chen 758f288cdd Add a Python script to locate each binary file under a root directory which matches some pathname pattern
and to invoke lldb-disasm.py on the binary file to disassemble its symbols.  The number of symbols can
be specified by, for example, '-n 10000', to specify 10,000 symbols to disassemble for each module.
By default, only 1000 symbols from each module are disassembled.

Example:

utils/test/run-dis.py -r '/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3/Symbols' -p '^/System/Library/.*Frameworks/.*\.framework/[^/]+$'

tries to disassemble every public/private frameworks (by default only 1000 symbols are disassembled) under iOS4.3.

llvm-svn: 138078
2011-08-19 20:51:15 +00:00
Johnny Chen aeaf436e3e Revert the workaround patch in the last check in. With the local patch to LLVM, it is no longer necessary.
llvm-svn: 138046
2011-08-19 17:31:59 +00:00
Johnny Chen 4c35b711da Fix TypeError exception for re.compile().
llvm-svn: 138045
2011-08-19 17:28:25 +00:00
Sean Callanan c8ce0becb5 Whoops, accidentally committed my local scheme.
llvm-svn: 138044
2011-08-19 17:18:31 +00:00
Sean Callanan a87bee84cf Refined the rollback to LLVM, picking up a newer
revision and adding a patch that fixes an AsmParser
crash on ARM.

One feature that we unfortunately lost (for the
moment!) is the ability to cast unknown code symbols
to arbitrary function types and put the resulting
function pointer in a result variable.  This feature
will be back, though.

llvm-svn: 138036
2011-08-19 06:19:25 +00:00
Enrico Granata da616d06e9 More thorough fix for the spaces-in-typename issue
llvm-svn: 138026
2011-08-19 01:47:11 +00:00
Johnny Chen b5825b82ad Minor change for the @expectedFailureClang logic. For the non-clang test failure, re-raise
the exception to get more stack trace information.

llvm-svn: 138021
2011-08-19 01:17:09 +00:00
Enrico Granata 02b6676d2b Third round of code cleanups:
- reorganizing the PTS (Partial Template Specializations) in FormatManager.h
 - applied a patch by Filipe Cabecinhas to make LLDB compile with GCC
Functional changes:
 - fixed an issue where command type summary add for type "struct Foo" would not match any types.
   currently, "struct" will be stripped off and type "Foo" will be matched.
   similar behavior occurs for class, enum and union specifiers.

llvm-svn: 138020
2011-08-19 01:14:49 +00:00
Johnny Chen 31963cea0a Add a decorator for marking clang only expectedFailure. Use it for the test_step_over_3_times_with_dsym/dwarf()
test cases in TestThreadAPI.py by decorating it with @expectedFailureClang.

Example:

    @expectedFailureClang
    @python_api_test
    def test_step_over_3_times_with_dwarf(self):
        """Test Python SBThread.StepOver() API."""
        # We build a different executable than the default buildDwarf() does.
        d = {'CXX_SOURCES': 'main2.cpp', 'EXE': self.exe_name}
        self.buildDwarf(dictionary=d)
        self.setTearDownCleanup(dictionary=d)
        self.step_over_3_times(self.exe_name)

llvm-svn: 138019
2011-08-19 00:54:27 +00:00
Johnny Chen 42f192ad17 Revert the previous addition of expectedFailure decorators, it was a mistake.
llvm-svn: 138013
2011-08-19 00:00:55 +00:00
Johnny Chen 904cb64d64 Add expectedFailure decorator.
Failed possibly due to rollback of llvm/clang.

llvm-svn: 138011
2011-08-18 23:53:03 +00:00
Johnny Chen 293683b6c4 Add an option (-p regexp-pattern) to specify the regular expression symbol pattern we're interested in disassembling.
An example:

utils/test/lldb-disasm.py -C "platform select remote-ios" -o "-b -n" -e '~/CoreFoundation' -n 20 -p '-\[NSArray .+\]'

disassembles the first 20 NSArray instance methods found in the CoreFoundation module.

llvm-svn: 138002
2011-08-18 22:46:50 +00:00
Johnny Chen f6cb9bcf55 Apply some workaround for known crashers.
llvm-svn: 137991
2011-08-18 22:05:58 +00:00
Johnny Chen 901209dcca Add an option '-q' to have quiet disassembly by not printing out the disassembled result.
This could be useful by reducing the strain on standard output.

Example:

utils/test/lldb-disasm.py -C "platform select remote-ios" -o "-b -n" -e '~/CoreFoundation' -n 50 -q

llvm-svn: 137988
2011-08-18 22:04:27 +00:00
Sean Callanan 6afe390810 Because of disassembler crashes, I rolled back
LLVM to pull in the older ARM disassembler.  I
also modified our build scripts to support
building LLVM from one SVN revision and Clang
from another.

These are temporary measures; as soon as we
get some solid testing in with the new ARM
disassembler, we plan to switch right back.

llvm-svn: 137965
2011-08-18 18:18:33 +00:00
Enrico Granata 85933ed40c Second round of code cleanups:
- reorganizing classes layout to have public part first
   Typedefs that we want to keep private, but must be defined for some public code to work correctly are an exception
 - avoiding methods in the form T foo() { code; } all on one-line
 - moving method implementations from .h to .cpp whenever feasible
   Templatized code is an exception and so are very small methods
 - generally, adhering to coding conventions followed project-wide
Functional changes:
 - fixed an issue where using ${var} in a summary for an aggregate, and then displaying a pointer-to-aggregate would lead to no summary being displayed
   The issue was not a major one because all ${var} was meant to do in that context was display an error for invalid use of pointer
   Accordingly fixed test cases and added a new test case

llvm-svn: 137944
2011-08-18 16:38:26 +00:00
Jim Ingham 81ded935f8 Fix the "command alias" help string to make clear that the $<N> substitutions should be whole words in the output command.
llvm-svn: 137921
2011-08-18 02:29:05 +00:00
Enrico Granata c482a19294 First round of code cleanups:
- all instances of "vobj" have been renamed to "valobj"
 - class Debugger::Formatting has been renamed to DataVisualization (defined in FormatManager.h/cpp)
   The interface to this class has not changed
 - FormatCategory now uses ConstString's as keys to the navigators instead of repeatedly casting
   from ConstString to const char* and back all the time
   Next step is making the same happen for categories themselves
 - category gnu-libstdc++ is defined in the constructor for a FormatManager
   The source code for it is defined in gnu_libstdcpp.py, drawn from examples/synthetic at compile time
   All references to previous 'osxcpp' name have been removed from both code and file names
Functional changes:
 - the name of the option to use a summary string for 'type summary add' has changed from the previous --format-string
   to the new --summary-string. It is expected that the short option will change from -f to -s, and -s for --python-script
   will become -o

llvm-svn: 137886
2011-08-17 22:13:59 +00:00
Enrico Granata 217f91fc57 New category "gnu-libstdc++" provides summary for std::string and synthetic children for types std::map, std::list and std::vector
The category is enabled by default. If you run into issues with it, disable it and the previous behavior of LLDB is restored
 ** This is a temporary solution. The general solution to having formatters pulled in at startup should involve going through the Platform.
Fixed an issue in type synthetic list where a category with synthetic providers in it was not shown if all the providers were regex-based

llvm-svn: 137850
2011-08-17 19:07:52 +00:00
Enrico Granata 99f0b8f935 When defining a scripted command, it is possible to provide a docstring and that will be used as the help text for the command
If no docstring is provided, a default help text is created
LLDB will refuse to create scripted commands if the scripting language is anything but Python
Some additional comments in AppleObjCRuntimeV2.cpp to describe the memory layout expected by the dynamic type lookup code

llvm-svn: 137801
2011-08-17 01:30:04 +00:00
Jim Ingham 096675d781 Add "--" before providing the file & command args when launching lldb from the command line.
llvm-svn: 137790
2011-08-17 00:23:09 +00:00
Jim Ingham a9deaf971d Better help string for "lldb -- file arg1 arg2..."
llvm-svn: 137789
2011-08-16 23:57:58 +00:00
Enrico Granata 223383ed6c Changes to Python commands:
- They now have an SBCommandReturnObject instead of an SBStream as third argument
 - The class CommandObjectPythonFunction has been merged into CommandObjectCommands.cpp
 - The command to manage them is now:
  command script with subcommands add, list, delete, clear
   command alias is returned to its previous functionality
 - Python commands are now part of an user dictionary, instead of being seen as aliases
 

llvm-svn: 137785
2011-08-16 23:24:13 +00:00
Jim Ingham 556e653b6a Document how to pass program args to lldb command-line.
llvm-svn: 137784
2011-08-16 23:15:02 +00:00
Greg Clayton 3c503e1347 Bumped Xcode project versions for lldb-73 and debugserver-144.
llvm-svn: 137782
2011-08-16 23:11:03 +00:00
Johnny Chen 0241f1441f Add comment about recent change.
llvm-svn: 137776
2011-08-16 22:06:17 +00:00
Johnny Chen b7e62d0857 Comment change.
llvm-svn: 137749
2011-08-16 20:57:05 +00:00
Johnny Chen 4d9d9689a0 Add comment on known restrictions of the current implementation.
llvm-svn: 137748
2011-08-16 20:56:10 +00:00
Johnny Chen 9fd6bbb77c The redo script did not take into account the compiler and architecture configuration of the failed tests.
llvm-svn: 137741
2011-08-16 20:02:59 +00:00
Johnny Chen e1cdc922b2 Take clang output into account.
llvm-svn: 137739
2011-08-16 19:59:22 +00:00
Jim Ingham 5c2a57291c Re-enable the test for ValueAsUnsigned on a register Value.
llvm-svn: 137738
2011-08-16 19:03:09 +00:00
Greg Clayton 72da397a69 Fixed an issue where we could end up creating multiple
C++ methods for a function depending on how the DWARF was 
created. Now we parse the class type from the definition,
and all methods that use DW_AT_specification or DW_AT_abstract_origin
attributes to point to the definition, now won't create
duplicate entries. This is in response to how clang++ creates
much different DWARF than gcc.

llvm-svn: 137737
2011-08-16 18:40:23 +00:00
Greg Clayton cbc9eb45ab Fixed the logging output that appears when doing a:
(lldb) target modules dump symfile

llvm-svn: 137732
2011-08-16 18:19:31 +00:00
Sean Callanan efe9a42379 Fixed a performance problem where functions were
being searched for in too heavyweight a way.  Now,
when asking for the address of a function, the
expression parser just asks for a corresponding
data symbol.

llvm-svn: 137731
2011-08-16 18:09:29 +00:00
Johnny Chen bfcf37f18b Fix the test suite error of:
...

  File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 243, in __init__
    self.session = test.session if test else None
AttributeError: 'StdCXXDisassembleTestCase' object has no attribute 'session'

llvm-svn: 137724
2011-08-16 17:06:45 +00:00
Enrico Granata be93a35a8a Python commands:
It is now possible to use 'command alias --python' to define a command name that actually triggers execution of a Python function
 (e.g. command alias --python foo foo_impl makes a command named 'foo' that runs Python function 'foo_impl')
 The Python function foo_impl should have as signature: def foo_impl(debugger, args, stream, dict): where
  debugger is an object wrapping an LLDB SBDebugger
  args is the command line arguments, as an unparsed Python string
  stream is an SBStream that represents the standard output
  dict is an internal utility parameter and should be left untouched
 The function should return None on no error, or an error string to describe any problems

llvm-svn: 137722
2011-08-16 16:49:25 +00:00
Greg Clayton 2d928c4d07 Fixed register value objects to be able to return their values as unsigned
and signed integers.

llvm-svn: 137710
2011-08-16 03:49:01 +00:00
Jason Molenda 311186a6ef Allow for a cpu subtype of 4 to still be recognized as an x86_64
processor; we may get this subtype ("CPU_SUBTYPE_X86_ARCH1") back
when starting a kdp session.

llvm-svn: 137701
2011-08-16 01:23:22 +00:00
Johnny Chen 8557d298d4 Fix two logic errors uncovered by the static analyzer.
For the default case (illegal encoding type), just return false instead of break.

A8.6.84 LDRSH (register)
A8.6.309 VLD1 (single element to all lanes)

llvm-svn: 137699
2011-08-16 01:16:02 +00:00
Johnny Chen 2f821a5f8f Modify the expected substrings to accomodate clang, now that rdar://problem/8516141 has been fixed.
llvm-svn: 137698
2011-08-16 00:56:41 +00:00
Johnny Chen f79b076783 Forgot to initialize the self.__skipped__ attribute lldbtest.Base.
llvm-svn: 137696
2011-08-16 00:48:58 +00:00
Greg Clayton 6fdfc7e443 Fixed an issue where a variable that was a pointer whose
location was in a register would not be able to dereference 
children when displaying "*var" or the derefence of the variable.

llvm-svn: 137695
2011-08-16 00:44:29 +00:00
Jim Ingham e610d64bda Add missing check for non-NULL frame_sp.
llvm-svn: 137692
2011-08-16 00:07:28 +00:00
Johnny Chen c5cc625c79 Test driver should also report skipped tests because there were cases when tests were skipped
due to incorrect skip-logic.

llvm-svn: 137678
2011-08-15 23:09:08 +00:00
Enrico Granata 109c4c7f71 One-line fix for a possible spurious truncation warning
llvm-svn: 137640
2011-08-15 19:24:02 +00:00
Greg Clayton 6bc11b2756 Removed debug printf that was left in.
llvm-svn: 137630
2011-08-15 18:24:44 +00:00
Johnny Chen 0dc84d093e Add new SBAddress APIs to the fuzz tests.
llvm-svn: 137625
2011-08-15 18:19:51 +00:00
Enrico Granata 379447a7f2 Refactoring of ValueObject::DumpValueObject and 'frame variable', 'target variable' commands to use an Options object instead of passing an ever-increasing number of arguments to the DumpValueObject() method, with the ultimate aim of making that call private implementation
llvm-svn: 137622
2011-08-15 18:01:31 +00:00
Enrico Granata d0b8505a64 Objective-C runtime now caches resolved ISA information for increased efficiency
llvm-svn: 137612
2011-08-15 15:56:02 +00:00
Greg Clayton f6a5fc2e8b Patch from Matt Johnson that cleans up usage of APInt
to keep GCC 4.5.2 happy and also to not use a deprecated
llvm API.

llvm-svn: 137605
2011-08-15 07:23:47 +00:00
Greg Clayton 8753c1e057 Added the ability to use llvm::APInt class to view
any integers that are larger than a 8 bytes. We can now
display signed decimal, unsigned decimal, octal, and binary
(we could already view hex before this fix).

llvm-svn: 137602
2011-08-15 02:24:40 +00:00
Jim Ingham ff5f5ff963 Factor out the code that parses ObjC Method names into a static method
in ObjCLanguageRuntime.
Add the category-free name of symbols to the Symtab name-to-index list.

llvm-svn: 137600
2011-08-15 01:32:22 +00:00
Greg Clayton 98fcc4e60f Bumped Xcode project versions for lldb-72 and debugserver-143.
llvm-svn: 137547
2011-08-13 01:48:45 +00:00
Jim Ingham 66243847a5 Remember to restore the frame in the exe_ctx passed in to RunThreadPlan.
Also, default "source_init_file" to False in the version of SBDebugger::Create
so that we don't pick up the init file in Python.

llvm-svn: 137545
2011-08-13 00:56:10 +00:00
Johnny Chen fc7483f699 Add a simple test case to exercise the SBDebugger.CreateTargetWithFileAndTargetTriple() API.
llvm-svn: 137544
2011-08-13 00:55:56 +00:00
Jim Ingham a5636fc823 Test case for changing ValueObjects with SBValue::SetValueFromCString.
llvm-svn: 137543
2011-08-13 00:45:23 +00:00
Johnny Chen f017e8d6d7 Modify the skipUnless() logic to work for OSX Lion.
llvm-svn: 137542
2011-08-13 00:27:46 +00:00