Commit Graph

5152 Commits

Author SHA1 Message Date
Sean Callanan 6f3b394bfa Updated LLVM/Clang to force the record layout engine
to complete C++ classes before traversing their base
classes.

llvm-svn: 156570
2012-05-10 20:29:51 +00:00
Johnny Chen bbc00939f2 Sanity check the return value from SBSCopyApplicationDisplayIdentifiers() before calling CFArrayGetCount() on it.
rdar://problem/11331867

llvm-svn: 156562
2012-05-10 19:24:41 +00:00
Greg Clayton 3d081399f0 <rdar://problem/11388521>
Fixed a case where the install header phase in the Xcode project would not set the LLDB_VERSION #define correctly. It has now been fixed to key off of the CURRENT_PROJECT_VERSION which will get auto updated with "agvtool bump -all". This was done by adding a build setting to the install-headers makefile based target.

llvm-svn: 156535
2012-05-10 03:27:35 +00:00
Greg Clayton 5cc6ef9e89 Remove stuff from the xcscheme file that need not be checked in.
llvm-svn: 156533
2012-05-10 02:52:56 +00:00
Greg Clayton ba812f4284 <rdar://problem/11330621>
Fixed the DisassemblerLLVMC disassembler to parse more efficiently instead of parsing opcodes over and over. The InstructionLLVMC class now only reads the opcode in the InstructionLLVMC::Decode function. This can be done very efficiently for ARM and architectures that have fixed opcode sizes. For x64 it still calls the disassembler to get the byte size.

Moved the lldb_private::Instruction::Dump(...) function up into the lldb_private::Instruction class and it now uses the function that gets the mnemonic, operandes and comments so that all disassembly is using the same code.

Added StreamString::FillLastLineToColumn() to allow filling a line up to a column with a character (which is used by the lldb_private::Instruction::Dump(...) function).

Modified the Opcode::GetData() fucntion to "do the right thing" for thumb instructions.

llvm-svn: 156532
2012-05-10 02:52:23 +00:00
Jim Ingham 18de2fdc55 If the ObjC Step Through Trampoline plan causes a target crash, properly propagate the error back to
the controlling plans so that they don't lose control.

Also change "ThreadPlanStepThrough" to take the return StackID for its backstop breakpoint as an argument
to the constructor rather than having it try to figure it out itself, since it might get it wrong whereas
the caller always knows where it is coming from.

rdar://problem/11402287

llvm-svn: 156529
2012-05-10 01:35:39 +00:00
Sean Callanan 26e184d4e4 Added a #define of NULL to 0 to make NULL usable
in expressions.

llvm-svn: 156514
2012-05-09 21:27:03 +00:00
Johnny Chen fd02a89960 Make ctrl-c terminate the current input line and start an empty line, instead of the previous content.
rdar://problem/11412821

llvm-svn: 156510
2012-05-09 21:03:07 +00:00
Johnny Chen a21bd407e5 Option processing fix: should match '-F' exactly, instead.
llvm-svn: 156509
2012-05-09 21:00:03 +00:00
Filipe Cabecinhas 3a9b6e7140 Make redo.py more error-proof
Deal with being passed no parameters
Remove the infinite loop when it's passed something like --help

llvm-svn: 156504
2012-05-09 19:02:19 +00:00
Jim Ingham 5ce45fdfb1 Remove the string pool from the global destructor chain so it doesn't get yanked out from under us prematurely on exit.
rdar://problem/11358062

llvm-svn: 156496
2012-05-09 18:37:10 +00:00
Jim Ingham 8499e1a4cb Print out a notification when the process of a target other than the currently selected target stops.
llvm-svn: 156433
2012-05-08 23:06:07 +00:00
Enrico Granata a777dc2abe <rdar://problem/11338654> Fixing a bug where having a summary for a bitfield without a format specified would in certain cases crash LLDB - This has also led to refactoring the by-type accessors for the data formatter subsystem. These now belong in our internal layer, and are just invoked by the public API stratum
llvm-svn: 156429
2012-05-08 21:49:57 +00:00
Han Ming Ong b9c53daa55 <rdar://problem/11400476>
On Lion, because the rights initially doesn't exist in /etc/authorization, if an admin user logs in and uses lldb within the first 5 minutes, it is possible to do AuthorizationCopyRights on LaunchUsingXPCRightName and get the rights back. As another security measure, we make sure that the LaunchUsingXPCRightName rights actually exists.

Removed Xcode as the user of the XPC service to shrink the security surface area.

llvm-svn: 156424
2012-05-08 21:35:52 +00:00
Han Ming Ong 222bb03518 <rdar://problem/11408853>
We make sure that if the user cancels out of the authentication dialog to add 'com.apple.lldb.LaunchUsingXPC' rights to /etc/authorization, we don't try to do AuthorizationCopyRights.

As well, refactored a bit so that control flow is easier to read for other folks. Added more comments.

llvm-svn: 156423
2012-05-08 21:32:32 +00:00
Enrico Granata 07a4ac22ed <rdar://problem/11239650> Fixing a bug where the SetValueFromCString() method failed to operate on dynamic values. The fix consists in making the set operation fall through to the parent. We only actually allow this if the dynamic value is at a 0-offset from the parent, or the new value is 0. Other scenarios would need agreement on the actual meaning of the set operation (do we keep offsetting? do we just assume the user knows what they are doing?) so we prevent them, and let the expression parser deal with the complexity
llvm-svn: 156422
2012-05-08 21:25:06 +00:00
Jim Ingham 5bad4799a3 Fixing some indentation.
llvm-svn: 156412
2012-05-08 20:05:08 +00:00
Enrico Granata 9123950ab1 A simple implementation of a summary and synthetic children providers for LLDB-specific shared pointers - This could be generalized to work with C++11 shared pointers with relative ease
llvm-svn: 156410
2012-05-08 19:21:13 +00:00
Enrico Granata 601ccb583f Removing spurious friend declaration
llvm-svn: 156398
2012-05-08 18:49:36 +00:00
Enrico Granata 886147f0ac First part of a fix to make GetNonSyntheticValue() work correctly
llvm-svn: 156397
2012-05-08 18:47:08 +00:00
Greg Clayton af6f2755ab <rdar://problem/10605072>
Fixed the command callback override lookup function so we can now override the "process launch" command  (or any other multi-word commands).

llvm-svn: 156368
2012-05-08 04:29:20 +00:00
Jason Molenda b2c7b92ae8 bump TOT version number to lldb-146 to match the checkin on the branch.
llvm-svn: 156359
2012-05-08 02:54:06 +00:00
Greg Clayton 7051231709 <rdar://problem/11358639>
Switch over to the "*-apple-macosx" for desktop and "*-apple-ios" for iOS triples.

Also make the selection process for auto selecting platforms based off of an arch much better.

llvm-svn: 156354
2012-05-08 01:45:38 +00:00
Johnny Chen 6943e7c569 Add clarification comments.
llvm-svn: 156350
2012-05-08 00:43:20 +00:00
Sean Callanan 0a2722d63d Updated LLVM to take a fix for disassembly of
Thumb branch operands.

llvm-svn: 156344
2012-05-08 00:01:21 +00:00
Johnny Chen 4ab2e6be38 Updated to a more meaningful macro name.
llvm-svn: 156340
2012-05-07 23:23:41 +00:00
Johnny Chen 5ec8fcbf0c Fix the problem that 'help breakpoint set' is printing a lot of redundant lines.
Correctly specify the LLDB_OPT_SET's that the 'shlib' command option belongs to by using a newly added macro like this:

    #define LLDB_OPT_NOT_10 ( LLDB_OPT_SET_FROM(1, 10) & ~LLDB_OPT_SET_10 )

rdar://problem/11393864

llvm-svn: 156337
2012-05-07 23:04:49 +00:00
Johnny Chen ddb149069e Add an -F option to the redo.py script to selectively re-run only those failed sessions whose filenames contain the component(s)
specified.  For example:

    ./redo.py -F x86_64 -n 2012-05-07-15_28_24

will redo the failed sessions under the 2012-05-07-15_28_24 directory, but only for session names which contain 'x86_64' in it.

llvm-svn: 156335
2012-05-07 22:59:00 +00:00
Johnny Chen 5a4b4b86d6 Move the el_source() call after the section of code which sets up the default "ctrl-r" and "ctrl-w" bindings
so that user-provided .editrc has a chance to override the lldb's default key bindings.

llvm-svn: 156314
2012-05-07 18:18:08 +00:00
Sean Callanan bcaa94db6c Updated LLVM to fix bad disassembly of operands
and occasionally failure to recognize instructions.
This problem affects ARM and Thumb BLX instructions.

llvm-svn: 156307
2012-05-07 16:50:20 +00:00
Filipe Cabecinhas f86cf78190 Remove repeated word.
llvm-svn: 156300
2012-05-07 09:30:51 +00:00
Filipe Cabecinhas 75bc95ec28 Fixed some strncat/strlcat uses.
llvm-svn: 156264
2012-05-06 17:56:42 +00:00
Johnny Chen 66b7c59593 Jason Molenda convinced me that we should make ctrl-w on the command line bind to ed-delete-prev-word.
If you have ctrl-w key binding specified with your .editrc file, it will be overridden with ed-delete-prev-word. :-)

llvm-svn: 156230
2012-05-05 04:44:12 +00:00
Jim Ingham 444717b318 Missed a few uses of Mutex::GetMutex in template functions that don't seem to get instantiated on the Mac OS X build,
but were causing build failures on Linux.

llvm-svn: 156224
2012-05-04 23:54:57 +00:00
Sean Callanan 247e62a706 Added an "attach" alias as promised on the web page.
llvm-svn: 156223
2012-05-04 23:15:02 +00:00
Jim Ingham 10ebffa48a Don't expose the pthread_mutex_t underlying the Mutex & Mutex::Locker classes.
No one was using it and Locker(pthread_mutex_t *) immediately asserts for 
pthread_mutex_t's that don't come from a Mutex anyway.  Rather than try to make
that work, we should maintain the Mutex abstraction and not pass around the
platform implementation...

Make Mutex::Locker::Lock take a Mutex & or a Mutex *, and remove the constructor
taking a pthread_mutex_t *.  You no longer need to call Mutex::GetMutex to pass
your mutex to a Locker (you can't in fact, since I made it private.)

llvm-svn: 156221
2012-05-04 23:02:50 +00:00
Greg Clayton c8f73d7b96 Added an interactive mode to the "crashlog" command so that we can look at multiple crash logs at once and do some data mining. Added an interactive command prompt that allows you to do:
% PYTHONPATH=./build/Debug/LLDB.framework/Resources/Python ; ./build/Debug//LLDB.framework/Resources/Python/lldb/macosx/crashlog.py -i ~/Downloads/crashes2/*.crash ) 

then you get an interactive prompt where you can search for data within all crash logs. For example you can do:

% list

which will list all crash logs

And you can search for all images given an image basename, or full path:

% image LLDB
% image /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB
% image LLDB.framework

Which would all produce an output listing like:

40CD4430-7D27-3248-BE4C-71B1F36FC5D0 (1.132 - 132) /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB, __TEXT=[0x000000011f8bc000 - 0x0000000120d3efbf)
B727A528-FF1F-3B20-9E4F-BBE96C7D922D (1.136 - 136) /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB, __TEXT=[0x000000011e7f7000 - 0x000000011fc7ff87)
4D6F8DC2-5757-39C7-96B0-1A5B5171DC6B (1.137 - 137) /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB, __TEXT=[0x000000012bd7f000 - 0x000000012d1fcfef)
FBF8786F-92B9-31E3-8BCD-A82148338966 (1.137 - 137) /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB, __TEXT=[0x0000000122d78000 - 0x00000001241f5fd7)
7AE082E3-3BB7-3F64-A308-063E559DFC45 (1.143 - 143) /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB, __TEXT=[0x0000000119b8d000 - 0x000000011b02ef5f)
7AE082E3-3BB7-3F64-A308-063E559DFC45 (1.143 - 143) /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB, __TEXT=[0x0000000111497000 - 0x0000000112938f5f)
7AE082E3-3BB7-3F64-A308-063E559DFC45 (1.143 - 143) /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB, __TEXT=[0x0000000116680000 - 0x0000000117b21f5f)

llvm-svn: 156201
2012-05-04 20:44:14 +00:00
Johnny Chen 30e422d7ba When the current thread state is NULL, PyThreadState_Get() issues a fatal error.
Use a gentler API PyThreadState_GetDict(), instead.

rdar://problem/11292882

llvm-svn: 156200
2012-05-04 20:37:11 +00:00
Jim Ingham c075ecd833 Fix a think in Mutex::Locker::Locker(pthread_mutex_t *) Really should lock the mutex handed in, not the m_mutex_ptr that you've set to NULL...
Rework the Host.cpp::ThreadNameAccessor to use ThreadSafeSTLMap - we've got it so we might as well use it.  Also works around a problem with the
Mutex::Locker class raising fallacious asserts in debug mode when used with pthread_mutex_t's that weren't backed by Mutex objects.

llvm-svn: 156193
2012-05-04 19:24:49 +00:00
Jason Molenda 16d127cb7b In ProcessGDBRemote::DoConnectRemote(), if the remote system informed
us of its architecture, use that to set the Target's arch if it
doesn't already have one set.

In Process::CompleteAttach(), if the Target has a valid arch make
sure that the Platform we pick up is compatible with that arch; if
not, find a Platform that is compatible.  Don't let the the default
platform override the Target's arch.

<rdar://problem/11185420>

llvm-svn: 156116
2012-05-03 22:37:30 +00:00
Johnny Chen 356782f5f6 Fix the following error when importing crashlog.py from a Python interactive session:
AttributeError: 'module' object has no attribute 'debugger'

llvm-svn: 156115
2012-05-03 22:31:30 +00:00
Jim Ingham 64e7ead1d8 Clean up the usage of "MasterPlan" status in ThreadPlans. Only user-initiated plans
should be MasterPlans that want to stay on the plan stack.  So make all plans NOT
MasterPlans by default and then have the SB API's and the CommandObjectThread step
commands set this explicitly.

Also added a "clean up" phase to the Thread::ShouldStop so that if plans get stranded
on the stack, we can remove them.  This is done by adding an IsPlanStale method to the
thread plans, and if the plan can know that it is no longer relevant, it returns true,
and the plan and its sub-plans will get discarded.

llvm-svn: 156101
2012-05-03 21:19:36 +00:00
Jim Ingham 64cc29cb84 Document the fact that you can repeat "-n" and similar options to make one breakpoint on multiple names.
llvm-svn: 156098
2012-05-03 20:30:08 +00:00
Johnny Chen 8e1fd43ad7 Fix AttributeError when using crashlog with verbose mode.
rdar://problem/11374653

llvm-svn: 156088
2012-05-03 18:46:28 +00:00
Enrico Granata 78453eed12 Adding a new 'type category disable *' feature that disables all categories - This is intended as a quick kill switch for data formatters for cases where the user wants as little extra processing as possible to be done on their target, or to override major data formatters bug, should they occur
llvm-svn: 156044
2012-05-03 01:08:44 +00:00
Sean Callanan e38e69f204 Patched our local Clang to fix a crash when parsing
classes/structs that have variable-length arrays at
the end.

llvm-svn: 156026
2012-05-02 21:54:54 +00:00
Enrico Granata 2980927107 Update the docs to reflect the recent changes to categories
llvm-svn: 156020
2012-05-02 21:13:16 +00:00
Enrico Granata 19e7a185f2 Mentioning in the docs that Python commands can have docstrings
llvm-svn: 156018
2012-05-02 21:00:41 +00:00
Jim Ingham c007e84621 If a command takes options and arguments, the help text should warn the user to use "--" to terminate the options.
llvm-svn: 155973
2012-05-02 01:12:54 +00:00
Jim Ingham c7dccb797e Jeeze... Remove two unneeded #include's of ThreadPlanTestCondition.h, and replace them with
includes of ClangUserExpression that were being errantly dragged in through same.

llvm-svn: 155970
2012-05-02 00:30:53 +00:00
Jim Ingham 8e0b2e3614 Forgot to commit the change deleting the ThreadPlanTestCondition files from the project.
llvm-svn: 155968
2012-05-02 00:24:48 +00:00
Jim Ingham 92e1cd431c Cleanup - removing the ThreadPlanTestCondition and its helper functions. It is not needed,
since we now run the condition in the StopInfoBreakpoint's PerformAction, and don't need
to refer it to another "continue".  Actually, we haven't needed to do this for a year or
so, I just hadn't gotten around to deleting the dead wood.

llvm-svn: 155967
2012-05-02 00:23:18 +00:00
Jim Ingham fbbfe6ecf0 Fix reporting of stop reasons when the StepOver & StepIn plans stop because of a crash or breakpoint. Added the ability for a plan to say it is done but doesn't want to be the reason for the stop.
llvm-svn: 155927
2012-05-01 18:38:37 +00:00
Jim Ingham e2b6ad65a2 Use a cache of the results of "GetFileAddress" from a symbol in the Comparator we are using to sort the various lookup indices by symbol address. When we switched to weak pointers,
this lookup got slightly slower.  Not enough to matter for most uses, but in the sort algorithm it does matter.

llvm-svn: 155873
2012-05-01 01:34:15 +00:00
Sean Callanan 1276c33345 Added a --force option to "memory read,"
disallowing reads over 1KiB in total size
unless the user explicitly allows them.

llvm-svn: 155750
2012-04-28 01:27:38 +00:00
Johnny Chen bd5bb6fda3 Clarify "watchpoint set" help text.
rdar://problem/11327790

llvm-svn: 155694
2012-04-27 05:27:07 +00:00
Jason Molenda 30815837b0 Bump to lldb-145.
llvm-svn: 155687
2012-04-27 02:25:20 +00:00
Greg Clayton b69bb2e43f Clean up the way modules are looked for when calling Target::GetSharedModule(...). We were ignoring remapped files, even if they were valid. Also if we have a UUID, we should check our global module list first.
llvm-svn: 155683
2012-04-27 00:58:27 +00:00
Jim Ingham 57190baa6c Don't call SBDebugger::SetInternalVariable in the sigwinch_handler, since that takes locks and potentially does allocations.
Just call SBDebugger::SetTerminalWidth on the driver's SBDebugger, which does the same job, but no locks.
Also add the value checking to SetTerminalWidth you get with SetInternalVariable(..., "term-width", ...).

rdar://problem/11310563

llvm-svn: 155665
2012-04-26 21:39:32 +00:00
Sean Callanan 822944c97d Made the IR interpreter move all floats, not just "wide"
ones, to its own constant pool.  This reflects the fact
that the LLVM code generators for different targets move
floats to their constant pools under varying conditions,
and the JIT cannot (yet) be relied upon to relocate references to
its constant pool correctly.

llvm-svn: 155660
2012-04-26 20:51:20 +00:00
Greg Clayton c32e5c9bc2 Patch from Filipe Cabecinhas.
llvm-svn: 155644
2012-04-26 17:33:20 +00:00
Greg Clayton 512034b8bd Patch from Filipe Cabecinhas.
llvm-svn: 155642
2012-04-26 17:12:07 +00:00
Greg Clayton caca09b628 Patch from Filipe Cabecinhas.
llvm-svn: 155641
2012-04-26 17:11:01 +00:00
Greg Clayton 7afbe07a0d Patch from Filipe Cabecinhas.
llvm-svn: 155640
2012-04-26 17:09:38 +00:00
Greg Clayton f22f6ff32a Patch from Filipe Cabecinhas.
llvm-svn: 155639
2012-04-26 17:07:53 +00:00
Greg Clayton 9efa076aa6 Save more memory by not parsing the symbol table for stand alone DWARF files. We currently have SymbolFile plug-ins which all get the chance to say what they can parse in a symbol file. Prior to this fix we would ask the SymbolFileDWARF plug-in what abilities it had, and it would answer with "everything", and then we would check the SymbolFileSymtab plug-in what abilities it had, in case it had more abilities. The checking that SymbolFileSymtab does is a bit expensive as it pulls in the entire symbol table just to see if it can offer a few scraps of debug information. This causes all stand along DWARF files to pull in their symbol tables even though those symbols will never be used. This fix will check all SymbolFile plug-ins for their abilities and if any plug-in responds with "everything", then we stop the search.
llvm-svn: 155638
2012-04-26 16:53:42 +00:00
Jason Molenda fc6a17b0a8 Add an Error string specifically for when we hit an ENOMEM when
trying to mmap a file fails so parent caller function can 
provide helpful information to use about what went wrong.

llvm-svn: 155617
2012-04-26 06:39:51 +00:00
Enrico Granata 73076f9269 Automatically enabling the Cocoa formatter categories for command-line LLDB. Previously, the categories were filled in but disabled by default. Tweaking test cases appropriately to keep working and do the right thing
llvm-svn: 155605
2012-04-26 01:40:38 +00:00
Greg Clayton 83b6fabdf7 <rdar://problem/11271074>
<rdar://problem/11285931>

Use the DWARRF end prologue markers when trying to skip prologue instructions instead of blindly using the second line table address entry.

llvm-svn: 155600
2012-04-26 01:01:34 +00:00
Greg Clayton da91b17bc7 Patch from Viktor Kutuzov: changes the method declarations to const for the Args::GetCommandString and Agrs::GetQuotedCommandString methods. It allows using of these methods within the other const methods.
llvm-svn: 155593
2012-04-25 22:30:32 +00:00
Greg Clayton 4f76fef267 Make the libheap.dylib build into a consistent temp directory so it can be reused between lldb invocations. Also add the module name into the directory path that is used to store the target triple specific build of libheap.dylib.
Also added code that will rebuild libheap.dylib if heap_find.cpp is newer that libheap.dylib.

llvm-svn: 155590
2012-04-25 21:23:07 +00:00
Enrico Granata de93b6b42f Fixing a typo in the NSArray data formatter
llvm-svn: 155586
2012-04-25 20:59:02 +00:00
Jim Ingham e5b2245d68 Make sure the end of the first line is still within the function, and if not, don't push the prologue past it.
rdar://problem/11271074

llvm-svn: 155579
2012-04-25 19:48:30 +00:00
Greg Clayton d712ef0fd7 Remove the "-x" from the finish-swig-Python-LLDB.sh shell options so it doesn't print out all of the commands when executing the shell script.
Cleaned up the lldb.utils.symbolication, lldb.macosx.heap and lldb.macosx.crashlog. The lldb.macosx.heap can now build a dylib for the current triple into a temp directory and use it from there.

llvm-svn: 155577
2012-04-25 18:40:20 +00:00
Enrico Granata 7d22221759 Returning data formatters to their previous working condition - Plus fixing an issue that was preventing Python oneliners from executing
llvm-svn: 155563
2012-04-25 17:53:41 +00:00
Sean Callanan e8dea98b5e Hardened LLDB against NULL identifiers being passed
into FindExternalVisibleDeclsByName.

llvm-svn: 155561
2012-04-25 17:46:01 +00:00
Jim Ingham 5d2735e502 Suspend program threads before sending the SIGSTOP & resuming, so other threads won't get into trouble while we are waiting for the SIGSTOP.
rdar://problem/11174834

llvm-svn: 155560
2012-04-25 17:45:26 +00:00
Enrico Granata eb36cadb68 Fixing an over-substitution of text
llvm-svn: 155556
2012-04-25 16:35:54 +00:00
Enrico Granata 85ce21c04d Make the C++ formatters importable by having them use the right package to import and reference the Logger
llvm-svn: 155555
2012-04-25 16:32:39 +00:00
Greg Clayton ed3eee6e55 Now that we have an LLDB package, make the "lldb.macosx.crashlog" module work with all of the new module paths.
llvm-svn: 155528
2012-04-25 01:49:50 +00:00
Jason Molenda 68b922590d Bump to lldb-144.
llvm-svn: 155527
2012-04-25 01:44:49 +00:00
Enrico Granata 28399adad8 Making the Cocoa formatters comply with the new on-disk layout of the Python resources - This is one of the steps towards making the data formatters work again
llvm-svn: 155526
2012-04-25 01:39:27 +00:00
Enrico Granata 5b4ab4c848 Ensure that lldb/runtime is not a dead point in the Python package hierarchy - This is a first preliminary step in fixing data formatters after Greg's changes to the Python resources on-disk layout
llvm-svn: 155525
2012-04-25 01:26:37 +00:00
Greg Clayton 938aa00795 Remove unneeded files.
llvm-svn: 155524
2012-04-25 01:25:22 +00:00
Greg Clayton 81e9ebf798 Move the source and Makefile into a directory so it will be easier to install.
llvm-svn: 155523
2012-04-25 01:25:04 +00:00
Johnny Chen 6381f01012 Renaming to rid of the '++' in the test file name and simplify the Makefile.
llvm-svn: 155521
2012-04-25 01:20:15 +00:00
Greg Clayton b1ba1bb194 Make the Makefile stand alone.
llvm-svn: 155520
2012-04-25 01:19:20 +00:00
Jim Ingham c9efdbb0d4 Fix the docs for "breakpoint command add" to specify the arguments passed into the python function.
llvm-svn: 155517
2012-04-25 01:05:21 +00:00
Sean Callanan dd42e097eb Removed a binary that I accidentally committed.
llvm-svn: 155516
2012-04-25 01:04:34 +00:00
Sean Callanan 7457f8d7c9 Recognize Objective-C classes with runtime class
ObjCPlusPlus as Objective-C classes.  Really the
compiler should say they have Objective-C runtime
class, but we should be a little more resilient
(we were refusing to find ivars in those classes
before).

Also added a test case.

llvm-svn: 155515
2012-04-25 01:03:57 +00:00
Greg Clayton 6d98f56c58 Maked LLDB into a package so we can import things without poluting the global namespace.
Enrico will follow this up with fixing the data formatter test cases that are failing.

llvm-svn: 155514
2012-04-25 00:58:03 +00:00
Sean Callanan 374bd0c9e5 Made it safe to re-import a Python module, allowing
the same test to be run multiple times in the same
session.

llvm-svn: 155511
2012-04-25 00:21:42 +00:00
Enrico Granata 45034810aa Fixing a bunch of i386 testsuite failures
llvm-svn: 155510
2012-04-25 00:13:06 +00:00
Jason Molenda 216d91f16e Change Target::ReadMemoryFromFileCache to not read from the file
if the section is marked as encrypted.  It will likely be readable
in live memory.
<rdar://problem/11305675>

llvm-svn: 155509
2012-04-25 00:06:56 +00:00
Johnny Chen c4f4d056ab Make the test case more robust in terms of remote testsuite execution.
rdar://problem/11312971

llvm-svn: 155505
2012-04-24 23:33:16 +00:00
Sean Callanan dfc066d274 Forgo the selector test on i386, where we can't
test whether an object responds to a selector
from outside the process.

llvm-svn: 155504
2012-04-24 23:31:54 +00:00
Sean Callanan 72546f01d3 Create an NSAutoreleasePool correctly in a test
case so that the Objective-C runtime doesn't
complain about lack of one, causing the test case
to fail.

llvm-svn: 155503
2012-04-24 23:18:47 +00:00
Johnny Chen 8da4ddf990 Add a suffix rule for compiling objc++ files and a sample directory under test/lang/objcxx.
llvm-svn: 155501
2012-04-24 23:05:07 +00:00
Enrico Granata bce6b17d7a Fixing a typo in the previous commit that broke the build
llvm-svn: 155497
2012-04-24 22:33:23 +00:00
Enrico Granata 9f1e204130 Fixing an issue where the expression parser was not correctly freeze-drying bitfields - This patch ensures that (a) freeze-drying bitfields works correctly and (b) that we actually access bitfields through IR instead of the 'frame var en lieu of expr' shortcut, for added safety in corner cases that may arise
llvm-svn: 155494
2012-04-24 22:15:37 +00:00
Johnny Chen 8f198c96fd Add a '-R' option, which is similar to '-r', except that the relocated directory, if exists, will be removed entirely
before running the test suite.  A usage example looks like this:

test $ ./dotest.py -A x86_64 -R /tmp/x86_64 &
test $ ./dotest.py -A i386 -R /tmp/i386 &

where we would want to run the x86_64 and i386 archs concurrently but relocate the test suite to different directory
hierarchies in order not to stump on each other's intermediate files.

llvm-svn: 155491
2012-04-24 21:44:10 +00:00
Greg Clayton a8022fa70d <rdar://problem/11291668>
Fixed an issue that would happen when using debug map with DWARF in the .o files where we wouldn't ever track down the actual definition for a type when things were in namespaces. We now serialize the decl context information into an intermediate format which allows us to track down the correct definition for a type regardless of which DWARF symbol file it comes from. We do this by creating a "DWARFDeclContext" object that contains the DW_TAG + name for each item in a decl context which we can then use to veto potential accelerator table matches. For example, the accelerator tables store the basename of the type, so if you have "std::vector<int>", we would end up with an accelerator table entry for the type that contained "vector<int>", which we would then search for using a DWARFDeclContext object that contained:

  [0] DW_TAG_class_type "vector<int>"
  [1] DW_TAG_namespace "std"

This is currently used to track down forward declarations for things like "class a:🅱️:Foo;". 

llvm-svn: 155488
2012-04-24 21:22:41 +00:00
Sean Callanan 4538aa25bd Fixed a crasher that occurs when an expression
doesn't return a result.  If that expression can't
be run in the current context (for example, if it
uses a function and there is no running process)
then we used to try to destroy the nonexistent
result variable.  We now only destroy the result
variable if we actually made one.

llvm-svn: 155455
2012-04-24 17:56:40 +00:00
Greg Clayton 1eac0c729f Added support for the LC_ENCRYPTION_INFO load command.
llvm-svn: 155423
2012-04-24 03:06:13 +00:00
Jim Ingham a503881635 Report the command error when we are in "stop on error mode."
llvm-svn: 155422
2012-04-24 02:25:07 +00:00
Jason Molenda 0a287e0356 A small fix for ObjectFileMachO::ParseSymtab() where a pointer
into the middle of a vector was being used after the vector may
have been resized.  
<rdar://problem/11284937>

llvm-svn: 155421
2012-04-24 02:09:58 +00:00
Enrico Granata fe945e83e0 Fixing the test case so that it runs correctly on i386 as well as on x86_64
llvm-svn: 155420
2012-04-24 02:01:17 +00:00
Enrico Granata f1dfbad036 Removing the @expectedFailurei386 decorator from test cases that now work as a result of the latest changes to Value.cpp
llvm-svn: 155419
2012-04-24 01:45:19 +00:00
Enrico Granata b046e0320c This patch fixes a bug where LLDB was incorrectly setting the address-size on a DataExtractor to be sizeof(void*) when the ValueObject came out of the expression parser
This worked correctly for 64-bit targets, but broke down data formatters in i386 mode. The formatters would try to read pointers out of the frozen-dried objects,
but were unable to do so because they would try fetching 8 bytes from a DataExtractor with only 4 bytes in it. This patch fixes the issue by always making the pointer-size
for a DataExtractor match the target setting.

llvm-svn: 155418
2012-04-24 01:23:23 +00:00
Jim Ingham 927f09ca0e Pass *this in explicitly to save the FileSpec copy construction.
llvm-svn: 155407
2012-04-23 23:22:24 +00:00
Greg Clayton d61c0fc049 Added the ability to log a message with a backtrace when verbose logging is enabled to the Module class. Used this new function in the DWARF parser.
llvm-svn: 155404
2012-04-23 22:55:20 +00:00
Greg Clayton 2dafd8ed4b <rdar://problem/11282938>
Fixed an issue where we get NULL compile units back from the symbol vendor. We need symbol vendors to be able to quickly give an estimate of the compile units that they have without having to fully vette them first, so anyone getting compile units from a module should be able to deal with a NULL compile unit being returned for a given index.

llvm-svn: 155398
2012-04-23 22:00:21 +00:00
Greg Clayton b210aec64d Added the ability to specify the symbol file for a module when adding it to a target.
llvm-svn: 155384
2012-04-23 20:23:39 +00:00
Johnny Chen 7debd16c95 Test file renaming.
llvm-svn: 155369
2012-04-23 17:54:40 +00:00
Sean Callanan 1ef77434e3 Implemented zext as a no-op cast in the IR
interpreter.

llvm-svn: 155360
2012-04-23 17:25:38 +00:00
Jason Molenda 0c72f85690 Bump version to lldb-143.
llvm-svn: 155272
2012-04-21 02:10:22 +00:00
Johnny Chen 910667004f Remove the expectedFailure decorator as the bug has been fixed.
llvm-svn: 155264
2012-04-21 01:02:50 +00:00
Greg Clayton b403a15ded Added code to automatically load the libheap.dylib when ptr_refs, cstr_refs or malloc_info are called. If MallocStackLogging is enabled, then you can now use --stack to dump the backtrace of the code that allocated each malloc block.
llvm-svn: 155262
2012-04-21 00:11:26 +00:00
Johnny Chen 34d3a38a9c Method name change to avoid further conflicts when merging from ToT to branches/lldb-platform-work.
llvm-svn: 155260
2012-04-20 23:59:21 +00:00
Greg Clayton f99295c3a6 Fixed some issues with symbolicating things. Fixed symbolication.add_module() to not use the resolved_path before we have tried to locate it. Fixed crashlog.locate_module_and_debug_symbols() to return true and false correctly.
llvm-svn: 155255
2012-04-20 23:31:27 +00:00
Jim Ingham 6d66ce67d7 Make sure the "synchronous breakpoint callbacks" get called before the thread plan logic gets invoked, and if they
ask to continue that should short-circuit the thread plans for that thread.  Also add a bit more explanation for
how this machinery is supposed to work.  
Also pass eExecutionPolicyOnlyWhenNeeded, not eExecutionPolicyAlways when evaluating the expression for breakpoint
conditions.

llvm-svn: 155236
2012-04-20 21:16:56 +00:00
Greg Clayton 9bbddbf84a Added logging so we can see when we are trying to complete a forward type and pull in the world. This is due to a compiler bug we are tracking (<rdar://problem/11291658>) where forward decls to classes and types are not properly scoped in namespaces, which results in the current LLDB looking for a type it will find many times in the accelerator tables, but never match. For example, when debugging with clang we get a forward decl like:
class AnalysisResolver;

And we will look for it everywhere and find many many matches, but the decl context of those matching DIEs is "clang::AnalysisResolver", so we never match anything, yet we pull in waaayyy too much DWARF in the process.

To enable this logging enable the "lookups" category in the "dwarf" log channel:

(lldb) log enable dwarf lookups

llvm-svn: 155233
2012-04-20 20:35:47 +00:00
Greg Clayton 3e10cf3b51 Don't put the address of the module in the module basename as this hoses up our ability to find shared libraries by name. We now put it into the Module object name.
llvm-svn: 155223
2012-04-20 19:50:20 +00:00
Greg Clayton 3f24d36160 <rdar://problem/11259893>
Fixed an issue where iOS debugging would trust the first file it found in the SDK regardless of the UUID not matching. Now we actually get smart and can find modules in ANY of the installed SDKs and remember which SDK is our fallback SDK.

llvm-svn: 155184
2012-04-20 02:02:02 +00:00
Jim Ingham 28209d55fd Missed one place where the assert should have been in a #ifdef. Thanks Jason.
llvm-svn: 155175
2012-04-20 00:08:56 +00:00
Johnny Chen 6acfb690b5 Tests decorated with @benchmarks_test do not participate in the remote-macosx test suite run.
But, still, tearDown() should call super.tearDown(), not super.setUp(). :-)

llvm-svn: 155170
2012-04-19 23:50:00 +00:00
Johnny Chen c9cb71a0b3 LLDB test suite should also output the config info string along with the stack trace.
rdar://problem/11283401

Example:

Collected 1 test

1: test_with_dwarf (TestCallStdStringFunction.ExprCommandCallFunctionTestCase)
   Test calling std::String member function. ... FAIL

======================================================================
FAIL: test_with_dwarf (TestCallStdStringFunction.ExprCommandCallFunctionTestCase)
   Test calling std::String member function.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Volumes/data/lldb/svn/ToT/test/lldbtest.py", line 427, in wrapper
    return func(self, *args, **kwargs)
  File "/Volumes/data/lldb/svn/ToT/test/expression_command/call-function/TestCallStdStringFunction.py", line 34, in test_with_dwarf
    self.call_function()
  File "/Volumes/data/lldb/svn/ToT/test/expression_command/call-function/TestCallStdStringFunction.py", line 48, in call_function
    substrs = ['Hello world'])
  File "/Volumes/data/lldb/svn/ToT/test/lldbtest.py", line 1235, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : 'Hello world' returns expected result
Config=i386-clang
----------------------------------------------------------------------
Ran 1 test in 1.148s

FAILED (failures=1)

llvm-svn: 155157
2012-04-19 21:33:55 +00:00
Johnny Chen 39b8c3567a Simplify the progress bar display when neither "-v" nor "-t" is passed to the test driver.
llvm-svn: 155152
2012-04-19 20:09:44 +00:00
Sean Callanan 82b6f48331 Updated LLVM to take a variety of ARM
disassembler fixes.  The ARM disassembler is
now crash-free on all opcodes.

llvm-svn: 155149
2012-04-19 20:00:54 +00:00
Johnny Chen 92f162a798 The session file name should be tagged with (architecture, compiler) in addition
to the already existing (test result, test id) to avoid collision and to
facilitate postmortem analysis.

llvm-svn: 155148
2012-04-19 19:39:11 +00:00
Johnny Chen 4fdc339db5 Not a test failure for i386; instead, the test case should be modified to not over-expect type fields for the synthetic childs.
rdar://problem/11277013

llvm-svn: 155144
2012-04-19 18:36:11 +00:00
Jim Ingham c1c19a6f02 In debug mode, assert when we fail to get the sequence mutex. We need to remove as many places where this can happen as possible.
llvm-svn: 155138
2012-04-19 16:57:50 +00:00
Jason Molenda 7c3e6f3134 bump version to lldb-142.
llvm-svn: 155093
2012-04-19 02:02:12 +00:00
Jim Ingham 3b8285d90d Switch to setting the write side of the run lock when we call Resume. Then make a PrivateResume that doesn't switch the run-lock state, and use that where we are resuming without changing the public resume state.
llvm-svn: 155092
2012-04-19 01:40:33 +00:00
Johnny Chen 61f305cdb8 Add expected failure decorators for test cases which are failing for i386 architecture.
Plus fix some test cases to skip/succeed for i386.

llvm-svn: 155087
2012-04-19 01:07:54 +00:00
Jim Ingham fd29c36fbf Add a WriteTryLock function.
llvm-svn: 155080
2012-04-19 00:19:47 +00:00
Jim Ingham e1471230e2 The plan stack should never be used while empty. GetCurrentPlan is the entry point to contol logic
for the plan stack, so assert here if it gets called with an empty plan stack.
<rdar://problem/11265974>

llvm-svn: 155078
2012-04-19 00:17:05 +00:00
Jim Ingham 1f628f4e8f We take the API mutex first and the stop mutex second in general, so do it here as well.
llvm-svn: 155077
2012-04-19 00:14:53 +00:00
Greg Clayton af54653c32 Make sure EmulateInstructionARM doesn't have to have "armv4", "armv6", "armv7" as the exact architecture name, the arch name can just start with any of these strings. We need to be able to recognize different variants that might come along and not fail to backtrace completely (which happens when we aren't able to find an architecture that matches) when we don't have exact matches.
llvm-svn: 155045
2012-04-18 21:16:06 +00:00
Greg Clayton 26b47e24fe Added an iOS local debugging optimization when reading the __LINKEDIT section data for files in the dyld shared cache.
llvm-svn: 154984
2012-04-18 05:19:20 +00:00
Greg Clayton bade1fb874 Find and allows users to use the cached SDK's that might be in "~/Library/Developer/Xcode/iOS DeviceSupport".
Also enabled PlatformRemoteiOS to select an SDK using the build number in case you have mutliple 5.0 SDKs installed:

(lldb) platform select remote-ios --build 11C123

llvm-svn: 154978
2012-04-18 02:08:08 +00:00
Jason Molenda edfb0dcf0c Bump to lldb-141.
llvm-svn: 154975
2012-04-18 01:35:37 +00:00
Jason Molenda 9cf296d177 Add armv7s to recognized cpu type for arm instruction emulation.
llvm-svn: 154974
2012-04-18 01:28:49 +00:00
Sean Callanan ad880767fc We now record metadata for Objective-C interfaces,
Objective-C methods, and Objective-C properties.

llvm-svn: 154972
2012-04-18 01:06:17 +00:00
Greg Clayton d38e55e815 Update the way SDK directories are found so we are not reliant on the old "Latest" symlinks in the DeviceSupport directory.
llvm-svn: 154966
2012-04-18 00:06:56 +00:00
Greg Clayton ac7a3db067 Make sure an error is returned when Process::LoadImage() fails.
llvm-svn: 154965
2012-04-18 00:05:19 +00:00
Sean Callanan d9804fbd01 When an AST import fails, provide the metadata
for the original Decl, for debugging purposes.

llvm-svn: 154957
2012-04-17 22:30:04 +00:00
Jason Molenda 7bfc33077e Bump to lldb-140.
llvm-svn: 154887
2012-04-17 00:59:15 +00:00
Sean Callanan 0765c82694 Disabled spell checking in the expression parser,
which incurs large overheads in terms of type
parsing and importing.

llvm-svn: 154885
2012-04-17 00:49:48 +00:00
Greg Clayton 1e8ac36b60 Fixed the ability to load multiple __LINKEDIT segments at the same address for darwin shared cache entries. Now when registering the load address of a section, the DynamicLoader objects can specify if they should warn or not. This will fix the ability to load the nlist entries for shared libraries in the darwin shared caches when no on disk representation is available for a shared library.
llvm-svn: 154860
2012-04-16 21:01:30 +00:00
Johnny Chen 44d2497138 Add the capability of supplying the pre/post-flight functions to the test suite such that
the pre-flight code gets executed during setUp() after the debugger instance is available
and the post-flight code gets executed during tearDown() after the debugger instance has
done killing the inferior and deleting all the target programs.

Example:

[11:32:48] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-pre-post-flight  functionalities/watchpoint/hello_watchpoint
config: {'pre_flight': <function pre_flight at 0x1098541b8>, 'post_flight': <function post_flight at 0x109854230>}
LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
LLDB-139
Path: /Volumes/data/lldb/svn/ToT
URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
Repository Root: https://johnny@llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 154753
Node Kind: directory
Schedule: normal
Last Changed Author: gclayton
Last Changed Rev: 154730
Last Changed Date: 2012-04-13 18:42:46 -0700 (Fri, 13 Apr 2012)


lldb.pre_flight: def pre_flight(test):
    __import__("lldb")
    __import__("lldbtest")
    print "\nRunning pre-flight function:"
    print "for test case:", test

lldb.post_flight: def post_flight(test):
    __import__("lldb")
    __import__("lldbtest")
    print "\nRunning post-flight function:"
    print "for test case:", test


Session logs for test failures/errors/unexpected successes will go into directory '2012-04-16-11_34_08'
Command invoked: python ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-pre-post-flight functionalities/watchpoint/hello_watchpoint
compilers=['clang']

Configuration: arch=x86_64 compiler=clang
----------------------------------------------------------------------
Collected 2 tests

1: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
   Test a simple sequence of watchpoint creation and watchpoint hit. ... 
Running pre-flight function:
for test case: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)

Running post-flight function:
for test case: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
ok
2: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
   Test a simple sequence of watchpoint creation and watchpoint hit. ... 
Running pre-flight function:
for test case: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)

Running post-flight function:
for test case: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
ok

----------------------------------------------------------------------
Ran 2 tests in 1.584s

OK

llvm-svn: 154847
2012-04-16 18:55:15 +00:00
Greg Clayton d1cf11a74d Added a new host function that allows us to run shell command and get the output from them along with the status and signal:
Error
Host::RunShellCommand (const char *command,
                       const char *working_dir,
                       int *status_ptr,
                       int *signo_ptr,
                       std::string *command_output_ptr,
                       uint32_t timeout_sec);

This will allow us to use this functionality in the host lldb_private::Platform, and also use it in our lldb-platform binary. It leverages the existing code in Host::LaunchProcess and ProcessLaunchInfo.

llvm-svn: 154730
2012-04-14 01:42:46 +00:00
Sean Callanan f5c87882a0 Added a --lldb option to override the location
of LLDB.framework.

llvm-svn: 154728
2012-04-14 01:06:06 +00:00
Sean Callanan 2a7d20405d Made sure that the collections of mutexes used in
checking for LLDB mutex validity are static so
that entries put in there actually persist between
calls to error_check_mutex.

llvm-svn: 154727
2012-04-14 01:05:29 +00:00
Johnny Chen 7b9f93a186 Patch from Viktor Kutuzov <vkutuzov@accesssoftek.com>:
Hello everyone,
 
please find the attached patch for TOT and lldb-platform-work branch, which provides the following changes:
 - fixed a crash in the ProcessPOSIX constructor when an executable module object is not yet created.
 - added support for the multi instanciated FreeBSD platform objects (the local host and remote as example).
 - enabled the remote gdb plugin on FreeBSD.

llvm-svn: 154724
2012-04-14 00:54:42 +00:00
Sean Callanan 0fcd749a51 Updated LLVM to take a variety of fixes to
disassembler problems:

- r153766, fixing a crash disassembling vmov
- r154628, fixing relative branches
- r154459, fixing a crash disassembling vld
- r154544, fixing a crash disassembling vst

llvm-svn: 154722
2012-04-14 00:08:14 +00:00
Jim Ingham d846f1f2b1 The API lock was getting dropped too soon in GetVariables. GetValueObjectForFrameVariable could run the target (to get dynamic values) and that requires the target lock.
llvm-svn: 154711
2012-04-13 23:29:44 +00:00
Jim Ingham 99ff2c42f6 In debug mode, assert if we haven't initialized a mutex we thought we'd initialized.
llvm-svn: 154710
2012-04-13 23:28:33 +00:00
Jim Ingham 87d0e61839 Don't do the work in DoTakedown if the thread plan isn't valid.
Also fixed up some logging.

llvm-svn: 154709
2012-04-13 23:11:52 +00:00
Jim Ingham e39f85c774 The run all threads timeout in RunThreadPlan should respect the user timeout, not be arbitrarily 10 seconds (which was too long anyway...)
Also added some logging to RunThreadPlan and made others more regular.

llvm-svn: 154708
2012-04-13 23:09:49 +00:00
Greg Clayton d451c1a843 Added the thread ID (tid) to each packet history item and the packet history now always dumps to a lldb_private::Stream.
Enable logging the packet history when registers fail to read due to not getting the sequence mutex if "--verbose" is enabled on the log channel for the "gdb-remote" log category.

This will help us track down some issues.

llvm-svn: 154704
2012-04-13 21:24:18 +00:00
Johnny Chen 9a27713a74 First step to make the test suite runnable for remote platforms.
For the types directory, we were running lldbtest.system() to execute the compiled program
on the test host to collect golden output in order to compare with the output of various
lldb debugger commands as performed later.  This won't work for the remote platform
scenario where the architecture of the target and host platforms are different.

Modify the AbstractBase class to use lldb to launch the inferior while specifying the
output file, from which the golden output is collected and grokked.  How to bootstrap and
to connect to the remote platform is still being worked at.

llvm-svn: 154699
2012-04-13 20:40:52 +00:00
Jim Ingham 0092c8eb2f Factor out a bunch of common code in the two ThreadPlanCallFunction constructors. Also add a sanity check - try reading the frame, and if we fail bag out.
llvm-svn: 154698
2012-04-13 20:38:13 +00:00
Greg Clayton de0e9d04ad <rdar://problem/11193466>
Fixed an error where lldb would hang when writing memory near the end of the addres space due to an unsigned overflow.

llvm-svn: 154697
2012-04-13 20:37:20 +00:00
Jim Ingham cbbdaa9378 Couple more places in SBValue where you need to take the run-lock.
llvm-svn: 154683
2012-04-13 18:30:20 +00:00
Jim Ingham 718583ff23 ThreadPlanCallFunction's destructor wasn't calling DoTakedown, so if the that plan got discarded we weren't doing the takedown.
llvm-svn: 154681
2012-04-13 18:27:58 +00:00
Greg Clayton d84bb48582 Added a --memory option to allow dumping the matching malloc block memory with a default format that makes sense, or that format can be overridden with the --format option.
llvm-svn: 154671
2012-04-13 16:24:09 +00:00
Greg Clayton f958f348c8 <rdar://problem/11241798>
The less locks there are, the better. I removed the thread ID mutex and now just shared the m_thread_list's mutex to make sure we don't deadlock due to lock inversion.

llvm-svn: 154652
2012-04-13 02:11:32 +00:00
Jason Molenda 5a9f9d3241 version bump to lldb-139.
llvm-svn: 154650
2012-04-13 02:00:58 +00:00
Sean Callanan 84790aedb1 Updated llvm.zip to include a fix for a leak in
the MC disassembler.

llvm-svn: 154649
2012-04-13 01:46:44 +00:00
Johnny Chen 18104239b4 Ditto 'requires modern objc runtime' for TestRealDefinition.py -- fix test suite errors for i386.
llvm-svn: 154638
2012-04-13 00:23:26 +00:00
Greg Clayton ce7d345a57 Added more complete error checking for mutexes only for "Debug" builds where we always check if a mutex is valid prior to doing stuff with it. We also track when mutexes are initialized and destroyed and keep these in sets that can very subsequent pthread_mutex_XXX API calls.
llvm-svn: 154637
2012-04-13 00:21:53 +00:00
Johnny Chen 97ccf9f3b2 Ditto 'requires modern objc runtime' for TestObjCProperty.py -- fix test suite errors for i386.
llvm-svn: 154636
2012-04-13 00:18:17 +00:00
Johnny Chen 45872c01ff Fix some test suite errors. TestForwardDecl.py errors were due to bad Makefile.rules, while TestHiddenIvars.py errors due to features only available in modern objc runtime.
llvm-svn: 154635
2012-04-13 00:13:35 +00:00
Sean Callanan 60217120b5 Added a mechanism for keeping track of where in
the debug information individual Decls came from.

We've had a metadata infrastructure for a while,
which was intended to solve a problem we've since
dealt with in a different way.  (It was meant to
keep track of which definition of an Objective-C
class was the "true" definition, but we now find
it by searching the symbols for the class symbol.)
The metadata is attached to the ExternalASTSource,
which means it has a one-to-one correspondence with
AST contexts.

I've repurposed the metadata infrastructure to
hold the object file and DIE offset for the DWARF
information corresponding to a Decl.  There are
methods in ClangASTContext that get and set this
metadata, and the ClangASTImporter is capable of
tracking down the metadata for Decls that have been
copied out of the debug information into the
parser's AST context without using any additional
memory.

To see the metadata, you just have to enable the
expression log:
-
(lldb) log enable lldb expr
-
and watch the import messages.  The high 32 bits
of the metadata indicate the index of the object
file in its containing DWARFDebugMap; I have also
added a log which you can use to track that mapping:
-
(lldb) log enable dwarf map
-

This adds 64 bits per Decl, which in my testing
hasn't turned out to be very much (debugging Clang
produces around 6500 Decls in my tests).  To track
how much data is being consumed, I've also added a
global variable g_TotalSizeOfMetadata which tracks
the total number of Decls that have metadata in all
active AST contexts.

Right now this metadata is enormously useful for
tracking down bugs in the debug info parser.  In the
future I also want to use this information to provide
more intelligent error messages instead of printing
empty source lines wherever Clang refers to the
location where something is defined.

llvm-svn: 154634
2012-04-13 00:10:03 +00:00
Greg Clayton c8e0c244e4 Expose GetAddressClass() from both the SBAddress and SBInstruction so clients can tell the difference between ARM/Thumb opcodes when disassembling ARM.
llvm-svn: 154633
2012-04-13 00:07:34 +00:00
Sean Callanan 02eee4d4f7 Fixed a problem where LLDB inserted regular C
FunctionDecls into classes if it looked up a
method in a different DWARF context than the
one where it found the parent class's definition.

The symptom of this was, for a method A::B(),

1) LLDB finds A in context 1, creating a
   CXXRecordDecl for A and marking it as needing
   completion

2) LLDB looks up B in context 2, finds that its
   parent A already has a CXXRecordDecl, but can't
   find a CXXMethodDecl for B

3) Not finding a CXXMethodDecl for B, LLDB doesn't
   set the flag indicating that B was resolved

4) Because the flag wasn't set, LLDB's fallthrough
   code creates a FunctionDecl for B and sticks it
   in the DeclContext -- in this case, A.

5) Clang crashes on finding a FunctionDecl inside a
   CXXRecordDecl.

llvm-svn: 154627
2012-04-12 23:10:00 +00:00
Greg Clayton 1bcb26c672 Fixed some expression issues after switching to void * args.
llvm-svn: 154615
2012-04-12 21:06:22 +00:00
Greg Clayton af2589ea09 Fixed an issue that happens in LLDB versions after SBFrame switched to using a lldb::ExecutionContextRefSP where we might segfault due to using a shared pointer with NULL in it. The SBFrame object should always have a valid lldb::ExecutionContextRefSP in it. The SBFrame::Clear() method was doing the wrong thing and is now fixed.
llvm-svn: 154614
2012-04-12 20:58:26 +00:00
Greg Clayton c3c0b0e59a Remove the GetSequenceMutex timeout that isn't being used in the GDB remote plug-in.
Also fixed the ProcessLinux, ProcessPOSIX and ProcessFreeBSD to have the correct UpdateThreadList() prototype.

llvm-svn: 154603
2012-04-12 19:04:34 +00:00
Greg Clayton 7767716d0f A few tweaks done to the heap.py in me free time where we now have:
(lldb) command script import heap.py

Find all malloc blocks that contains a pointer value of 0x1234000:
(lldb) ptr_refs 0x1234000

Find all malloc blocks that contain a C string:
(lldb) cstr_refs "hello"

Get info on a malloc block that starts at or contains 0x12340000
(lldb) malloc_info 0x12340000

llvm-svn: 154602
2012-04-12 18:57:36 +00:00
Jim Ingham b1e2e848f3 Make sure that DoResume doesn't stall if we shut down the async thread while DoResume is waiting
for packet confirmation.  
Also added a bit more logging.
Also, unlock the writer end of the run lock in Process.cpp on our way out of the private state
thread so that the Process can shut down cleanly.

<rdar://problem/11228538>

llvm-svn: 154601
2012-04-12 18:49:31 +00:00
Jim Ingham 5b7a845a0a Cleanup, keep private types separate from private member variables.
llvm-svn: 154600
2012-04-12 18:25:11 +00:00
Sean Callanan 6f3e5ad704 Make sure frozen_sp for a ClangExpressionVariable
is non-NULL before asking for its name.

llvm-svn: 154593
2012-04-12 16:58:26 +00:00
Johnny Chen b127f00b51 Make the default architectures to run as both 64 and 32-bit.
rdar://problem/11031264

llvm-svn: 154573
2012-04-12 00:55:57 +00:00
Sean Callanan 18a11e33ea Fixed a crash in Clang when a superclass of an
Objective-C class doesn't have a definition but
Clang tries to read through its protocols anyway.

llvm-svn: 154538
2012-04-11 21:48:13 +00:00
Greg Clayton d1411e1aa2 Cleaned up code that was getting SBData for an SBInstruction.
llvm-svn: 154535
2012-04-11 21:13:31 +00:00
Greg Clayton 7fb671bac0 Cleaned up the code and we now also dump the dynamic object for the malloc block. Using this on the lldb/test/lang/objc/foundation test we can see this in action:
First we can load the module:

(lldb) command script import /Volumes/work/gclayton/Documents/src/lldb/examples/darwin/heap_find/heap.py
Loading "/Volumes/work/gclayton/Documents/src/lldb/examples/darwin/heap_find/libheap.dylib"...ok
Image 0 loaded.
"heap_ptr_refs" and "heap_cstr_refs" commands have been installed, use the "--help" options on these commands for detailed help.


Lets take a look at the variable "my":

(lldb) fr var *my
(MyString) *my = {
  MyBase = {
    NSObject = {
      isa = MyString
    }
    propertyMovesThings = 0
  }
  str = 0x0000000100301a60
  date = 0x0000000100301e60
  _desc_pauses = NO
}


We can see that this contains an ivar "str" which has a pointer value of "0x0000000100301a60". Lets search the heap for this pointer and see what we find:

(lldb) heap_ptr_refs 0x0000000100301a60
found pointer 0x0000000100301a60: block = 0x103800270, size = 384, offset = 168, type = 'void *'
found pointer 0x0000000100301a60: block = 0x100301cf0, size = 48, offset = 16, type = 'MyString *', ivar = 'str' 
(MyString) *addr = {
  MyBase = {
    NSObject = {
      isa = MyString
    }
    propertyMovesThings = 0
  }
  str = 0x0000000100301a60
  date = 0x0000000100301e60
  _desc_pauses = NO
}
found pointer 0x0000000100301a60: block = 0x100820000, size = 4096, offset = 96, type = (autorelease object pool)
found pointer 0x0000000100301a60: block = 0x100820000, size = 4096, offset = 104, type = (autorelease object pool)


Note that it used dynamic type info to find that it was in "MyString" at offset 16 and it also found the ivar "str"!

We can also look for C string values on the heap. Lets look for "a.out":

(lldb) heap_cstr_refs "a.out"
found cstr a.out: block = 0x10010ce00, size = 96, offset = 85, type = '__NSCFString *'
found cstr a.out: block = 0x100112d90, size = 80, offset = 68, type = 'void *'
found cstr a.out: block = 0x100114490, size = 96, offset = 85, type = '__NSCFString *'
found cstr a.out: block = 0x100114530, size = 112, offset = 97, type = '__NSCFString *'
found cstr a.out: block = 0x100114e40, size = 32, offset = 17, type = '__NSCFString *'
found cstr a.out: block = 0x100114fa0, size = 32, offset = 17, type = '__NSCFString *'
found cstr a.out: block = 0x100300780, size = 160, offset = 128, type = '__NSCFData *'
found cstr a.out: block = 0x100301a60, size = 112, offset = 97, type = '__NSCFString *'
found cstr a.out: block = 0x100821000, size = 4096, offset = 100, type = 'void *'

We see we have some objective C classes that contain this, so lets "po" all of the results by adding the --po option:

(lldb)  heap_cstr_refs a.out --po
found cstr a.out: block = 0x10010ce00, size = 96, offset = 85, type = '__NSCFString *'
  (__NSCFString *) 0x10010ce00 /Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out

found cstr a.out: block = 0x100112d90, size = 80, offset = 68, type = 'void *'
found cstr a.out: block = 0x100114490, size = 96, offset = 85, type = '__NSCFString *'
  (__NSCFString *) 0x100114490 /Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out

found cstr a.out: block = 0x100114530, size = 112, offset = 97, type = '__NSCFString *'
  (__NSCFString *) 0x100114530 Hello from '/Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out'

found cstr a.out: block = 0x100114e40, size = 32, offset = 17, type = '__NSCFString *'
  (__NSCFString *) 0x100114e40 a.out.dSYM

found cstr a.out: block = 0x100114fa0, size = 32, offset = 17, type = '__NSCFString *'
  (__NSCFString *) 0x100114fa0 a.out

found cstr a.out: block = 0x100300780, size = 160, offset = 128, type = '__NSCFData *'
  (__NSCFData *) 0x100300780 <48656c6c 6f206672 6f6d2027 2f566f6c 756d6573 2f776f72 6b2f6763 6c617974 6f6e2f44 6f63756d 656e7473 2f737263 2f6c6c64 622f7465 73742f6c 616e672f 6f626a63 2f666f75 6e646174 696f6e2f 612e6f75 742700>

found cstr a.out: block = 0x100301a60, size = 112, offset = 97, type = '__NSCFString *'
  (__NSCFString *) 0x100301a60 Hello from '/Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out'

found cstr a.out: block = 0x100821000, size = 4096, offset = 100, type = 'void *'

llvm-svn: 154519
2012-04-11 18:30:53 +00:00
Greg Clayton 885294808a Get rid of absolute path in "process load" command.
llvm-svn: 154506
2012-04-11 17:04:00 +00:00
Greg Clayton 804de01c33 Added a new "heap.py" module that adds a new command line command that can find values on the heap and print out the dynamic type of the malloc block that contains the data. I will be modifying this a bit more to tweak the output and make the output more useful.
llvm-svn: 154504
2012-04-11 16:27:06 +00:00
Greg Clayton 6a0afeb9c8 Fixed an issue that would cause a crash when dumping fully qualified types.
llvm-svn: 154503
2012-04-11 16:21:20 +00:00
Greg Clayton 851eacb507 Added a property to get the dynamic type which uses the most permissive way to get a dynamic type.
llvm-svn: 154502
2012-04-11 16:20:15 +00:00
Greg Clayton 37a0a24a5f No functionality changes, mostly cleanup.
Cleaned up the Mutex::Locker and the ReadWriteLock classes a bit.

Also cleaned up the GDBRemoteCommunication class to not have so many packet functions. Used the "NoLock" versions of send/receive packet functions when possible for a bit of performance.

llvm-svn: 154458
2012-04-11 00:24:49 +00:00
Jason Molenda 9704e82978 Tweak arm variants list for valid arches settings.
llvm-svn: 154450
2012-04-10 23:08:02 +00:00
Sean Callanan 62ecb9b97b Improved detection of ARM branch instructions to
cover all possible condition codes.

llvm-svn: 154440
2012-04-10 21:51:12 +00:00
Greg Clayton 470dfcbc42 Added more documentation in the header file to explain how to use the results that are found by the function calls to find_pointer_in_heap().
llvm-svn: 154435
2012-04-10 20:59:36 +00:00
Greg Clayton b10973af64 Fixed head_find to compile again.
llvm-svn: 154419
2012-04-10 18:19:20 +00:00
Sean Callanan 6153c518b9 Set variables returned by utility functions to
not consume slots in the persistent variable
store.

llvm-svn: 154416
2012-04-10 18:16:59 +00:00
Greg Clayton 4463399b0d Added a new packet to our GDB remote protocol:
QListThreadsInStopReply
	
This GDB remote query command can enable added a "threads" key/value pair to all stop reply packets so that we always get a list of all threads in each stop reply packet. It increases performance if enabled (the reply to the "QListThreadsInStopReply" is "OK") by saving us from sending to command/reply pairs (the "qfThreadInfo" and "qsThreadInfo" packets), and also helps us keep the current process state up to date. 

llvm-svn: 154380
2012-04-10 03:22:03 +00:00
Greg Clayton 9e92090b3c A general stability fix where we _always_ get the thread list immediately after we get the stop packets. We had some racy conditions where thread 1 might be sending a packet and thread 2 tries to send a packet to get the thread list and it fails and ends up with an empty list. Packets use a sequence mutex to be able to ensure when you send a packet, you get the resonse. This sequence mutex is take when the process is running, and as we exit the running state and notify our process with the stop packet, we now always get the thread ID list before we do anything and before we can run into race conditions.
The next step is to have our stop reply packets send the thread list in the actual stop reply packet to avoid a 2 packet overhead of sending the qfThreadInfo + response and qfThreadInfo + response.

llvm-svn: 154376
2012-04-10 02:25:43 +00:00
Jim Ingham 076b3041c0 Two changes,
1) Start the PrivateStateThread stopped, and then in
StartPrivateStateThread, make the private state thread and then
resume it before we say the thread is created.  That way we know it is
listening for events by the time we get out of
StartPrivateStateThread.

2) Backstop running a thread plan when calling Process::RunThreadPlan
on the private state thread with a ThreadPlanBase so that running the
plan doesn't pass its stop events to whatever plans happen to be above
us on the thread plan stack.

llvm-svn: 154368
2012-04-10 01:21:57 +00:00
Jim Ingham d8ba464b6a Clear the "m_actual_stop_info_sp" in the thread during Destroy. It might be a StopInfoThreadPlan, and that would hold onto members that need to be destroyed while the Full thread is still around.
llvm-svn: 154366
2012-04-10 00:44:25 +00:00
Greg Clayton 9fc13556b4 Trying to solve our disappearing thread issues by making thread list updates safer.
The current ProcessGDBRemote function that updates the threads could end up with an empty list if any other thread had the sequence mutex. We now don't clear the thread list when we can't access it, and we also have changed how lldb_private::Process handles the return code from the:

virtual bool
Process::UpdateThreadList (lldb_private::ThreadList &old_thread_list, 
                       	   lldb_private::ThreadList &new_thread_list) = 0;

A bool is now returned to indicate if the list was actually updated or not and the lldb_private::Process class will only update the stop ID of the validity of the thread list if "true" is returned.

The ProcessGDBRemote also got an extra assertion that will hopefully assert when running debug builds so we can find the source of this issue.

llvm-svn: 154365
2012-04-10 00:18:59 +00:00
Enrico Granata cb50d341aa Fixing a problem where some uninitialized cases of vectors could cause diagnostic output from the synthetic children providers - this time the fix should work
llvm-svn: 154361
2012-04-10 00:11:03 +00:00
Greg Clayton c1422c1d31 Added a packet history object to the GDBRemoteCommunication class that is always remembering the last 512 packets that were sent/received. These packets get dumped if logging gets enabled, or when the new expr lldb::DumpProcessGDBRemotePacketHistory (void *process, const char *log_file_path) global function is called.
llvm-svn: 154354
2012-04-09 22:46:21 +00:00
Greg Clayton 5c61054742 Removed an include that wasn't needed.
llvm-svn: 154353
2012-04-09 22:44:52 +00:00
Greg Clayton 437a135dd2 Fixed an issue that could occur when looking up functions inside of a namespace where if the NamespaceDecl hadn't been parsed yet, we would say a function wasn't in a namespace.
Also improved the logging that happens with "log enable dwarf lookups" is enabled to show when we find matches.

llvm-svn: 154352
2012-04-09 22:43:43 +00:00
Jim Ingham cf274f910e Rework how master plans declare themselves. Also make "PlanIsBasePlan" not rely only on this being the bottom plan in the stack, but allow the plan to declare itself as such.
llvm-svn: 154351
2012-04-09 22:37:39 +00:00
Greg Clayton 0cd7086604 <rdar://problem/11202426>
Work around a deadlocking issue where "SBDebugger::MemoryPressureDetected ()" is being called and is causing a deadlock. We now just try and get the lock when trying to trim down the unique modules so we don't deadlock debugger GUI programs until we can find the root cause.

llvm-svn: 154339
2012-04-09 20:22:01 +00:00
Benjamin Kramer c2b5c67df3 Linux/ProcessMonitor: include sys/user.h for user_regs_struct and user_fpregs_struct.
llvm-svn: 154255
2012-04-07 09:13:49 +00:00
Jason Molenda 7a2f433367 Version bump to lldb-138.
llvm-svn: 154252
2012-04-07 06:18:20 +00:00
Jason Molenda b9e88d4186 Fix a integer trauction issue - calculating the current time in
nanoseconds in 32-bit expression would cause pthread_cond_timedwait
to time out immediately.  Add explicit casts to the TimeValue::TimeValue
ctor that takes a struct timeval and change the NanoSecsPerSec etc
constants defined in TimeValue to be uint64_t so any other calculations
involving these should be promoted to 64-bit even when lldb is built
for 32-bit.

<rdar://problem/11204073>, <rdar://problem/11179821>, <rdar://problem/11194705>.

llvm-svn: 154250
2012-04-07 04:55:02 +00:00
Greg Clayton 7b70be3970 Removed redundant isxdigit checks and added the ability to GetHexU8() so it can extract an 8 bit hex value if one is available. It will set EOF if "set_eof_on_fail" is true or if out of data. This allows a string decoder to grab a string without losing the last part of the packet with a packet like "414243,abc" (it can extract "ABC" and leave the file position set to the comma).
llvm-svn: 154239
2012-04-07 00:42:53 +00:00
Sean Callanan bf81ea5a9f Hardened the struct layout code to eliminate a
potential crash if the underlying type couldn't
be completed.

llvm-svn: 154234
2012-04-07 00:06:00 +00:00
Jim Ingham 372787fc19 We sometimes need to be able to call functions (via Process::RunThreadPlan) from code run on the private state thread. To do that we have to
spin up a temporary "private state thread" that will respond to events from the lower level process plugins.  This check-in should work to do
that, but it is still buggy.  However, if you don't call functions on the private state thread, these changes make no difference.

This patch also moves the code in the AppleObjCRuntime step-through-trampoline handler that might call functions (in the case where the debug
server doesn't support the memory allocate/deallocate packet) out to a safe place to do that call.

llvm-svn: 154230
2012-04-07 00:00:41 +00:00
Sean Callanan d13c23c393 Changed some tabs to spaces to make Python like
this file.

llvm-svn: 154222
2012-04-06 23:02:44 +00:00
Sean Callanan 1106434be3 The remaining time calculation didn't reflect the
--start argument.  Fixed that.

llvm-svn: 154221
2012-04-06 23:00:31 +00:00
Johnny Chen 7bba2c6d64 The final batch of adding @dsym_test/@dwarf_test decorators.
llvm-svn: 154211
2012-04-06 21:33:58 +00:00
Sean Callanan afc7b13e56 Removed a call to truncate() which slowed down
the stress test by a LOT.

llvm-svn: 154208
2012-04-06 21:04:20 +00:00
Sean Callanan ceabd2d712 Updated the disassembler stress tester with two
new features:

(1) it outputs the instruction currently being
    tested to a log file, if a path is provided

(2) if instructed, it prints the time remaining
    in the exhaustive test

llvm-svn: 154205
2012-04-06 20:53:23 +00:00
Johnny Chen 24086bc93b Second batch of adding @dsym_test/@dwarf_test decorators to existing test cases.
Plus some minor cleanup of test method names.
Third and final batch is coming.

llvm-svn: 154197
2012-04-06 19:54:10 +00:00
Greg Clayton 780af51505 Fixed ModuleList::FindTypes() so that when a symbol context is supplied that contains a valid module, it will search that module first, then if we are still looking for matches (we have found less that "max_matches"), search in all of the other modules as well.
llvm-svn: 154186
2012-04-06 18:09:43 +00:00
Sean Callanan 2b54db7664 Fixed a leak in the LLVM disassembler where we
did not destroy the underlying disassembler in 
our destructor.

llvm-svn: 154185
2012-04-06 17:59:49 +00:00
Greg Clayton 29399a24c6 In a prior commit, I changed the parameters around on a ModuleList::FindTypes where the old parameters that existing clients were using would have been compatible, so I renamed ModuleList::FindTypes to ModuleList::FindTypes2. Then I made fixes and verified I updated and fixed all client code, but I forgot to rename the function back to ModuleList::FindTypes(). I am doing that now and also cleaning up the C++ dynamic type code a bit.
llvm-svn: 154182
2012-04-06 17:41:13 +00:00
Greg Clayton 55995ebb58 Check if the two clang opaque type pointers are equal before doing anything more exhaustive comparison.
llvm-svn: 154181
2012-04-06 17:38:55 +00:00
Greg Clayton c9858e4d05 Added logging when API calls try to do something that shouldn't be done when the process is stopped by having logging calls that end with "error: process is running".
Also test for the process to be stopped when many SBValue API calls are made to make sure it is safe to evaluate values, children of values and much more.

llvm-svn: 154160
2012-04-06 02:17:47 +00:00
Johnny Chen f1548d4f74 Add a new option to the test driver, -N dsym or -N dwarf, in order to exclude tests decorated with
either @dsym_test or @dwarf_test to be executed during the testsuite run.  There are still lots of
Test*.py files which have not been decorated with the new decorator.

An example:

# From TestMyFirstWatchpoint.py ->
class HelloWatchpointTestCase(TestBase):

    mydir = os.path.join("functionalities", "watchpoint", "hello_watchpoint")

    @dsym_test
    def test_hello_watchpoint_with_dsym_using_watchpoint_set(self):
        """Test a simple sequence of watchpoint creation and watchpoint hit."""
        self.buildDsym(dictionary=self.d)
        self.setTearDownCleanup(dictionary=self.d)
        self.hello_watchpoint()

    @dwarf_test
    def test_hello_watchpoint_with_dwarf_using_watchpoint_set(self):
        """Test a simple sequence of watchpoint creation and watchpoint hit."""
        self.buildDwarf(dictionary=self.d)
        self.setTearDownCleanup(dictionary=self.d)
        self.hello_watchpoint()


# Invocation ->
[17:50:14] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -N dsym -v -p TestMyFirstWatchpoint.py
LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
LLDB-137
Path: /Volumes/data/lldb/svn/ToT
URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
Repository Root: https://johnny@llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 154133
Node Kind: directory
Schedule: normal
Last Changed Author: gclayton
Last Changed Rev: 154109
Last Changed Date: 2012-04-05 10:43:02 -0700 (Thu, 05 Apr 2012)



Session logs for test failures/errors/unexpected successes will go into directory '2012-04-05-17_50_49'
Command invoked: python ./dotest.py -N dsym -v -p TestMyFirstWatchpoint.py
compilers=['clang']

Configuration: arch=x86_64 compiler=clang
----------------------------------------------------------------------
Collected 2 tests

1: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
   Test a simple sequence of watchpoint creation and watchpoint hit. ... skipped 'dsym tests'
2: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
   Test a simple sequence of watchpoint creation and watchpoint hit. ... ok

----------------------------------------------------------------------
Ran 2 tests in 1.138s

OK (skipped=1)
Session logs for test failures/errors/unexpected successes can be found in directory '2012-04-05-17_50_49'
[17:50:50] johnny:/Volumes/data/lldb/svn/ToT/test $ 

llvm-svn: 154154
2012-04-06 00:56:05 +00:00
Bill Wendling c80efb418b Add flag to warn about ivar initialization reordering.
llvm-svn: 154153
2012-04-06 00:48:15 +00:00
Bill Wendling 04e7e0ba7a explicitly cast the value.
llvm-svn: 154148
2012-04-06 00:10:46 +00:00
Bill Wendling 7a4b007c65 Order ivar initializers to how they're declared in the class.
llvm-svn: 154147
2012-04-06 00:10:21 +00:00
Bill Wendling e6eeef0164 Order ivar initializers to how they're declared in the class.
llvm-svn: 154146
2012-04-06 00:09:59 +00:00
Bill Wendling 4fe443aa21 Silence unused warning.
llvm-svn: 154145
2012-04-06 00:09:21 +00:00
Sean Callanan d181730aa5 Added a stress-tester for LLDB's disassembler.
Right now it only works on Mac OS X, but other
platforms would just need to add their own
implementation of AddLLDBToSysPathOn*().

The stress-tester has two modes:

Used with --bytes N --random, the stress-tester
generates random instructions of length N and
runs them through the disassembler.  This is
suitable for architectures like Intel where it
is combinatorially infeasible to run through the
entire space of possible instructions.

Used with --bytes N and no arguments (or --start
S --stride T), the stress-tester tests the
disassembler with a monotonically increasing
sequence of instructions.

The --start and --stride arguments are intended
for use in multiprocessing environments.  Give
each core an ID from 0 .. T-1, pass the ID in as
the --start, and use T as the stride, and you
can launch one copy of the stress-tester on each
core you have available.

llvm-svn: 154143
2012-04-06 00:04:36 +00:00
Greg Clayton d84cec07c9 Enable building the POSIX-DYLD dynamic loader plug-in in the Makefile build since it can be used for remote debugging.
llvm-svn: 154109
2012-04-05 17:43:02 +00:00
Bill Wendling e50ab408e5 Revert r154086. It may be needed for Darwin. But the symbols are still missing in the dylib.
llvm-svn: 154108
2012-04-05 17:38:07 +00:00
Greg Clayton 7fdf9ef15d Added a new Host class: ReadWriteLock
This abstracts read/write locks on the current host system. It is currently backed by pthread_rwlock_t objects so it should work on all unix systems.

We also need a way to control multi-threaded access to the process through the public API when it is running. For example it isn't a good idea to try and get stack frames while the process is running. To implement this, the lldb_private::Process class now contains a ReadWriteLock member variable named m_run_lock which is used to control the public process state. The public process state represents the state of the process as the client knows it. The private is used to control the actual current process state. So the public state of the process can be stopped, yet the private state can be running when evaluating an expression for example. 

Adding the read/write lock where readers are clients that want the process to stay stopped, and writers are clients that run the process, allows us to accurately control multi-threaded access to the process.

Switched the SBThread and SBFrame over to us shared pointers to the ExecutionContextRef class instead of making their own class to track this. This fixed an issue with assigning on SBFrame to another and will also centralize the code that tracks weak references to execution context objects into one location.

llvm-svn: 154099
2012-04-05 16:12:35 +00:00
Bill Wendling e914660c0d The DynamicLoaderPOSIXDYLD calls aren't available on Apple systems.
llvm-svn: 154086
2012-04-05 06:21:02 +00:00
Bill Wendling de59fb02b9 Add Security framework to the list of frameworks needed for linking.
llvm-svn: 154085
2012-04-05 06:20:13 +00:00
Sean Callanan a03156fc66 Tolerate decimal points in the LLDB version number.
They are truncated when generating the version
numbers seen in the headers, so for example
lldb-100.1 would have #define LLDB_VERSION=100

llvm-svn: 154074
2012-04-05 01:30:56 +00:00
Sean Callanan a658226ac0 Fixed a problem where we did not read properties
correctly if the setter/getter were not present
in the debug information.  The fixes are as follows:

- We not only look for the method by its full name,
  but also look for automatically-generated methods
  when searching for a selector in an Objective-C
  interface.  This is necessary to find accessors.

- Extract the getter and setter name from the
  DW_TAG_APPLE_Property declaration in the DWARF
  if they are present; generate them if not.

llvm-svn: 154067
2012-04-05 00:12:52 +00:00
Bill Wendling c359aafc55 Order the initializations so that they reflect how they're declared in the class.
llvm-svn: 154055
2012-04-04 21:19:57 +00:00
Greg Clayton 0b88d815e3 <rdar://problem/11184458>
Found an issue where we might still have shared pointer references to lldb_private::Thread objects where the object itself is not valid and has been removed from the Process. When a thread is removed from a process, it will call Thread::DestroyThread() which well set a boolean member variable which is exposed now via:

bool
Thread::IsValid() const;

We then check the thread validity before handing out a shared pointer.

llvm-svn: 154048
2012-04-04 20:43:47 +00:00
Greg Clayton 7e8a601c56 Change SBAddress back to using a std::auto_ptr to a lldb_private::Address as the lldb_private::Address has a weak pointer to the section which has a weak pointer back to the module, so it is safe to have just a lldb_private::Address object now.
llvm-svn: 154045
2012-04-04 20:36:48 +00:00
Greg Clayton b8a54482b3 Use LLDB as the default debugger for launcherXPCService.
llvm-svn: 154043
2012-04-04 20:07:33 +00:00
Greg Clayton 3c18cd3de1 Fixed the C++11 #defines that wrap std::weak_ptr to actually use std::weak_ptr.
llvm-svn: 154041
2012-04-04 20:03:33 +00:00
Enrico Granata f18c03e49e Attempt at fixing a crasher where summary strings where looping endlessly.
llvm-svn: 154028
2012-04-04 17:34:10 +00:00
Enrico Granata 0249fba8c3 Fixing a potential crasher where Python would assume we have no thread state while clearing out an SBDebugger which was acquiring input from the interactive interpreter
llvm-svn: 154027
2012-04-04 17:31:29 +00:00
Enrico Granata 8d4a8010cf Adding a new --python-function (-F) option to breakpoint command add. The option allows the user to specify a Python function name instead of a Python oneliner or interactive script input as a breakpoint command
llvm-svn: 154026
2012-04-04 17:30:31 +00:00
Greg Clayton 3c2c4bb2ce Added a platform agnostic symbolication python module that can be used by any targets. Then modified the darwin "crashlog.py" to use this agnostic info and the new functionality and classes.
llvm-svn: 153969
2012-04-03 21:35:43 +00:00
Bill Wendling d53b5dedb2 Initialize ivars in the correct order.
llvm-svn: 153947
2012-04-03 08:46:13 +00:00