Commit Graph

6659 Commits

Author SHA1 Message Date
Sean Callanan 9be9d172bf Fixed handling of function pointers in the IR
interpreter.  They now have correct values, even
when the process is not running.

llvm-svn: 177372
2013-03-19 01:45:02 +00:00
Enrico Granata 6d37cc6501 This checkin removes the last Cocoa formatters that were implemented in Python and reimplements them in C++. The Python Cocoa formatters are not shipped as part of LLDB anymore, but still exist in the source repository for user reference. Python formatters still exist for STL classes and users can still define their own Python formatters
llvm-svn: 177366
2013-03-19 00:27:22 +00:00
Greg Clayton 9585fbfc67 <rdar://problem/13443931>
Fixed a crasher in the SourceManager where it wasn't checking the m_target member variable for NULL.

In doing this fix, I hardened this class to have weak pointers to the debugger and target in case they do go away. I also changed SBSourceManager to hold onto weak pointers to the debugger and target so they don't keep objects alive by holding a strong reference to them.

llvm-svn: 177365
2013-03-19 00:20:55 +00:00
Sean Callanan 8dfb68e039 Refactored the expression parser so that the IR
and the JITted code are managed by a standalone
class that handles memory management itself.

I have removed RecordingMemoryManager and
ProcessDataAllocator, which filled similar roles
and had confusing ownership, with a common class
called IRExecutionUnit.  The IRExecutionUnit
manages all allocations ever made for an expression
and frees them when it goes away.  It also contains
the code generator and can vend the Module for an
expression to other clases.

The end goal here is to make the output of the
expression parser re-usable; that is, to avoid
re-parsing when re-parsing isn't necessary.

I've also cleaned up some code and used weak pointers
in more places.  Please let me know if you see any
leaks; I checked myself as well but I might have
missed a case.

llvm-svn: 177364
2013-03-19 00:10:07 +00:00
Greg Clayton a45a5d86f7 Fixed the README to match the current code.
llvm-svn: 177346
2013-03-18 23:25:00 +00:00
Jim Ingham 3793322df7 Add a comment about how to add a target for a test case.
llvm-svn: 177343
2013-03-18 23:08:30 +00:00
Jim Ingham 65423de84d Move the performance test cases into their own project.
llvm-svn: 177341
2013-03-18 23:05:00 +00:00
Greg Clayton 7b8f738227 Code cleanup:
- don't use preprocessor macros
- use switch statements
- don't put anything in the lldb namespace, use "lldb_perf" namespace.
- Pass the action struct into each TestStep() for each step fill in
- Modify the ActionWanted class to have accessors to make the continue, next, finish, kill instead of using preproc macros

llvm-svn: 177332
2013-03-18 22:34:00 +00:00
Sylvestre Ledru 6d88a690e6 When built with cmake, only call the string functions when the previous commands (utils/GetSourceVersion & utils/GetRepositoryPath successed). Otherwise, they fail when not launched from a repository
llvm-svn: 177225
2013-03-16 17:01:13 +00:00
Enrico Granata 9f71ad4fa8 C++ formatters for NSTimeZone and for CFBitVector
llvm-svn: 177219
2013-03-16 01:50:07 +00:00
Enrico Granata 6a92511a08 NS(Mutable)IndexSet formatter moves from Python to C++
llvm-svn: 177217
2013-03-16 01:18:00 +00:00
Enrico Granata 50b5ee5023 Converting more data formatters to C++ - NSBundle, CFBinaryHeap, NSMachPort and NSNotification
llvm-svn: 177213
2013-03-16 00:50:25 +00:00
Greg Clayton 6482d2305e <rdar://problem/13194155>
Variables view out of sync with lldb in Xcode is now fixed. Depending on what happened stack frames could get out of date and a stale shared pointer (one that is no longer a current frame in a thread) could end up being used. 

Now we don't store a weak_ptr to a frame in the ExecutionContextRef class, we just store its stack ID and we always regrab the frame from the thread by stack ID.

llvm-svn: 177208
2013-03-15 23:54:07 +00:00
Enrico Granata 7277d201a9 Performance improvements to the IsObjCNil () - we only try to resolve the value if the variable under consideration truly is an “Objective-C thing”
This also changes the ClangASTContext to make sure that id is correctly marked as being such an ObjC thing

llvm-svn: 177203
2013-03-15 23:33:15 +00:00
Han Ming Ong 7b641e97ed <rdar://problem/13100435>
Don't discount regions that vmmap is not discounting.

llvm-svn: 177202
2013-03-15 23:19:44 +00:00
Jim Ingham e7b849e4fb Convert the -a option in "image lookup" to a address-expression, and pass the context
in the -a address expression lookup in "image list" so that it actually works.

llvm-svn: 177200
2013-03-15 23:09:19 +00:00
Matt Kopec 862884327f Rework TestChangedValueAPI.py to account for gcc setting multiple breakpoints.
llvm-svn: 177198
2013-03-15 22:49:52 +00:00
Jim Ingham f48e20e15d Make the conditional break test case a little more robust.
llvm-svn: 177196
2013-03-15 22:19:27 +00:00
Jim Ingham 31938cad9c The regular expression command object was resetting the execution context of the
resolved command, which it should not do.  It should adopt whatever context the
regular expression command was called with.  This was causing regular expression
commands run inside breakpoint commands to adopt the currently selected context,
not the one coming from the breakpoint that we hit.

<rdar://problem/13411771>

llvm-svn: 177195
2013-03-15 22:18:26 +00:00
Matt Kopec f99f0b8cf7 Fix Makefile.rules where no icc is installed and -C gcc is used.
Patch by Ashok Thirumurthi.

llvm-svn: 177192
2013-03-15 21:55:13 +00:00
Matt Kopec c6672c8783 Rollback r177173. Some OSs may not have ptrace extensions which lldb expects when building. This needs to be accounted for.
llvm-svn: 177176
2013-03-15 20:00:39 +00:00
Matt Kopec 0de53f062f Add icc support to the test suite
-adds icc to the lit of compilers to run the tests
-adds icc test decorators
-skip TestAnonymous.py for icc

Patch by Ashok Thirumurthi.

llvm-svn: 177174
2013-03-15 19:10:12 +00:00
Matt Kopec 6773276351 Add ptrace extensions to query a register set.
Patch by Ashok Thirumurthi.

llvm-svn: 177173
2013-03-15 19:06:45 +00:00
Enrico Granata 559008649b Porting the Objective-C Class data type’s summary from Python to C++
llvm-svn: 177172
2013-03-15 18:55:30 +00:00
Enrico Granata f68f732746 Moving CFBag and NSBundle summaries from Python to C++
Temporarily disabled non-code-running summaries for CF*Dictionary and NSCountedSet

llvm-svn: 177171
2013-03-15 18:44:08 +00:00
Enrico Granata ebafd2f187 <rdar://problem/13194155>
Fixing an issue where threads and frames could get out of sync and cause ValueObjects to fail to retrieve their values correctly

llvm-svn: 177166
2013-03-15 17:25:04 +00:00
Sean Callanan cb7733c33c Rolled back r176719 because settings with file
names were broken.

<rdar://problem/13422580>

llvm-svn: 177139
2013-03-15 01:39:44 +00:00
Greg Clayton 4a89501f82 <rdar://problem/12537646>
lldb remembers not-found source file, setting target.source-map doesn't make it re-check for it. Now this is fixed. Each time the source path remappings get updated, the modification ID in the PathMappingList gets bumped and then we know the re-check for sources.

llvm-svn: 177125
2013-03-14 22:52:17 +00:00
Jim Ingham cf2667c46e Log the match substring as well in the case where we match the step-avoid regexp.
llvm-svn: 177119
2013-03-14 22:00:18 +00:00
Jim Ingham 3101ba3300 Add some logging to track cases where “step-in” steps out due to the avoid-regexp and the step-in target.
llvm-svn: 177117
2013-03-14 21:44:36 +00:00
Matt Kopec 9eb40a97f7 Recommit lldb realtime output for POSIX.
-Adds workaround for assertion in lldb for TestEvents.py

llvm-svn: 177116
2013-03-14 21:35:26 +00:00
Enrico Granata 26858401a2 Make a README file with an introduction and basic directions for the lldb-perf infrastructure
llvm-svn: 177109
2013-03-14 20:42:53 +00:00
Enrico Granata 86910577cc <rdar://problem/13228487>
A test case for the performance of some LLDB formatters
Changes and improvements to the testing infrastructure itself

llvm-svn: 177100
2013-03-14 19:00:42 +00:00
Greg Clayton faac111870 <rdar://problem/13421412>
Many "byte size" members and variables were using a mixture of uint32_t and size_t. Switching over to using uint64_t everywhere.

llvm-svn: 177091
2013-03-14 18:31:44 +00:00
Sean Callanan c4b1ab442d Fixed a problem where we didn't return TypedefNameDecls
when clang asked for them by name.

llvm-svn: 177085
2013-03-14 17:21:53 +00:00
Greg Clayton 617995c095 <rdar://problem/13413693>
Fixed a crasher in the new DWARF in .o files line table linking function where "back()" could end up being called on an empty std::vector.

llvm-svn: 177082
2013-03-14 16:47:56 +00:00
Matt Kopec 85cc3b3dbf Backout POSIX realtime lldb output. TestEvents.py is causing lldb to assert.
llvm-svn: 177076
2013-03-14 14:22:40 +00:00
Han Ming Ong 0c27cb7fa1 <rdar://problem/13415471>
Don't get dirty page size if we are not going to send it back

llvm-svn: 176992
2013-03-13 22:51:04 +00:00
Daniel Malea 66586653b7 Add braces to crashed test summary (needed for buildbots to detect crashes)
llvm-svn: 176980
2013-03-13 21:50:49 +00:00
Daniel Malea b7e4e22795 Remove extra whitespace
llvm-svn: 176978
2013-03-13 21:18:54 +00:00
Daniel Malea 6b72269b3d Prepend "FAIL:" string to tests that crash so that buildbots pick them up.
llvm-svn: 176974
2013-03-13 21:08:02 +00:00
Daniel Malea 10320dd06f Minor LLDB test improvements
- fix TestCPPBool (was failing with some versions of GCC due to num_breakpoint_locations)
- speed up tests by skipping git/svn revision parsing by the test harness when running in lit-compatible (parsable) mode

This should resolve the failures reported by http://lab.llvm.org:8011/builders/lldb-x86_64-linux

llvm-svn: 176972
2013-03-13 20:50:05 +00:00
Greg Clayton e4ca515ae1 <rdar://problem/13404189>
Made the "--reverse" option to "source list" also be able to use the "--count". This helps us implement support for regexp source list command:

(lldb) l -10

Which gets turned into:

(lldb) source list --reverse --count 10

Also simplified the code that is used to track showing more source from the last file and line.

llvm-svn: 176961
2013-03-13 18:25:49 +00:00
Greg Clayton 682b60e4b4 <rdar://problem/13396207>
Added logging that will show up in the system console when we try to resume a process that is already running, or has an unexpected state.

llvm-svn: 176960
2013-03-13 18:23:44 +00:00
Jim Ingham 17d023f6ac Add a target setting (target.use-fast-stepping) to control using the "run to next branch" stepping algorithm.
llvm-svn: 176958
2013-03-13 17:58:04 +00:00
Jim Ingham 0c61dee1b9 The step by running from branch to branch pretty much works with this checkin (at least for x86_64) but is still
turned off, it needs more qualification.  If you want to play with it, change the initialization of m_use_fast_step
to true.

llvm-svn: 176923
2013-03-13 01:56:41 +00:00
Jim Ingham 32ce20c5ee DoesBranch needs to compute the instruction if it isn't already done.
Handle the "alternate_isa" correctly.

llvm-svn: 176922
2013-03-13 01:55:16 +00:00
Jim Ingham d19444c48b More cleanup, remove an untrue comment.
llvm-svn: 176921
2013-03-13 01:53:26 +00:00
Jim Ingham 5bb7e1e11f Remove an unused #include.
llvm-svn: 176920
2013-03-13 01:52:33 +00:00
Jim Ingham 9026dee92e Don't use the fact that we stopped with a "Breakpoint" stop reason to decide to step over the breakpoint. It's
better to check directly whether there is a breakpoint site at the PC.

llvm-svn: 176919
2013-03-13 01:52:09 +00:00
Jim Ingham 199e4f7dc5 Add a missing check for getting a NULL oso module back from GetModuleByCompUnitInfo.
llvm-svn: 176918
2013-03-13 01:34:14 +00:00
Jason Molenda 1ad66dbae4 Various fixes for armv7 floating point/vector register support.
Drop the old f registers from debugserver's register list.  Add the
NEON 128-bit q registers to debugserver, support reading and writing.
Add the new contains / invalidates mappings for the s, d, and q 
registers so lldb will know what registers overlay what other registers.
Change the default format of s and d registers to be floating point
instead of hex.  Remove some UTF-8 hyphen chars in comments in the ARM
register number definition headers.  
<rdar://problem/13121797> 

llvm-svn: 176915
2013-03-13 00:14:30 +00:00
Jim Ingham 1b57d17e42 Add a missing call to GetFileRangeMap. It's absence was causing debug info from .o files to sometimes
not get processed.

<rdar://problem/13406310>

llvm-svn: 176914
2013-03-13 00:07:18 +00:00
Sean Callanan 34cf820b8a Switch from CreateTypeSourceInfo, which allocates
uninitialized memory, to getTrivialTypeSourceInfo,
which initializes its memory, when creating trivial
TypeSourceInfos.

<rdar://problem/13332253>

llvm-svn: 176899
2013-03-12 21:22:00 +00:00
Matt Kopec 787d1623b0 Misc. clang build warning fixes.
llvm-svn: 176879
2013-03-12 17:45:38 +00:00
Jim Ingham 7c06a09903 For file & line breakpoints, if there are subsets of contiguous line table entries for the specified line, set the
breakpoint on the first one of each of the contiguous sub-sets of entries, and not all the others.

llvm-svn: 176846
2013-03-12 01:25:22 +00:00
Jim Ingham e674c8315a The default configuration should be Debug, not DebugClang.
llvm-svn: 176845
2013-03-12 01:19:42 +00:00
Greg Clayton 0b0ceb617f Updated the register numbering base documentation for the "gcc", "dwarf", "container-regs" and "invalidate-regs" key/value responses to the "qRegisterInfo" packet.
llvm-svn: 176843
2013-03-12 00:14:38 +00:00
Sean Callanan 60e390cbd5 Created a sample "jump" command that handles
GDB-style linespecs.  This command allows changing
the PC without manually looking up the new address.

llvm-svn: 176841
2013-03-12 00:08:40 +00:00
Matt Kopec 097cd6262d Change Linux/POSIX to output inferior output in realtime.
llvm-svn: 176833
2013-03-11 22:31:31 +00:00
Greg Clayton a4f4223853 Buildbot was failing to build. I guess classes declared in implementation files are treated differently on various compilers causing a "friend class Foo;" to fail for forward declared classes in global namespace.
llvm-svn: 176823
2013-03-11 20:02:03 +00:00
Greg Clayton bff7825a57 <rdar://problem/13372857>
Fixed the exception breakpoints to always use a file filter to make setting exception breakpoint efficient.

llvm-svn: 176821
2013-03-11 18:42:51 +00:00
Jason Molenda 4439450803 Xcode seems to want these lines added to the project file.
llvm-svn: 176792
2013-03-10 21:56:57 +00:00
Sylvestre Ledru 1573b1b32c Match the new declaration of clang::ASTContext::getFunctionType introduced in clang r176726. Fix the build of lldb
llvm-svn: 176790
2013-03-10 20:13:16 +00:00
Jason Molenda 252d6a385c Remove use of the ARMDisassembler framework from
DNBArchImplARM.  This framework is no longer around;
all armv7 devices support using hardware breakpoints
to instruction single step.

llvm-svn: 176761
2013-03-09 07:03:32 +00:00
Jason Molenda 03a00faae4 Also remove actual link against the ARMDisassembler framework from
debugserver's build settings.

llvm-svn: 176760
2013-03-09 06:19:31 +00:00
Jason Molenda cc526b797a We don't need to specify the VALID_ARCHS in the xcode project file.
Also, don't build debugserver with -DUSE_ARM_DISASSEMBLER_FRAMEWORK -
that framework isn't around at this point.

llvm-svn: 176759
2013-03-09 06:15:46 +00:00
Greg Clayton 5a23444033 Remove my print statements I was using for debugging.
llvm-svn: 176753
2013-03-09 02:29:04 +00:00
Greg Clayton 0449678bce <rdar://problem/13384282>
As much as I hate to leave this hacky code in that adds some d and q registers to ARM registers, I must leave it in.

The code is now fixed to not just assume ANY arm target will have registers in a certain order. We now verify the common regs are the same name and byte size before adding the d and q regs.

llvm-svn: 176752
2013-03-09 02:19:08 +00:00
Sean Callanan 6c9265b07e Made LLDB work with the latest Clang. Also fixed
an assertion due to non-implicit Objective-C methods
without source locations.

llvm-svn: 176750
2013-03-09 01:59:31 +00:00
Jim Ingham 168d469a19 Fix a reversed test for "for_expression" in creating C++ exception breakpoints.
Add a missing "break" in processing the -h option to "breakpoint set".

llvm-svn: 176741
2013-03-09 00:48:58 +00:00
Jason Molenda c33136706d Fix assert in RegisterValue::SetBytes if we're trying to
write a 32-byte value into a 32-byte ymm vector reg - that 
is allowed.
<rdar://problem/13350587> 

llvm-svn: 176740
2013-03-09 00:04:17 +00:00
Sean Callanan 83b3da95f6 Removed One Definition Rule warnings because they're
noisy when dealing with anonymous structs.

<rdar://problem/13246914>

llvm-svn: 176738
2013-03-08 23:38:53 +00:00
Greg Clayton 613641d398 <rdar://problem/13361742>
Don't resolve .o file locations when setting the file spec for each .o file in DWARF with debug map. We should trust the path.

llvm-svn: 176725
2013-03-08 21:46:30 +00:00
Sean Callanan 8773ce2fec OptionValueFileSpec shouldn't be doing argument
parsing on the file name it gets.  That confuses
it if there are spaces in the file name.

<rdar://problem/13380392>

llvm-svn: 176719
2013-03-08 20:59:47 +00:00
Enrico Granata 24ccabfdc3 Dump the measurements directly instead of getting their metrics first
(this code needs to be pushed up so that in the basic scenarios TestCase knows to dump all its measurements directly)

llvm-svn: 176718
2013-03-08 20:50:36 +00:00
Enrico Granata f58cececaa Initial checkin of a new project: LLDB Performance Testing Infrastructure
This is a very basic implementation of a library that easily allows to drive LLDB.framework to write test cases for performance

This is separate from the LLDB testsuite in test/ in that:
a) this uses C++ instead of Python to avoid measures being affected by SWIG
b) this is in very early development and needs lots of tweaking before it can be considered functionally complete
c) this is not meant to test correctness but to help catch performance regressions

There is a sample application built against the library (in darwin/sketch) that uses the famous sample app Sketch as an inferior to measure certain basic parameters of LLDB's behavior.
The resulting output is a PLIST much like the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
	<dict>
		<key>fetch-frames</key>
		<real>0.13161715522222225</real>
	</dict>
	<dict>
		<key>file-line-bkpt</key>
		<real>0.029111678750000002</real>
	</dict>
	<dict>
		<key>fetch-modules</key>
		<real>0.00026376766666666668</real>
	</dict>
	<dict>
		<key>fetch-vars</key>
		<real>0.17820429311111111</real>
	</dict>
	<dict>
		<key>run-expr</key>
		<real>0.029676525769230768</real>
	</dict>
</array>
</plist>

Areas for improvement:
- code cleanups (I will be out of the office for a couple days this coming week, but please keep ideas coming!)
- more metrics and test cases
- better error checking

This toolkit also comprises a simple event-loop-driven controller for LLDB, similar yet much simpler to what the Driver does to implement the lldb command-line tool.

llvm-svn: 176715
2013-03-08 20:29:13 +00:00
Sean Callanan 8106d8082c Added very lightweight, statically-allocated
counters for a variety of metrics associated
with expression parsing.  This should give some
idea of how much work the expression parser is
doing on Clang's behalf, and help with hopefully
reducing that load over time.

<rdar://problem/13210748> Audit type search/import for expressions

llvm-svn: 176714
2013-03-08 20:04:57 +00:00
Jason Molenda 9c4a232add Update PlatformDarwin to understand how armv7m / armv7em relate
to the other armv7 types as far as compatibility/interchangability
goes.
<rdar://problem/13361372> 

llvm-svn: 176684
2013-03-08 04:33:44 +00:00
Greg Clayton 1bbcc03455 <rdar://problem/13374267>
Fixed error where objective C methods with selectors names starting with ".cxx_" where causing errors for ARC built binaries.

llvm-svn: 176683
2013-03-08 02:42:06 +00:00
Greg Clayton c4ffd66f06 <rdar://problem/13119621>
Make dynamic type detection faster by using the AST metadata to help out and allow us not to complete types when we don't need to.

After running "purge" on a MacOSX system, the Xcode variables view now populates more than 3x faster with this fix.

llvm-svn: 176676
2013-03-08 01:37:30 +00:00
Jason Molenda 7a1559c239 Add recognition of two more armv7 variants, armv7m and armv7em.
<rdar://problem/13361372> 

llvm-svn: 176674
2013-03-08 01:20:17 +00:00
Jim Ingham b0fac5090f Add a comment to break disable's help to make clearer the relationship between the
enable/disable state of a breakpoint, and of its locations.

llvm-svn: 176672
2013-03-08 00:31:40 +00:00
Jason Molenda c1a6583143 Typeo in warning message.
llvm-svn: 176664
2013-03-07 22:44:42 +00:00
Sean Callanan 3d27e6603a Updated Apple LLDB version to lldb-300.99.0. Also
updated the build system to support the new Apple
LLDB versioning scheme.

llvm-svn: 176662
2013-03-07 22:29:06 +00:00
Daniel Malea 7f454e0aed Fix enum_types test on Linux
- Required flag "-std=c++11" needs to be set before including Makefile.rules

llvm-svn: 176644
2013-03-07 20:13:11 +00:00
Daniel Malea 4185a92b9d Fix issue that causes linux buildbots to ignore errors
- change string "ERROR" to "FAIL" to match clang lit test results

Also, make LLDB tests work on machines that do not have svn and/or git installed

llvm-svn: 176633
2013-03-07 18:39:26 +00:00
Greg Clayton 66a907a6bd Added new properties to lldb.SBModule classes:
"compile_units" returns an array of all compile units in a module as a list() of lldb.SBCompileUnit objects.

"compile_unit" returns a compile unit accessor object that allows indexed access, search by full or partial path, or by regex:

(lldb) script
comp_unit = lldb.target.module['TextEdit'].compile_unit['Document.m']
comp_unit = lldb.target.module['TextEdit'].compile_unit['/path/to/Document.m']
comp_unit = lldb.target.module['TextEdit'].compile_unit[0]
comp_unit = lldb.target.module['TextEdit'].compile_unit[1]
for comp_unit in lldb.target.module['TextEdit'].compile_unit[re.compile("\.m$")]
  print comp_unit

This helps do quick searches and scripting while debugging.

llvm-svn: 176613
2013-03-07 03:25:11 +00:00
Greg Clayton 1fb7c625d0 Stop the "module" property from throwing an exception when the module name was not found in the target module list.
llvm-svn: 176611
2013-03-07 02:58:47 +00:00
Greg Clayton 923bedf52f Added a new module that can dump all line tables for all compile units in any modules that are specified as arguments to the "dump_module_line_tables" command.
I used this to verify that the debug map line tables were the same as previous LLDB releases prior to my change in the DWARF in .o file linking.

llvm-svn: 176610
2013-03-07 02:57:54 +00:00
Daniel Malea 33174017e0 Clean up LLDB CMake build output
- remove "-debug" flag from swig scripts
- use "echo -n" instead of "echo" in dummy target to avoid printing a useless newline

llvm-svn: 176597
2013-03-07 00:52:25 +00:00
Daniel Malea 3c216ace9b Fix running of LLDB tests with cmake+ninja+ccache
- Avoid passing 'ccache' as the test compiler. Instead, use first arg after ccache.

llvm-svn: 176596
2013-03-07 00:50:54 +00:00
Daniel Malea 4ebaace6b3 Fix Linux i386 build
- missing definitions were causing different definitions of type 'off_t', resulting in linker errors
- fix is to define _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64

llvm-svn: 176595
2013-03-07 00:48:53 +00:00
Han Ming Ong 0d03deeeb9 <rdar://problem/13119170>
Reap the child process (debugserver) when it is done.

llvm-svn: 176594
2013-03-06 23:59:34 +00:00
Greg Clayton 084fad6a51 <rdar://problem/13362109>
LLDB was not parsing line tables correctly for DWARF in .o files after recent debug map changes. This has now been fixed. 

llvm-svn: 176592
2013-03-06 23:23:27 +00:00
Jason Molenda 4e7511efc7 Remove some tabs and extraneous space chars from ObjectFileMachO.cpp.
Noticed these while working on the last commit.

llvm-svn: 176590
2013-03-06 23:19:17 +00:00
Jason Molenda 255f9bbcf4 Retrieve the dyld shared cache mapping offset from the shared cache instead of hardcoding the value.
Read the version number of the dyld shared cache.
<rdar://problem/13311882> 

llvm-svn: 176589
2013-03-06 23:17:36 +00:00
Andrew Kaylor 7bdeab592d Skipping TestConstVariables on Linux.
The test was marked as expectedFailureLinux, but now it passes with gcc and some versions of clang.  Newer versions of clang introduce a failure due to bad DWARF information.

llvm-svn: 176581
2013-03-06 21:37:41 +00:00
Greg Clayton 00108408ac Added tests to test for "settings set" with trailing whitespaces after the values.
llvm-svn: 176579
2013-03-06 21:17:06 +00:00
Andrew Kaylor 9e9f1db866 Adding support for DW_OP_stack_value in DWARFExpression::Evaluate
llvm-svn: 176578
2013-03-06 21:13:09 +00:00
Sean Callanan f58b12d8eb Added a little bit of logging to ClangFunction to
make it more obvious what's going on.

llvm-svn: 176575
2013-03-06 19:57:25 +00:00
Andrew Kaylor 60cdeb6aa8 Add support for non-register scalar values in DoMaterializeOneVariable.
llvm-svn: 176574
2013-03-06 19:35:33 +00:00
Matt Kopec 7de484640e Improve/Cleanup ptrace wrapper and remove dependency on user.h
Patch by Ashok Thirumurthi.

llvm-svn: 176558
2013-03-06 17:20:48 +00:00
Greg Clayton 5d14fc061f Fixed enum printing for negative enums. There previously was no testing to validate that enum values were being displayed correctly.
Also added C++11 enum test cases to cover enums as int8_t, int16_t int32_t, int64_t, uint8_t, uint16_t, uint32_t, and uint64_t both for DWARF and dSYM cases. The DWARF being emitted by clang is missing the enum integer type, but the code is now ready to accept and deal with the integral type if it is supplied.

llvm-svn: 176548
2013-03-06 06:23:54 +00:00
Greg Clayton 2a844b7ff8 Fixed test suite errors due to new clang -v output.
llvm-svn: 176546
2013-03-06 02:34:51 +00:00
Greg Clayton 21c895e3d5 Now that "settings set" will strip leading and trailing spaces, we need a way to be able to specify string values that contain spaces. So now settings setting <property> <value>" can have a <value> that is quoted:
settings set prompt "(lldb2) "

llvm-svn: 176545
2013-03-06 02:19:38 +00:00
Greg Clayton 62243f8478 Disable JITed code in any processes that use DynamicLoaderStatic.
llvm-svn: 176541
2013-03-06 00:59:41 +00:00
Greg Clayton 3e06753408 <rdar://problem/13341472>
LLDB wasn't printing the names for negative enums. Fixed the signed extraction of enumerators and how they were registered with clang's type system.

llvm-svn: 176533
2013-03-05 23:54:39 +00:00
Greg Clayton 30820f0685 <rdar://problem/13184855>
Spaces in "settings set" value strings no longer cause setting failures.

llvm-svn: 176532
2013-03-05 23:52:49 +00:00
Daniel Malea b6c6e0492b Be more precise in GCC/autoconf build instructions about compiler versions
llvm-svn: 176528
2013-03-05 22:58:53 +00:00
Daniel Malea fad9aae937 Typos: be more precise on the build page when mentioning the non-cmake build system
llvm-svn: 176524
2013-03-05 22:43:08 +00:00
Daniel Malea a2e4598d88 Add instructions for building LLDB with CMake
- suported generators: Ninja and Unix Makefiles
- added instructions to run tests when building with autoconf

llvm-svn: 176522
2013-03-05 22:38:50 +00:00
Daniel Malea ab5c2012d3 Fix Ninja LLDB build on Linux (via cmake -G Ninja)
- resolved circular dependency issue by making liblldb depend directly on LLDBWrapPython.cpp
- removed use of '..' for relative directories -- ninja doesn't like this
- fixed build-order problem

llvm-svn: 176517
2013-03-05 21:59:12 +00:00
Matt Kopec 3041286f64 Add support on POSIX to determine if an inferior has changed while debugging it.
llvm-svn: 176492
2013-03-05 17:23:57 +00:00
Jason Molenda 69b6b635fa Fix ivar ordering for Process ctor to match the order they're
declared in the .h file.

llvm-svn: 176473
2013-03-05 03:33:59 +00:00
Daniel Malea 658fd5798b Un-skipping tests affected by llvm.org/pr15256
patch by Ashok Thirumurthi!

llvm-svn: 176462
2013-03-04 23:15:08 +00:00
Daniel Malea 208b5beb60 Fix makefile and re-enable test disabled due to llvm.org/pr15256
- fix is: don't pass incompatible -stdlib option when building with GCC

llvm-svn: 176460
2013-03-04 23:04:53 +00:00
Greg Clayton 9422dd64f8 <rdar://problem/13338643>
DWARF with .o files now uses 40-60% less memory!

Big fixes include:
- Change line table internal representation to contain "file addresses". Since each line table is owned by a compile unit that is owned by a module, it makes address translation into lldb_private::Address easy to do when needed.
- Removed linked address members/methods from lldb_private::Section and lldb_private::Address
- lldb_private::LineTable can now relink itself using a FileRangeMap to make it easier to re-link line tables in the future
- Added ObjectFile::ClearSymtab() so that we can get rid of the object file symbol tables after we parse them once since they are not needed and kept memory allocated for no reason
- Moved the m_sections_ap (std::auto_ptr to section list) and m_symtab_ap (std::auto_ptr to the lldb_private::Symtab) out of each of the ObjectFile subclasses and put it into lldb_private::ObjectFile.
- Changed how the debug map is parsed and stored to be able to:
    - Lazily parse the debug map for each object file
    - not require the address map for a .o file until debug information is linked for a .o file

llvm-svn: 176454
2013-03-04 21:46:16 +00:00
Han Ming Ong 8764fe7d9a <rdar://problem/13338758>
Make it configurable what to profile.
For Mac, we don't use the dirty page size yet and hence there is no need to gather that. This should be way better in not draining the battery since we are operating between 0% to 0.1% on the Mac after this change.

llvm-svn: 176451
2013-03-04 21:25:51 +00:00
Enrico Granata c1a5b2eba8 <rdar://problem/12897838>
Making sure we do not try to copy memory at address 0 - that would make us crash

llvm-svn: 176438
2013-03-04 17:20:57 +00:00
Jason Molenda 503d018111 ProcessMachCore had (until 2013-01-29) some simple checks to find a kernel
in a core file if it didn't start at the beginning of a memory segment.
I added more sophisticated kernel location code to DynamicLoaderDarwinKernel
and removed the simple one in ProcessMachCore.  Unfortunately the kernel
DynamicLoader doesn't get a chance to search around in memory unless there's
a hint that this might be a kernel debug session.  It was easy ot make the
kernel location code static in DynamicLoaderDarwinKernel and call it from
ProcessMachCore on the start of the session, so that's what I did.
<rdar://problem/13326647> 

llvm-svn: 176405
2013-03-02 07:19:32 +00:00
Jim Ingham 0f063ba6b4 Convert from the C-based LLVM Disassembler shim to the full MC Disassembler API's.
Calculate "can branch" using the MC API's rather than our hand-rolled regex'es.
As extra credit, allow setting the disassembly flavor for x86 based architectures to intel or att.

<rdar://problem/11319574>
<rdar://problem/9329275>

llvm-svn: 176392
2013-03-02 00:26:47 +00:00
Jim Ingham 0943792a65 Move m_destroy_in_process to Process (from ProcessKDP) since it is generally useful,
and use it to keep from doing the OS Plugin UpdateThreadList while destroying, since
if that does anything that requires the API lock it may deadlock against whoever is
running the Process::Destroy.

<rdar://problem/13308627>

llvm-svn: 176375
2013-03-01 20:04:25 +00:00
Daniel Malea 9e84eb41f6 Add a test case for static member variables
- expected to fail across the board due to llvm.org/pr15401

Patch by Ashok Thirumurthi!

llvm-svn: 176362
2013-03-01 18:25:42 +00:00
Matt Kopec 66fd4b1ab9 Fix string warning I introduced with indirect function support.
llvm-svn: 176360
2013-03-01 17:44:31 +00:00
Matt Kopec c51b243a43 Update TestCallStdStringFunction to expected fail for gcc and account for multiple breakpoint locations.
Patch from Ashok Thirumurthi.

llvm-svn: 176357
2013-03-01 17:29:16 +00:00
Jason Molenda ce62fd72f6 Patch from Andrew Fish to add recognition of some additional
KDP packets.

llvm-svn: 176319
2013-03-01 00:43:19 +00:00
Jason Molenda bd2d88d60f Add the standard LLVM copyright notice to the top of
these two new files.

llvm-svn: 176312
2013-03-01 00:11:36 +00:00
Jason Molenda 732238cdd7 Report the kernel slide when attaching to a darwin kernel debug session.
llvm-svn: 176311
2013-03-01 00:06:37 +00:00
Daniel Malea 931b17c705 Finish up CMake support for LLDB (tested on Linux)
- add missing scripts (driver, tests, etc...)
- enable running of tests from cmake with "make check-lldb" target
- fix up problem with clang dependencies (this enables parallel builds)
- implement platform-specific FIXMEs in source/CMakeLists.txt

llvm-svn: 176306
2013-02-28 23:11:46 +00:00
Enrico Granata 7e0db2a24b Use the Error parameter in ValueObject::ReadPointedString to actually report common errors
llvm-svn: 176302
2013-02-28 22:01:33 +00:00
Jim Ingham d9916eaecc breakpoint command add currently doesn't support adding commands to more than one breakpoint
at a time.  Enforce this for now (we should relax the requirement when we have a little more time.)

<rdar://problem/13314462>

llvm-svn: 176291
2013-02-28 19:30:07 +00:00
Greg Clayton e595c6bf3c Replace all "-gdwarf-2" with "-g" to use the compiler defaults.
llvm-svn: 176283
2013-02-28 18:47:39 +00:00
Greg Clayton e6be63944e Fix the getCompilerVersion() function to do the right thing with clang 5.0 which now says "LLVM version" instead of "clang version".
llvm-svn: 176282
2013-02-28 18:46:31 +00:00
Greg Clayton 0d5911cbe9 Fixed an issue where the LDFLAGS were not correctly gettting modified to be additive.
llvm-svn: 176281
2013-02-28 18:45:39 +00:00
Greg Clayton 7170f3fc54 Made lldb.cpp build with clang 5.0.
Also removed the use of llvm::raw_string_ostream as it wasn't needed. 

Also fixed a crasher that could occur when the following line returned a C string tied to a local variable:

    return OS.str().c_str();

I am guessing "static std::string buf;" was supposed to get assigned to "OS.str()" and then have "buf.c_str()" returned. 

Modified the non-apple version code to cache its value and not recompute the version every time.

llvm-svn: 176274
2013-02-28 18:09:18 +00:00
Daniel Malea bdf7d83ac4 Update CMakeLists.txt as per removed file
llvm-svn: 176269
2013-02-28 16:53:22 +00:00
Daniel Malea 3b92f0095e Remove LLDB dependency on xcodeworkspace (on Linux) for version number
- make LLDB version number match Clang (and the Debian package)
- use the same revision detection magic that Clang uses to report SVN/Git revisions
- update test case as per above

Example output:

  $ lldb -v
  lldb version 3.3 (https://dmalea@llvm.org/svn/llvm-project/lldb/trunk revision 176211 clang revision 176208 llvm revision 176208)
ss

This line, and those below, will be ignored--

M    source/lldb.cpp
M    test/help/TestHelp.py
M    source/Makefile

llvm-svn: 176268
2013-02-28 16:51:15 +00:00
Jason Molenda d676074d8f Add the libdebugserver.cpp for creating a library that does debugserver
work.  There isn't any target in the xcode project file which will build
this yet.

llvm-svn: 176234
2013-02-28 04:25:38 +00:00
Sean Callanan 933ca2e2ea Fixed some problems with type deportation:
- made sure we tell Clang not to try to
    complete the type since it can't be
    completed from its origin any more; and

  - fixed a silly bug where we tried to
    forget about the original decl's origins
    rather than the deported decl's origin.

These produced some crashes in ptr_refs,
especially under libgmalloc.

<rdar://problem/13256150>

llvm-svn: 176233
2013-02-28 03:12:58 +00:00
Enrico Granata 1ddbd8a68b Fixing the log line for SBValue::MightHaveChildren() to report the correct function name
llvm-svn: 176232
2013-02-28 02:26:12 +00:00
Enrico Granata 0a2df227fc the log entry for SBThread::GetProcess() would not include the pointer to the process because we were using the value of the (otherwise unused) process_sp - instead of fetching the SP from sb_process
llvm-svn: 176231
2013-02-28 02:18:49 +00:00
Greg Clayton 8571963a7c Fixed a case where the result of std::string's c_str() method was being called on a local variable and returned as a const char * incorrectly. We used to cache the thread names for threads in the current host process, but we shoudn't be caching that as the names can change over time, so now a std::string is returned from Host::GetThreadName().
llvm-svn: 176217
2013-02-27 22:51:58 +00:00
Greg Clayton 059f724170 Added eSymbolTypeResolver to a few switch statements that needed it.
llvm-svn: 176210
2013-02-27 21:16:04 +00:00
Matt Kopec 00049b8b96 Add GNU indirect function support in expressions for Linux.
llvm-svn: 176206
2013-02-27 20:13:38 +00:00
Jim Ingham 1fd0705904 Call Process::Finalize directly in Debugger::Destroy, rather than having it done
in the Process destructor.  Doing it there can be too late depending on what the internal state
and ProcessGDBRemote Async threads are doing.

<rdar://problem/13297536>

llvm-svn: 176203
2013-02-27 19:13:05 +00:00
Daniel Malea 0aea016b06 Cleanup TestUniqueTypes.py and add getCompilerVersion() to test harness
- pull up logic to get compiler version from TestUniqueTypes.py into lldbtest.py
- work around an GCC 4.6.3 issue

llvm-svn: 176190
2013-02-27 17:29:46 +00:00
Jason Molenda 38e70d11c3 When starting a kernel debug session, if the user specified an executable
binary to lldb already check that the UUID of that binary and the UUID of
the kernel binary in memory match.  Warn if they don't.
<rdar://problem/13184784> 

llvm-svn: 176160
2013-02-27 03:07:49 +00:00
Enrico Granata d7ac9816eb <rdar://problem/13289828>
Categories were conceptually meant to be placeable on test methods as well as test classes and test directories
However, that was broken. This checkin fixes that.
The incantation required to put categories on individual test case methods is not exactly elegant, unfortunately:

def test_case(self):
    """Test me."""
    self.do_it()

def _test_case_get_categories(self):
    return ["demo"]

test_case.getCategories = _test_case_get_categories
del _test_case_get_categories

llvm-svn: 176158
2013-02-27 02:37:12 +00:00
Jason Molenda 07c446baf4 Fix one remaining mach port number/globally unique thread ID mixup which prevented queue names
from being fetched correctly.  <rdar://problem/13290877> 

llvm-svn: 176141
2013-02-26 23:58:00 +00:00