Commit Graph

6614 Commits

Author SHA1 Message Date
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
Greg Clayton e528efd734 <rdar://problem/13287629>
Fixed an issue with clang 500's new way to represent static class variables where it emits a DW_TAG_member with a DW_AT_external(0x01) attribute and no DW_AT_data_member_location.

llvm-svn: 176140
2013-02-26 23:45:18 +00:00
Jim Ingham 344d36aa9f Mark a few more tests as "basic_process".
llvm-svn: 176132
2013-02-26 22:51:48 +00:00
Daniel Malea 4dfd057e44 Add links to buildbots on the LLDB build instructions page
llvm-svn: 176126
2013-02-26 21:41:55 +00:00
Greg Clayton 5e3e1499c0 Backed out a hacky fix that is no longer needed.
llvm-svn: 176106
2013-02-26 17:59:39 +00:00
Greg Clayton 5d650c6aed A quick variable rename Sean and I had discussed earlier to make things a bit clearer.
llvm-svn: 176071
2013-02-26 01:31:37 +00:00
Sean Callanan 2367f8a788 Fixed several problems with class uniq'ing in the
SymbolFileDWARF code:

  - If a class is being uniqued to another copy of itself
    and the method lists don't match exactly, take a slow
    path and at least unique the methods that they have
    in common.

  - Sort name_to_die maps before querying them.  This
    would otherwise result in uniquing failures because
    looking up a name in a map that contains it would
    often fail.

  - Tolerate classes in other symbol files in the case
    of debugging with .o files rather than with a
    .dSYM.  We used to assume that the classes being
    uniqued were in the same symbol file, causing
    unpredictable results.

This will dramatically reduce the number of cases where
a function does not have a valid DeclContext.

<rdar://problem/12153915>

llvm-svn: 176067
2013-02-26 01:12:25 +00:00
Enrico Granata 11080005e8 Removing leftover printf() statement
llvm-svn: 176065
2013-02-26 00:28:02 +00:00
Jason Molenda 4da2e32fbb If the user has disabled kext loading with the
plugin.dynamic-loader.darwin-kernel.load-kexts setting, don't print
any messages about loading the kexts (which isn't being done) and
don't read the Mach-O headers out of memory (which can be slow and
they're not being used for anything at this point).

llvm-svn: 176064
2013-02-26 00:26:47 +00:00
Greg Clayton fac989114f <rdar://problem/13289157>
Set the exception breakpoints more efficiently by specifying two module basenames as module filters for Apple vendor targets.

llvm-svn: 176063
2013-02-26 00:21:38 +00:00
Han Ming Ong f4124aea41 <rdar://problem/13282582>
Really don't call sysctl again when we already have the result.

llvm-svn: 176062
2013-02-26 00:04:29 +00:00
Jim Ingham d882998eff Fix the .categories, it had "dataformatter" not "dataformatters".
Remove the getCategory from TestDataFormatterObjC.py, since it was superceded by the .categories file, 
and didn't work anyway (getCategories currently has to be a method on the test class, not on the test.)
Add a "basic_process" category, and start to find some tests for simple process running sniff tests.

llvm-svn: 176061
2013-02-25 23:51:06 +00:00
Enrico Granata 6308f58254 Being explicit about how ignoring optparse's exceptions is not a best principle
llvm-svn: 176059
2013-02-25 23:01:08 +00:00
Greg Clayton 006c1d1d49 <rdar://problem/13281528>
Fixed issues with the SBModule "sections" property, and with the SBBlock "ranges" attributes.

llvm-svn: 176051
2013-02-25 21:53:07 +00:00
Greg Clayton fdc2515ce9 Added missing lldb module namespace.
llvm-svn: 176049
2013-02-25 21:20:59 +00:00
Daniel Malea 90f3ebc602 Skip test that fails intermittently with Clang/GCC on Linux
- was causing buildbot failures due to unexpected pass

llvm-svn: 176048
2013-02-25 20:54:19 +00:00
Enrico Granata a221e4e89c Optimization of the code-running NSDictionary formatter to skip runtime symbol fetching
llvm-svn: 176041
2013-02-25 19:44:39 +00:00
Greg Clayton 59c40ff3f9 <rdar://problem/13286937>
Make sure to not look in self.images when we have a symbolicator with a live process.

llvm-svn: 176040
2013-02-25 19:34:57 +00:00
Jim Ingham e2ff0ba20d Add a log line when debugserver exits, and clean up some of the other standard logs output to make it more useful.
llvm-svn: 176039
2013-02-25 19:31:37 +00:00
Han Ming Ong c73f9c5d89 <rdar://problem/13282582>
Need available CPU on target device to support CPU reporting.

llvm-svn: 176008
2013-02-25 05:41:42 +00:00
Greg Clayton 72310355ff <rdar://problem/13265297>
StackFrame assumes m_sc is additive, but m_sc can lose its target. So now the SymbolContext::Clear() method takes a bool that indicates if the target should be cleared. Modified all existing code to properly set the bool argument.

llvm-svn: 175953
2013-02-23 04:12:47 +00:00
Jason Molenda e9ca4af4c8 Fix a handful of remaining assumptions that thread IDs were 32-bits
in the gdb-remote Process plugin files.

llvm-svn: 175947
2013-02-23 02:04:45 +00:00
Enrico Granata 2b3a0c4bcf This should get clang/gcc decorators working
llvm-svn: 175946
2013-02-23 01:35:21 +00:00
Enrico Granata 43f6213352 Fixing issues in previous checkin - still figuring out how to make expectedFailureClang take the bugnumber
llvm-svn: 175945
2013-02-23 01:28:30 +00:00
Dmitri Gribenko 3573f4ce8e Remove no-op code (since r175842)
llvm-svn: 175944
2013-02-23 01:20:07 +00:00
Enrico Granata e6cedc1296 <rdar://problem/12362092>
The decorators @expectedFailure (plain and special-case like i386, clang, ...) are modified to optionally take a bugnumber argument
If such an argument is specified, the failure report (or unexpected success report) will include the information passed in as part of the message
This is mostly useful for associating failures to issue IDs in issue management systems (e.g. the LLVM bugzilla)

llvm-svn: 175942
2013-02-23 01:05:23 +00:00
Han Ming Ong 6533a765b0 <rdar://problem/13277100>
Need host_statistics on profile data to get host's user/system/idle clicks

llvm-svn: 175928
2013-02-22 23:26:59 +00:00
Jim Ingham d1715e1425 Correct the logic in DumpCommandHistory when the end index is UINT32_MAX.
<rdar://problem/13270229>

llvm-svn: 175927
2013-02-22 23:23:42 +00:00
Jim Ingham c46fe7c0d1 Call el_resize when the window size changes.
<rdar://problem/13270100>

llvm-svn: 175926
2013-02-22 22:56:55 +00:00
Greg Clayton 3f875c589f <rdar://problem/13190981>
Fixed an issue where if we got a 'A' async packet back from debugserver, we would resend the last continue command. We now correctly identify the packet as async (just like the 'O' stdout async packet) and we don't resend the continue command.

llvm-svn: 175924
2013-02-22 22:23:55 +00:00
Jim Ingham 9b620f341a The thread plans run before the event is broadcast, so they should be calling ShouldStopSynchronous on any Stop Info's
they want to check.  The full ShouldStop should only be called on the public side of the event system.

llvm-svn: 175922
2013-02-22 21:23:43 +00:00
Daniel Malea da6921eb55 Mark last known Linux failure as XFAIL to see if there's any other problems with buildbots.
llvm-svn: 175917
2013-02-22 20:23:34 +00:00
Enrico Granata c358da2f4b If we crash while making a Python summary, the crash info will tell us more about it
llvm-svn: 175915
2013-02-22 20:01:15 +00:00
Jason Molenda e6539091a5 Remove unintended comment.
llvm-svn: 175873
2013-02-22 08:16:09 +00:00
Jason Molenda 1c73911d42 Change debugserver from using the mach port number (in debugserver's
own port namepsace) as the thread identifier to using the system-wide
globally unique thread id as the thread identifier number.

MachThread.cpp keeps both the unique id and the mach port number
for each thread.  All layers outside MachThread class use the unique
id with three exceptions: (1) Mach exceptions come in with the port
number (thread_port) which needs to be translated, (2) any calls to
low-level thread_get_state/thread_set_state/thread_suspend etc need
to use the mach port number, (3) MachThreadList::UpdateThreadList 
which creates the MachThread objects gets the unique id and passes
it to the MachThread ctor as an argument.

In general, any time nub_thread_t is used, it is now referring to a
unique thread id.  Any time a thread_t is used, it is now referring
to a mach port number.  There was some interchangability of these 
types previously.  nub_thread_t has also been changed to a 64-bit
type which necessitated some printf specification string changes.

I haven't been able to test these changes extensively yet but want
to checkpoint the work.  The scenarios I've been testing are all
working correctly so while there may be some corner cases I haven't
hit yet, I think it is substantially correct.

<rdar://problem/12931414> 

llvm-svn: 175870
2013-02-22 07:27:08 +00:00
Enrico Granata cd4218f5c1 Using __package__ and __name__ seems redundant - __name__ should always contain the fully qualified module name
llvm-svn: 175856
2013-02-22 02:21:10 +00:00
Enrico Granata fde419277b Fixing the watchpoint test case to reflect changes in error reporting
llvm-svn: 175845
2013-02-22 00:44:16 +00:00
Daniel Malea c9a0ec3e28 Make the lldbtest tear down routine a little less error prone
- replace "catch-all" except clause with one that specifically catches what pexpect throws
- handle case where child is already terminated (or is terminating) by the time tear-down is run

llvm-svn: 175844
2013-02-22 00:41:26 +00:00
Enrico Granata 2fb7c441d3 Ignore the check for com.apple.main-thread - it is not critical for the test case's logic
llvm-svn: 175842
2013-02-22 00:39:53 +00:00
Enrico Granata 0337c27fcd The summary for const char* was not cascading.
This was preventing us from providing a summary for the result of std::string.c_str() with libc++

llvm-svn: 175841
2013-02-22 00:37:31 +00:00
Enrico Granata 951462911d If the inferior program is compiled with libc++, you won't see libstdc++
llvm-svn: 175832
2013-02-21 23:59:42 +00:00
Enrico Granata d2f16e2c2d <rdar://problem/13265017>
The notion of Crossref command has long been forgotten, and there is nothing using CommandObjectCrossref in the current LLDB codebase
However, this was causing a conflict with process plugins and command aliases ending up in an infinite loop under situations such as:
(lldb) command alias monitor process plugin packet monitor
(lldb) process att -n Calendar
Process 28709 stopped
Executable module set to "/Applications/Calendar.app/Contents/MacOS/Calendar".
Architecture set to: x86_64-apple-macosx.
(lldb) command alias monitor process plugin packet monitor

This fixes the loop (and consequent crash) by disposing of Crossref commands and related code

llvm-svn: 175831
2013-02-21 23:57:25 +00:00
Matt Kopec 676a48751d Fix clang warnings related to python macro redefinition and printf format specifiers.
llvm-svn: 175829
2013-02-21 23:55:31 +00:00
Andrew Kaylor cd5c7247ab Change to JITDefault code model for ELF targets
On x86-64 platforms, the small code model assumes that code will be loaded below the 2GB boundary.  With the static relocation model, the fact that the expression code is initially loaded (in the LLDB debugger address space) above that boundary causes problems.  Switching to the JITDefault code model causes the large code model to be used for 64-bit targets and small code model of 32-bit targets.

llvm-svn: 175828
2013-02-21 23:45:19 +00:00
Daniel Malea fde7df5e7d Fix TestPublicAPIHeaders test on machines that have [DY]LD_LIBRARY_PATH that must be preserved.
llvm-svn: 175822
2013-02-21 23:07:30 +00:00
Daniel Malea d6c8f2b6bf Update INSTALL.txt to mention LLDB builds on Linux with GCC or Clang.
llvm-svn: 175816
2013-02-21 22:37:18 +00:00