Commit Graph

6614 Commits

Author SHA1 Message Date
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
Enrico Granata 5251e573d1 Previous commit was bogus (testing)
llvm-svn: 175811
2013-02-21 22:17:45 +00:00
Enrico Granata f169fc296a (no commit message)
llvm-svn: 175810
2013-02-21 22:17:14 +00:00
Daniel Malea a20e28daff Mark test as expected-to-fail with GCC because some versions emit DWARF that claims
functions start at the line with the "{" character, whereas clang uses the first line
with source code. As such, this test case will only work with clang.

llvm-svn: 175808
2013-02-21 22:15:52 +00:00
Sean Callanan d4fac256b0 Hardening in case a thread's frames are missing.
<rdar://problem/13254824>

llvm-svn: 175806
2013-02-21 22:01:43 +00:00
Daniel Malea c6301bfafb Skip another two test cases on Linux that are affected by llvm.org/pr14637
llvm-svn: 175801
2013-02-21 21:38:27 +00:00
Daniel Malea d82ac9e769 Fix CommandObjectMultiword to initialize all members, and beef up corresponding test case.
llvm-svn: 175798
2013-02-21 21:18:07 +00:00
Daniel Malea b29cf48e56 Update CMake lists of sources to include files added in r175787 and r175323
llvm-svn: 175797
2013-02-21 21:16:52 +00:00
Daniel Malea 23720cc66c Adding CMake build system to LLDB. Some known issues remain:
- generate-vers.pl has to be called by cmake to generate the version number
- parallel builds not yet supported; dependency on clang must be explicitly specified

Tested on Linux.
- Building on Mac will require code-signing logic to be implemented.
- Building on Windows will require OS-detection logic and some selective directory inclusion

Thanks to Carlo Kok (who originally prepared these CMakefiles for Windows) and Ben Langmuir
who ported them to Linux!

llvm-svn: 175795
2013-02-21 20:58:22 +00:00
Sean Callanan f4be227dc6 Fixed a case where a stack frame could lose track
of its own target.

<rdar://problem/13121412>

llvm-svn: 175794
2013-02-21 20:54:33 +00:00
Enrico Granata 87f00b43ab Cleanup of the NSString data formatter
llvm-svn: 175792
2013-02-21 20:31:18 +00:00
Enrico Granata ea2bc0fb1f <rdar://problem/4529976>
Adding data formatters for iterators for std::map and std::vector (both libc++ and libstdcpp)
This does not include reverse iterators since they are both trickier (due to requirements the standard imposes on them) and much less useful

llvm-svn: 175787
2013-02-21 19:57:10 +00:00
Jim Ingham 6c00a01526 Mark the command as failed if parsing fails.
llvm-svn: 175776
2013-02-21 18:38:46 +00:00
Han Ming Ong 0137455fab <rdar://problem/13259230>
Remember to set m_profile_thread to NULL once the profile thread is turned off.

llvm-svn: 175761
2013-02-21 16:31:31 +00:00
Jim Ingham dff9587640 Add some documentation on how HandleCommand work.
llvm-svn: 175717
2013-02-21 03:17:20 +00:00
Enrico Granata a6db933979 If you say
(lldb) frame variable
without first launching the inferior, you get:
error: invalid frame

this is misleading and should probably hint that there is no process. Adding this flag makes sure that we get:
error: invalid process

The difference between eFlagRequiresProcess and eFlagProcessMustBeLaunched is an open question.

llvm-svn: 175702
2013-02-21 01:29:04 +00:00
Sean Callanan b45a6f065e Fixed a bug where certain vector code didn't
work on i386.  Now we let the JIT emit SSE/SSE2
instructions on i386.

<rdar://problem/13240476>

llvm-svn: 175700
2013-02-21 01:04:23 +00:00
Jason Molenda 279c196d84 *ahem* Enrico.
llvm-svn: 175691
2013-02-20 23:51:13 +00:00
Jim Ingham 04c1de182b Mention "return" -> "thread return"
llvm-svn: 175689
2013-02-20 23:38:37 +00:00
Andrew Kaylor 2ed4dc9f27 Change ELF relocation model to static
llvm-svn: 175671
2013-02-20 21:39:02 +00:00
Daniel Malea 64c2e69809 Add logging of which test cases are run (through dosep) to help diagnose any hangs/crashes in the buildbots.
llvm-svn: 175669
2013-02-20 21:31:47 +00:00
Daniel Malea c6a70063cb Fix invalid TestBitfields case (thanks Filipe!), and xfail one case due to GCC compiler bug.
Turns out unnamed bit fields should not be accessed ever in C (C99 section 4.7.8) or C++
(C++11 section 9.6). 

Unrelated to the above, this commit marks TestBitfields as expected-to-fail with GCC as 4.7
has problems with padding... the size of the struct with a uint32_t member is reported as 12
when GCC is used. Clang emits correct code.

Parts of this patch prepared by Filipe Cabecinhas!

llvm-svn: 175666
2013-02-20 21:11:20 +00:00
Daniel Malea 7932c232bd Skip TestCompletion case that fails on linux (with gcc) because the input prompt is not displayed (llvm.org/pr14637)
llvm-svn: 175665
2013-02-20 20:58:20 +00:00
Matt Kopec 93ee88179b Fix TestPublicAPIHeaders test on Linux.
-Change the build_dir variable name to lib_dir
 -Set lib_dir to the correct location on Linux
 -Set LD_EXTRAS to the actual lldb library

llvm-svn: 175664
2013-02-20 20:54:10 +00:00
Jim Ingham dffa9773ce Handle the case where the runtime uses class_getMethodImplementation for both scalar and structure
return methods.

rdar://problem/13238168

llvm-svn: 175662
2013-02-20 20:35:38 +00:00
Daniel Malea fce7f1f434 Fix a bug that causes dotest.py to exit with a passing exit-code, even if some tests fail
- occurs when multiple compilers/architectures are tested (via -C or -A flags)

llvm-svn: 175656
2013-02-20 20:12:11 +00:00
Daniel Malea 294c5e1cc3 Fix a problem with the const_variables test case (another lldb bug remains)
- make the test case step past the location where 'index' is initialized, otherwise its value cannot be printed (verified gcc 4.6/4.7 and recent clang)
- "Couldn't materialize struct" error from LLDB still prevents this test case from passing

llvm-svn: 175653
2013-02-20 19:41:49 +00:00
Enrico Granata e5631635bf Lastly, a few synthetic children classes for Cocoa are available
llvm-svn: 175591
2013-02-20 02:27:07 +00:00
Enrico Granata 710d88fd64 And the NSString formatter is not Python anymore
llvm-svn: 175590
2013-02-20 02:24:20 +00:00
Enrico Granata df21e40f94 Data formatters are not a *recent* addition...
llvm-svn: 175589
2013-02-20 02:22:00 +00:00
Enrico Granata 9d6f7037ba Fixing a potential crasher where a synthetic value could return itself as its static value
llvm-svn: 175574
2013-02-19 23:23:41 +00:00
Jim Ingham 11b0e05490 If RunThreadPlan is called on a thread that doesn't have a selected frame, select frame 0.
<rdar://problem/13093321>

llvm-svn: 175573
2013-02-19 23:22:45 +00:00
Enrico Granata 4af6bf63ca <rdar://problem/13147878>
Be more user-friendly about not having scripting enabled:
a) if Python was built-out then tell people about it explicitly
b) if we are told to use none as a scripting language, then tell people about that too

This should limit the cases where the semi-cryptic error message "there is no embedded script interpreter in this mode." actually shows

llvm-svn: 175570
2013-02-19 22:34:01 +00:00
Enrico Granata 4c5b3f7df6 ValueObjectSynthetic could be wrapping a ValueObjectDynamic. In that case, we want to report that the ValueObject is dynamic since synthetic values are supposed to be just their parent with different children
llvm-svn: 175563
2013-02-19 22:03:00 +00:00
Jim Ingham 64ce7f4303 Make the progress bar opt in (using the -P option.)
llvm-svn: 175557
2013-02-19 20:39:27 +00:00
Daniel Malea 5b7c14b3c8 A few more GCC specific test fixes as per logged PRs:
- TestNamespace expected to fail due to PR-15302
- TestCPPBool and TestUnsignedTypes updated to handle GCC style debug information
- TestRvalueReferences expected fail due to GCC (4.7) not outputting rvalue-reference debug information
- TestDataFormatterStdVBool expected to fail due to PR-15301

llvm-svn: 175551
2013-02-19 19:54:16 +00:00
Daniel Malea d6915b42ff Fix Makefile bug preventing tests from running when building lldb with ccache
llvm-svn: 175547
2013-02-19 19:31:05 +00:00
Sean Callanan 37f76e53d7 Updated to support latest Clang option naming.
llvm-svn: 175546
2013-02-19 19:16:37 +00:00
Matt Kopec 6e9b7fc802 Add i386 register support for the x86_64 RegisterContext plugin. This allows debugging a 32-bit inferior on 64-bit lldb/host.
llvm-svn: 175543
2013-02-19 19:06:16 +00:00
Daniel Malea 249287afde Minor test runner improvemenst
- rework the way SBDebugger.SetAsync() is used to avoid side effects (reset original value at TearDownHook)
- refactor expectedFailureClang (and add expectedFailureGcc decorator)
- mark TestChangeValueAPI.py as expectedFailureGcc due to PR-15039

llvm-svn: 175523
2013-02-19 16:08:57 +00:00
Daniel Malea a9b732a32a Update TestVBool Makefile to allow building test program with gcc
- do not pass (incompatible option) -stdlib=libstdc++ option if using GCC as test compiler

llvm-svn: 175522
2013-02-19 15:53:47 +00:00
Daniel Malea 3eb9044f30 Update Makefile to use build-compiler (CC) for LLDB testing
- Should allow tests to run without 'clang' installed

llvm-svn: 175521
2013-02-19 15:48:37 +00:00
Jason Molenda a4d3e1d2a2 Fix a case where a kext module was being added to the Target
twice.

llvm-svn: 175496
2013-02-19 07:41:13 +00:00
Jason Molenda d76fb6ea12 Change the order that the DarwinKernel DynamicLoader plugin uses
to search for kexts on the local system -- the ModuleList FindModule()
method is the best first attempt, only call
Symbols::DownloadObjectAndSymbolFile() if that has failed and this
is the kernel binary which really needs to have its symbols located.

<rdar://problem/13241893> 

llvm-svn: 175495
2013-02-19 07:16:22 +00:00
Jason Molenda 56c23285f9 Experiment with printing a warning message when lldb is unable to
find a binary on the debugger-host during a kernel debug session
for a kernel extension (kext).  This may prove to be too verbose
in typical usage, particularly if there are many third-party kexts.
We'll try this and see how it works.

<rdar://problem/13080833> 

llvm-svn: 175494
2013-02-19 06:39:56 +00:00
Jason Molenda e575e7bce0 Always print the kernel UUID and load address if we are working with
a kernel binary - even if we can't find the symbol-rich binary or 
dSYM on the debugger-system.  Print a warning if the symbol-rich binary
cannot be located.  This more closely emulates the gdb behavior when
a kernel debug session failed to locate a kernel binary.

<rdar://problem/13016095> 

llvm-svn: 175491
2013-02-19 06:11:13 +00:00
Jason Molenda 306bd0aa74 Change the DarwinKernel DyanmicLoader to maintain a persist list
of kernel extensions (kexts) that have been loaded into the kernel.
Now when we hit the "kexts have changed" breakpoint we can avoid
adding kexts multiple times, and can properly detect kext unloads
and remove them from the Target's list of modules.

<rdar://problem/13107639>
<rdar://problem/13191016>

llvm-svn: 175489
2013-02-19 05:42:46 +00:00
Enrico Granata eac4a48d23 Fixing the lack of a space in an expression that was causing sheer unhappiness.
llvm-svn: 175478
2013-02-19 01:14:06 +00:00
Enrico Granata a5da2adc77 NSWindows should only be created after you have an NSApplication
llvm-svn: 175475
2013-02-19 00:39:59 +00:00
Enrico Granata 9f02e0912d <rdar://problem/12529957>
Synthetic children provider for NSSet

llvm-svn: 175468
2013-02-18 23:16:23 +00:00
Greg Clayton e3e3feea3c Added a host call to get the number of CPUs. It should work on all POSIX unixes, linux and Windows.
llvm-svn: 175405
2013-02-17 20:46:30 +00:00
Greg Clayton 8df92678a1 <rdar://problem/13121056>
Fixed a crasher when the ConnectionFileDescriptor was used in a process with over FD_SETSIZE (1024) files open. It would corrupt the stack and cause the stack checker to assert and kill the program.

The final fix was to "#define _DARWIN_UNLIMITED_SELECT" at the top of the one and only file that uses select () in the LLDB codebase and then make an array of "fd_set" objects so they can handle more than 1024 file descriptors. The new code can handle as many file descriptors as a process can create.    
    

llvm-svn: 175378
2013-02-16 22:53:04 +00:00
Greg Clayton e48310dc6b Added a kqueue class which isn't being used yet, but was part of trying to work around the limitations with the unix select() call and how it is limited to FD_SETSIZE file descriptors.
Also added a TimeSpecTimeout class which can be used with any calls that take a "struct timespec *" as an argument. It is used by the KQueue class.

Also updated some project settings.

llvm-svn: 175377
2013-02-16 22:46:58 +00:00
Filipe Cabecinhas 103e16e4cc Include a small argparse compatibility layer for Python < 2.7
llvm-svn: 175341
2013-02-16 09:05:23 +00:00
Greg Clayton 7a168161de Get rid of a warning.
llvm-svn: 175337
2013-02-16 01:47:52 +00:00
Enrico Granata f615b80d08 NSSet formatter is now C++ code
Split some NS* formatters in their own source files
Refactored a utility function for the C++ formatters to use
Fixed the skip-summary test case to be explicit about requiring libstdc++ for operation

llvm-svn: 175323
2013-02-15 23:38:37 +00:00
Sean Callanan c8675507aa Fixes in the IRInterpreter:
- removed an unnecessary variable
- fixed an issue where we sometimes
  wrote too much data into a buffer
- made the recognition of variables
  as "this" a little more conservative

<rdar://problem/13216268>

llvm-svn: 175318
2013-02-15 23:07:52 +00:00
Daniel Malea cbaef26678 Improve test harness for the buildbots
- Add a "parsable" mode to dotest.py that outputs test results in exactly the same format as clang's lit tests
- Improve dosep script to output list of failing tests (output should look like clang test failure summaries)
- Cleanup lldb/test/Makefile to remove needless parameters and environment variables
- Switch makefile tests to use parsable-mode output; should make the buildbot results parsable
- Switch makefile tests to use dosep to log catch crashing tests (instead of halting the test suite)

llvm-svn: 175309
2013-02-15 21:31:37 +00:00
Daniel Malea e78ecc2cc7 More test case cleanup (Linux and Mac):
- remove expectedFailure decorator from resolved rdar 12566646 and 10887661
- remove expectedFailure from TestBitfields testcase not actually affected by bug
- skip the (non-deterministic) TestStopHookMechanism.py to avoid a noisy suite on Linux

llvm-svn: 175307
2013-02-15 21:27:14 +00:00
Daniel Malea 2dd69bb5f2 Fix misuse of python subprocess module (caused "leaking" processes and garbling the terminal)
- fixed cleanup of Popen objects by pushing spawn logic into test Base and out of test cases
- connect subprocess stdin to PIPE (rather than the parent's STDIN) to fix silent terminal issue

Tested on Linux and Mac OS X

llvm-svn: 175301
2013-02-15 21:21:52 +00:00
Daniel Malea b7eec015d0 Rename [Enable|Disable]Breakpoint() to [Enable|Disable]BreakpointSite() in POSIX plugin
- needed due to r175241

llvm-svn: 175290
2013-02-15 20:23:25 +00:00
Daniel Malea 654b12c6a5 Linux test case cleanup:
- Enable TestFormatters.py: expressions with "new" work
- Enable TestChangeValueAPI.py: llvm.org/PR15039 fixed
- Disable expression_command/call-restarts due to llvm.org/PR15278
- Disable expression_command/call-throws due to ObjC test program

llvm-svn: 175287
2013-02-15 19:37:48 +00:00
Greg Clayton 79978fc0fc Added missing include.
llvm-svn: 175279
2013-02-15 17:44:31 +00:00
Filipe Cabecinhas 2f4ed2a8df Only enable RTTI for cxa_demangle.cpp
If testing on Linux+clang proves it needs RTTI, wa can remove the
conditionals.

llvm-svn: 175242
2013-02-15 02:36:40 +00:00
Jim Ingham 299c0c1c09 A little cleanup. {Disable/Enable}Breakpoint actually disables/enables BreakpointSites not breakpoints, it is confusing
to have it not named appropriately.  Also in StopInfoMachException, we aren't testing for software or not software, just
whether the thing is a breakpoint we set.  So don't use "software"...

llvm-svn: 175241
2013-02-15 02:06:30 +00:00
Enrico Granata 8628bc59e0 Daniel Malea caught an issue where calling dotest.py with an invalid directory would cause the progressbar init code to raise an exception
This commit fixes it

llvm-svn: 175229
2013-02-15 00:32:05 +00:00
Enrico Granata 75dfb43270 <rdar://problem/13204647>
The SEL data formatter was working hard to ensure that pointers-to-selectors could be formatted by the same block of code. In that effort, we were taking the address-of a SEL.
This operation fails when the SEL lives in a register, and was causing problems.
The formatter has been fixed to work correctly without assuming &selector will be a valid object.

llvm-svn: 175227
2013-02-15 00:06:04 +00:00
Daniel Malea 8d7b7a434a Fix TestSBData.py test case (tested fix Linux/Mac)
- stop ignoring the error-codes in the 'error' variable
- removed out-of-bounds accesses with read-only array fields such as:

  self.assertTrue(data2.uint8[6] == 0, 'binary 0 terminator')

Since SBData wraps a (6-character) python string literal, trying to read the
null-terminator raises an exception. Instead, I replaced the out-of-bounds
read with a length-check.

Other out-of-bounds reads (via accessor function like SBData.GetUnsignedInt8)
don't throw and are OK. I just added asserts that errors are set for these
negative cases.

llvm-svn: 175223
2013-02-14 23:38:33 +00:00
Filipe Cabecinhas 55fcb10542 Bring lldb up to date with clang revision 175141.
llvm-svn: 175213
2013-02-14 22:02:57 +00:00
Greg Clayton 790ecc01d7 <rdar://problem/13218655>
"target modules add" should resolve bundle executables, as should anything else that tries to create a module from a bundle path.

llvm-svn: 175210
2013-02-14 21:09:56 +00:00
Jim Ingham 6394479e4f One to many always's.
llvm-svn: 175202
2013-02-14 19:30:35 +00:00
Jim Ingham 719d2c9d36 Mention the inline-breakpoint-strategy in the lldb-gdb.html file.
llvm-svn: 175201
2013-02-14 19:17:49 +00:00
Greg Clayton 0ee809b71c <rdar://problem/13064893>
Poor network connections aren't handled well; commands fail instead of retrying.

llvm-svn: 175198
2013-02-14 19:11:23 +00:00
Jim Ingham 289aca642e Make it clear that if you #include .c/.cpp/.m/.mm etc files, you will have to
change the breakpoint-inline-strategy for the breakpoints to take.

<rdar://problem/13189024>

llvm-svn: 175197
2013-02-14 19:10:36 +00:00
Greg Clayton eee5e98658 <rdar://problem/12693921>
Rename the monitor command from "qCmd" (incorrect) to "qRcmd".

llvm-svn: 175191
2013-02-14 18:39:30 +00:00
Greg Clayton 25d5941e2a <rdar://problem/13207948>
"watchpoint set expression" fails if "--" is present without any option. Made this command match exactly what "expression" does.

llvm-svn: 175136
2013-02-14 04:15:23 +00:00
Greg Clayton 8938f8daf0 <rdar://problem/13200878>
When launching in the shell, make sure if you specify a relative path, and if the current working directory has a space in it, that we don't hose the shell invocation.

Currently if we launch with a relative path, we prepend the current working directory to the PATH using:

PATH=`cwd`:$PATH a.out ...

We needed to add quotes around the value for PATH to make sure if any paths in PATH contained spaces, that we don't hose the shell command. Now we do a:

PATH="`cwd`:$PATH" a.out ...

llvm-svn: 175135
2013-02-14 03:54:39 +00:00
Greg Clayton c5d33d8359 <rdar://problem/13198767>
When dumping instructions, resolve the address specified as a file address if the target doesn't have anything loaded.

llvm-svn: 175131
2013-02-14 03:26:35 +00:00
Jim Ingham 0ac5709027 Add a test for handling a function call that throws an exception, and make it work.
<rdar://problem/13183944>

llvm-svn: 175127
2013-02-14 03:05:42 +00:00
Jim Ingham 367efe7d34 Probably should return that value we took the trouble to compute.
llvm-svn: 175125
2013-02-14 03:04:50 +00:00
Daniel Malea 90e9fd9cbb Fix broken testcase: ignore LLDB output that warns about more elements than can be displayed.
- test could be re-written at some point, but right now just trying to clean up known failures for the linux buildbot.

llvm-svn: 175114
2013-02-14 00:30:40 +00:00
Daniel Malea e651aee927 Marking two tests expected-to-fail on Linux
- PR-15260: lldb does not display correct value of 1-bit field
- PR-16261: lldb does not display size of (file/class) static array

llvm-svn: 175111
2013-02-14 00:20:44 +00:00
Greg Clayton 399107a936 Centralized the expression prefixes that are used for both expressions and utility functions.
llvm-svn: 175108
2013-02-13 23:57:48 +00:00
Greg Clayton e40346050a A lot more cleanup on the AppleObjCRuntimeV2 class.
llvm-svn: 175106
2013-02-13 23:22:26 +00:00
Greg Clayton c03e3c198a Cleaned up and removed unused code.
llvm-svn: 175105
2013-02-13 23:09:45 +00:00
Matt Kopec 3c0ed76a9d Skip another two other tests asserting on Linux in RecordLayoutBuilder::updateExternalFieldOffset().
llvm-svn: 175103
2013-02-13 22:59:58 +00:00
Greg Clayton a66c4d96f0 <rdar://problem/13210494>
Parse objective C information as efficiently as possible and without taking dangerous runtime locks.

Reworked the way objective C information is parsed by:
1 - don't read all class names up front, this is about 500K of data with names
2 - add a 32 bit hash map that maps a hash of a name to the Class pointer (isa)
3 - Improved name lookups by using the new hash map
4 - split up reading the objc runtime info into dynamic and shared cache since the shared cache only needs to be read once.
5 - When reading all isa values, also get the 32 bit hash instead of the name
6 - Read names lazily now that we don't need all names up front
7 - Allow the hash maps to not be there and still have this function correctly

There is dead code in here with all of the various methods I tried. I want to check this in first to not lose any of it in case we need to revert to any of the extra code. I will promptly cleanup and commit again.

llvm-svn: 175101
2013-02-13 22:56:14 +00:00
Daniel Malea 5a52f2ec73 Skip test that causes lldb to assert due to inferior getting a SIGSEGV with si_code == SI_KERNEL (PR-15258)
- crash does not always reproduce

llvm-svn: 175095
2013-02-13 22:05:18 +00:00
Daniel Malea 5703bdcc49 Allow expression evaluation to work when multiple threads exist in the inferior (on Linux)
- handle m_resume_state == eStateStopped || eStateSuspended in DoResume rather than asserting

llvm-svn: 175094
2013-02-13 22:00:44 +00:00
Sean Callanan d7739824a6 Made NULL, nil, and Nil use the appropriate
builtins.

<rdar://problem/13204027>

llvm-svn: 175091
2013-02-13 21:53:01 +00:00
Andrew Kaylor b32581fe5c Improved handling for DW_AT_const_value
llvm-svn: 175071
2013-02-13 19:57:06 +00:00
Daniel Malea f406891857 Skip tests that assert on Linux in RecordLayoutBuilder::updateExternalFieldOffset()
- Filed bugzilla PR-15256

llvm-svn: 175065
2013-02-13 18:56:41 +00:00
Daniel Malea 52d0f40ad3 Disable TestConditionalBreak.py due to Linux crash
- test was passing before r174793...

llvm-svn: 175064
2013-02-13 18:55:17 +00:00
Greg Clayton 142c5a4f66 Quiet "the missing case in switch statement" warnings from newer clang builds.
llvm-svn: 175061
2013-02-13 18:15:56 +00:00
Daniel Malea 4d3c008c7d Fix document typos, indentation in python code, and API examples.
Patch by Bruce Mitchener!

llvm-svn: 175002
2013-02-12 20:01:49 +00:00
Greg Clayton faf6df6e6e Added new "env" regular expression alias into the evironment settings section of the GDB/LLDB commands.
llvm-svn: 174993
2013-02-12 18:54:34 +00:00
Greg Clayton ef5651d93f <rdar://problem/13178743>
Added a new "env" regular expression alias. If "env" is typed on its own "settings show target.env-vars" will be run. Otherwise it can be used to set and environment variable: "env FOO=BAR".

llvm-svn: 174991
2013-02-12 18:52:24 +00:00
Greg Clayton d901096345 <rdar://problem/13184389>
_regexp-list needs to treat "list -" as "source list -r"

llvm-svn: 174987
2013-02-12 18:42:05 +00:00
Matt Kopec 92dd5cfe04 Fix ELF parsing where undefined symbols were being added to the symbol table with the incorrect symbol type.
llvm-svn: 174984
2013-02-12 18:30:30 +00:00
Sean Callanan eeffea416b Made LLDB build with the latest Clang. This meant
changing the ClangASTSource to return a bool instead
of returning a list of results.  Our testsuite mostly
works with this change, but some minor issues may
remain both on LLDB's side and on Clang's side.

llvm-svn: 174949
2013-02-12 08:01:13 +00:00
Sean Callanan af77617b21 Fixed the way the ClangExpressionDeclMap looks
up variables in the current stack frame to avoid
mutual recursion between the expression parser
and the synthetic child providers.  Variables
should only be looked up in a very simple way,
using no synthetic anything.

<rdar://problem/13173454>

llvm-svn: 174947
2013-02-12 07:56:36 +00:00
Daniel Malea 69357ecb6d Minor update to Vim frontend: simplify breakpoints display (and list unresolved breakpoints)
llvm-svn: 174923
2013-02-12 00:31:40 +00:00
Jim Ingham 6ad180cf35 Forgot to add the testsuite for the changes I checked in on Friday.
llvm-svn: 174897
2013-02-11 19:05:29 +00:00
Daniel Malea ac4ce0cd4a Add Vim frontend to LLDB.
- Access any LLDB CLI command in Vim by typing ":L<command>". Tab-completion
  works too!
- See source locations for breakpoints and the current PC with vim "marks"
  and highlights.
- Examine backtraces, locals, disassembly, registers, and breakpoints in
  dedicated Vim windows.
- See when in-scope variables and registers change by watching for (red)
  highlights.

This plugin opens multiple Vim "windows" to display debugger information.
To quit all windows at the same time use ":qa". The alternative would be
":q" to close each window separately.

This plugin is known to work on Mac OS X (Mountain Lion) with MacVim and
the system-provided terminal Vim, and on Linux (Ubuntu 12.04 and 12.10)
with GVim and the terminal Vim from the "vim-gnome" package.

llvm-svn: 174892
2013-02-11 17:18:14 +00:00
Enrico Granata e1fb1654c8 Quick fix for the libc++ std::map synthetic children provider
If you try to access any child > 0 without having touched child 0, LLDB won't be able to reconstruct type information from the debug info.
Previously, we would fail.
Now, we simply go fetch child 0 and then come back.

llvm-svn: 174795
2013-02-09 01:44:23 +00:00
Jim Ingham 0161b49cba Reworked the way Process::RunThreadPlan and the ThreadPlanCallFunction interoperate to fix problems where
hitting auto-continue signals while running a thread plan would cause us to lose control of the debug 
session.

<rdar://problem/12993641>

llvm-svn: 174793
2013-02-09 01:29:05 +00:00
Enrico Granata eba9e4a3aa The new progress bar mode was losing us information compared to the old dots mode in that we would have no way of knowing about test failures (short of peeking into the test result directory.. and you're not supposed to peek!)
Added a new line of information that reports the count of tests that pass, fail or have other things happen to them.

Again no flag to have the dots back. If you care, let us know!

llvm-svn: 174784
2013-02-09 00:37:07 +00:00
Enrico Granata 27692bcf28 Fixing a logic flaw with NSURL summary. This was caught by running the test suite in 32bit mode
llvm-svn: 174778
2013-02-08 23:54:46 +00:00
Enrico Granata a94ee7da81 <rdar://problem/13176279>
The LLDB test suite now shows a progress bar instead of dots when not in verbose mode
If you crave the dots, make your Terminal window smaller than 10 columns :-)
(or ask for a flag to have the dots come back on demand)

llvm-svn: 174777
2013-02-08 23:39:18 +00:00
Sean Callanan 29214ab1ce Fixed a crash when we didn't get a plist but tried
to pass it to CFGetTypeID() anyway.

<rdar://problem/13181904>

llvm-svn: 174772
2013-02-08 23:17:17 +00:00
Greg Clayton 2452ab7fa8 Fixed 2 more issues found by the address sanitizer:
1 - A store off the end of a buffer in ValueObject.cpp
2 - DataExtractor had cases where bad offsets could cause invalid memory to be accessed.

llvm-svn: 174757
2013-02-08 22:02:02 +00:00
Greg Clayton aa4c47a5b1 Fixed a store to data that isn't needed and that also could end up writing beyond the end of the buffer. This was found by the address sanitizer.
llvm-svn: 174755
2013-02-08 21:59:34 +00:00
Greg Clayton 0dd5e7b598 Unset the environment variables as soon as possible when running the test suite. Also don't store the unset list into a global when they aren't needed in a global variable.
llvm-svn: 174750
2013-02-08 21:52:32 +00:00
Enrico Granata e214a024e0 This checkin implements the data formatter for NSURL in C++ code
llvm-svn: 174735
2013-02-08 19:28:04 +00:00
Greg Clayton 722e8851b1 Added the ability to specify a breakpoint using the GDB '*ADDRESS' format:
(lldb) b *0x1234

You can still of course just specify an address:

(lldb) b 0x1234

Also now we accept the '&' before function names to indicate to not to skip the function prologue like GDB supports. To see how this works:

(lldb) settings set interpreter.expand-regex-aliases 1
(lldb) b &main
breakpoint set --name 'main' --skip-prologue=0
Breakpoint 1: where = a.out`main at main.c:20, address = 0x0000000100000b60
(lldb) b main
breakpoint set --name 'main'
Breakpoint 2: where = a.out`main + 54 at main.c:21, address = 0x0000000100000b96

llvm-svn: 174695
2013-02-08 02:54:24 +00:00
Enrico Granata 5bfce363e1 <rdar://problem/12898191>
Added a summary for NSMutableAttributedString
In the process, converted formatters for other NSString-based classes over to C++ code

llvm-svn: 174693
2013-02-08 01:55:46 +00:00
Enrico Granata 08ec0b6117 Renaming SBValueList::get() to
opaque_ptr since it returns a void* instead of an usable object.

llvm-svn: 174673
2013-02-07 22:57:46 +00:00
Enrico Granata d96f0682e5 Correct logging for function calls that return SBValueList
llvm-svn: 174670
2013-02-07 22:22:27 +00:00
Greg Clayton 64ff6c70da Be sure to set the data offset to zero if we actually mmap the entire ELF file.
llvm-svn: 174668
2013-02-07 21:49:54 +00:00
Andrew Kaylor 213f6727c0 Fixing stale pointer problem in ELFObjectFile
llvm-svn: 174665
2013-02-07 21:30:54 +00:00
Enrico Granata 85425d77b8 <rdar://problem/13107151>
SBValueList was backed by a ValueObjectList. This caused us to lose track of the additional metadata in the ValueImpl that backs SBValue.
This checkin fixes that by backing SBValueList with ValueListImpl (that essentially wraps a vector<SBValue>).

llvm-svn: 174638
2013-02-07 18:23:56 +00:00
Greg Clayton 5c9737a5dd Address sanitizer found an issue which we filed a bug for: <rdar://problem/13168967>
llvm-svn: 174579
2013-02-07 03:41:30 +00:00
Greg Clayton f6cdd126e8 Fixed an bug found by running LLDB with the address sanitizer! We were accessing one past the end of the buffer.
llvm-svn: 174578
2013-02-07 03:38:34 +00:00
Greg Clayton cb9c8cf84c Be ready for fully qualified hash names in the __apples_types tables.
llvm-svn: 174558
2013-02-06 23:56:13 +00:00
Sean Callanan c3a1d5629a Fixed a problem that would cause LLDB to crash
if it encountered bad debug information.  This
debug information had an Objective-C method whose
selector disagreed with the true number of arguments
to that method.

<rdar://problem/12992864>

llvm-svn: 174557
2013-02-06 23:21:59 +00:00
Greg Clayton 1f380ea29a Removed debug print line I left in.
llvm-svn: 174556
2013-02-06 22:52:04 +00:00
Greg Clayton 5ce9c5657c <rdar://problem/13159777>
lldb was mmap'ing archive files once per .o file it loads, now it correctly shares the archive between modules.

LLDB was also always mapping entire contents of universal mach-o files, now it maps just the slice that is required.

Added a new logging channel for "lldb" called "mmap" to help track future regressions.

Modified the ObjectFile and ObjectContainer plugin interfaces to take a data offset along with the file offset and size so we can implement the correct caching and efficient reading of parts of files without mmap'ing the entire file like we used to.

The current implementation still keeps entire .a files mmaped (once) and entire slices from universal files mmaped to ensure that if a client builds their binaries during a debug session we don't lose our data and get corrupt object file info and debug info.

llvm-svn: 174524
2013-02-06 17:22:03 +00:00
Daniel Malea 0e1cf09c89 Fix bug in test harness to allow running dotest.py without "--executable" flag on Linux
- resolves errors in cases that run the lldb CLI utility

llvm-svn: 174522
2013-02-06 16:55:07 +00:00
Daniel Malea eed92fb10c Fix to build tests with GCC: update makefiles in two watchpoint testcases
llvm-svn: 174520
2013-02-06 16:51:24 +00:00
Daniel Malea 0b464d483b Fix GCC 4.6 build by avoiding delegating ctors
Patch by Abid Hafiz!

llvm-svn: 174519
2013-02-06 16:46:40 +00:00
Greg Clayton 906ba47143 <rdar://problem/11109570>
The first part of the fix for having LLDB handle LTO debugging when the DWARF is in the .o files. This part separates the object file's modules into a separate cache map that maps unique C strings for the N_OSO path to the ModuleSP since one object file might be mentioned more than once in LTO binaries.

llvm-svn: 174476
2013-02-06 00:38:25 +00:00
Greg Clayton 12ff126f04 Fixed the TestSourceManager.py test case to not fail. It was using the "list" alias which has now been turned into a regex command that mimics the GDB equivalent. Changed "list" to "source list" to get around this problem.
llvm-svn: 174474
2013-02-06 00:35:33 +00:00
Jason Molenda d34e652ef8 Change ObjectFileMachO::ParseSymtab to read the external
function stub routine addresses from an in-memory-only
MachO object file.  This was the only remaining part of
ParseSymtab() that was assuming a file exists.
<rdar://problem/13139585> 

llvm-svn: 174455
2013-02-05 22:31:24 +00:00
Enrico Granata cb9870dad8 Being explicit about which std c++ library these test cases need to use
llvm-svn: 174437
2013-02-05 20:05:31 +00:00
Greg Clayton 61f39ce8b8 <rdar://problem/12866706>
Removed asserts and replaced them with conditional code and appropriate errors that prompt for a bug to be filed.

llvm-svn: 174420
2013-02-05 18:40:36 +00:00
Jason Molenda 18257c4106 Remove the m_images(NULL) hack in the Target ctor now
that the original issue has been fixed by r174222.

llvm-svn: 174334
2013-02-04 23:30:05 +00:00
Enrico Granata 3b1b2dabda <rdar://problem/12953018>
Synthetic children and summary for std::vector<bool> (for both libcxx and libstdcpp).
std::vector<bool> is a special case and is custom-implemented to be a vector of bits, which means we failed to handle it with the standard std::vector<T> formatter.
This checkin provides custom formatters that work correctly

llvm-svn: 174333
2013-02-04 22:54:42 +00:00
Jason Molenda b9c9f9b200 Change CommandObjectTargetSymbolsAdd to require that a target exists;
fixes crash of the form

% lldb
(lldb) target symbols add /tmp/symbols.dSYM
(lldb) Killed: 9

<rdar://problem/13139481> 

llvm-svn: 174267
2013-02-02 06:00:36 +00:00
Greg Clayton 4edb7ab8b2 Added support for the qCmd monitor packet command. Currently it can only do:
set logfile=<path>
set logmask=<num>

But this opens the door for us to do much more.

llvm-svn: 174258
2013-02-02 01:13:48 +00:00
Enrico Granata 599171addf Moving from std::auto_ptr<char> to std::string for simple string memory management.
It is better practice and, also, it is not clear whether std::auto_ptr<> is smart enough to know about delete[] vs. delete

llvm-svn: 174236
2013-02-01 23:59:44 +00:00
Greg Clayton 6bade327dc <rdar://problem/13050227>
Added a regular expression command called "_regexp-list" which mimics the GDB "line" command in the following forms:

LINENUM, to list around that line in current file,
FILE:LINENUM, to list around that line in that file,
FUNCTION, to list around beginning of that function,
*ADDRESS, to list around the line containing that address.
ADDRESS, same as above, but don't require a '*' as long as ADDRESS is hex

llvm-svn: 174233
2013-02-01 23:33:03 +00:00
Greg Clayton ba4a0a5db5 <rdar://problem/12693921>
Added the ability to send monitor command to the remote GDB server with "process plugin packet monitor".

llvm-svn: 174231
2013-02-01 23:03:47 +00:00
Greg Clayton f5fc08445f <rdar://problem/13130975>
Class global variables were not being linked correctly when debugging with DWARF in .o files.

llvm-svn: 174227
2013-02-01 22:08:49 +00:00
Greg Clayton 39f7ee86c8 <rdar://problem/13092722>
Fix in loading mach files from memory when using DynamicLoaderMacOSXDYLD.

Removed the uuid mismatch warning that could be spit out and any time during debugging and removed the test case that was looking for that. Currently the "add-dsym" or "target symbols add" command will report an error when the UUID's don't match.

Be more careful when checking and resolving section + offset addresses to make sure none of the base addresses are invalid.

llvm-svn: 174222
2013-02-01 21:38:35 +00:00
Jim Ingham 95a777e915 Correct the definition of ObjC's BOOL in our pre-canned set of defines. It's supposed to
be "signed char" not "int".

<rdar://problem/13131126>

llvm-svn: 174209
2013-02-01 19:33:52 +00:00
Sean Callanan fa4fab77d4 Modified the expression parser's class wrapper to
support reporting "this" as a templated class.  The
expression parser wraps expressions in C++ methods
as methods with the signature

$__lldb_class::$__lldb_expr(...)

and previously responded to clang's queries about
$__lldb_class with the type of *this.  This didn't
work if *this was a ClassTemplateSpecializationDecl
because ClassTemplateSpecializationDecls can't be
the result of simple name queries.

Instead what we do now is respond that $__lldb_class
is a typedef and that the target of the typedef is
the (potentially templated) type of *this.  That is
much more robust.

Thanks to John McCall for key insights.

<rdar://problem/10987183>

llvm-svn: 174153
2013-02-01 06:55:48 +00:00
Greg Clayton abb487f57a Make sure a value is returned for Thread::ReturnFromFrame().
llvm-svn: 174141
2013-02-01 02:52:31 +00:00
Greg Clayton 13fbb99107 Allow the target to give out the size of the red zone for given ABIs.
A bit of cleanup in the heap module. 

llvm-svn: 174129
2013-02-01 00:47:49 +00:00
Greg Clayton 3dcaa2c8c8 Get rid for switch statement warning for unhandled cases.
llvm-svn: 174128
2013-02-01 00:46:49 +00:00
Greg Clayton 4959b7b8f5 Fixed register dumping for contained-regs.
llvm-svn: 174127
2013-02-01 00:45:52 +00:00
Jim Ingham 93208b8680 Add "thread return -x" to unwind the innermost user called expression (if you happen to have stopped in it due to a crash.)
Make the message when you hit an crash while evaluating an expression a little clearer, and mention "thread return -x".

rdar://problem/13110464

llvm-svn: 174095
2013-01-31 21:46:01 +00:00
Jim Ingham afc1b12f01 Change the default behavior for unwinding and breakpoints when running expressions.
<rdar://problem/13121442>

llvm-svn: 174082
2013-01-31 19:48:57 +00:00
Enrico Granata 8471f0477b Making sure a Pythonless build of LLDB works by #ifdef-ing out formatters code.
llvm-svn: 174074
2013-01-31 18:24:22 +00:00
Greg Clayton e7fc9ccf2e Added the ability to search segments for data. Currently __TEXT, __LINKEDIT and __PAGEZERO are excluded.
Added many more cleanups to the output.

llvm-svn: 174045
2013-01-31 06:38:09 +00:00
Greg Clayton 85e62eca66 expressions + C++11 lambdas == cooooool!!!
C++11 lambdas that don't capture anything can be used as static callback functions!

Heavily modified this python module to be able to not require a dylib in order to traverse the heap allocations.

Re-implemented the ptr_refs, objc_refs, malloc_info and cstr_refs to use complex expressions that use lambdas to do all static callback function work.

llvm-svn: 173989
2013-01-30 22:57:34 +00:00
Jason Molenda a46db7728e Verified that the plugin.dynamic-loader.darwin-kernel.scan-type
setting is working correctly now; remove the #if 0's around its
use.

llvm-svn: 173982
2013-01-30 22:19:51 +00:00
Enrico Granata 54f279fff6 <rdar://problem/12552374> & <rdar://problem/13100674>
The vtable pointer field is not necessarily a pointer and hence cannot be used for validation

llvm-svn: 173947
2013-01-30 17:44:16 +00:00
Dmitri Gribenko aa073de21a llvm/Basic/ConvertUTF.h now exposes all functions without macro tricks
llvm-svn: 173937
2013-01-30 15:12:30 +00:00
Dmitri Gribenko 024aa8539f UTF conversion routines were moved from clang/Basic to llvm/Support
llvm-svn: 173935
2013-01-30 15:05:59 +00:00
Jason Molenda 6396922186 Fix one obvious thinko with the plugin.dynamic-loader.darwin-kernel.scan-type setting
handling that was probably the source of the settings problem.  Need to verify that
it's working correctly tomorrow though.

llvm-svn: 173894
2013-01-30 04:48:16 +00:00
Jason Molenda 6ba6d3d179 <rdar://problem/12491235>
Enhance lldb so it can search for a kernel in memory when attaching
to a remote system.  Remove some of the code that was doing this
from ProcessMachCore and ProcessGDBRemote and put it in
DynamicLoaderDarwinKernel.

I've added a new setting, plugin.dynamic-loader.darwin-kernel.scan-type
which can be set to

 none   - for environments where reading random memory can cause a
          device crash 
 basic  - look at one fixed location in memory for a kernel load address, 
          plus the contents of that address
 fast-scan - the default, tries "basic" and then looks for the kernel's
          mach header near the current pc value when lldb connects
 exhaustive-scan - on 32-bit targets, step through the entire range where
          the kernel can be loaded, looking for the kernel binary

I don't have the setting set up correctly right now, I'm getting back unexpected
values from the Property system, but I'll figure that out tomorrow and fix.
Besides that, all of the different communication methods / types of kernels 
appear to be working correctly with these changes.

llvm-svn: 173891
2013-01-30 04:39:32 +00:00
Daniel Malea 30b95a3668 Fix build problems with libstdc++ 4.6/4.7
- remove nullptr from initialization of shared_ptrs

llvm-svn: 173870
2013-01-30 01:01:11 +00:00
Filipe Cabecinhas 45f0c66bc3 Use printf instead of echo -n (the latter won't work on OS X's /bin/sh)
llvm-svn: 173867
2013-01-30 00:48:11 +00:00
Greg Clayton 325e869463 Remove debug code and commented out code that was left in.
llvm-svn: 173865
2013-01-30 00:29:53 +00:00
Filipe Cabecinhas 8bc6534701 Continuing the fix for the r173732 fix. Now lldb gets built with Makefiles (Darwin).
llvm-svn: 173864
2013-01-30 00:28:58 +00:00
Greg Clayton 1b3815cbf4 <rdar://problem/9141269>
Cleaned up the objective C name parsing code to use a class.

Now breakpoints that are set by name that are objective C methods without the leading '+' or '-' will resolve. We do this by expanding all the objective C names for a given string. For example:

(lldb) b [MyString cStringUsingEncoding:]

Will set a breakpoint with multiple possible names: 
-[MyString cStringUsingEncoding:]
+[MyString cStringUsingEncoding:]

Also if you have a category, it will strip the category and set a breakpoint in all variants:

(lldb) [MyString(my_category) cStringUsingEncoding:]

Will resolve to the following names:

-[MyString(my_category) cStringUsingEncoding:]
+[MyString(my_category) cStringUsingEncoding:]
-[MyString cStringUsingEncoding:]
+[MyString cStringUsingEncoding:]

Likewise when we have:

(lldb) b -[MyString(my_category) cStringUsingEncoding:]

It will resolve to two names:
-[MyString(my_category) cStringUsingEncoding:]
-[MyString cStringUsingEncoding:]

llvm-svn: 173858
2013-01-30 00:18:29 +00:00
Filipe Cabecinhas 276a08b5b1 Actually build DataFormatters dir. Fix for the r173732 fix.
llvm-svn: 173840
2013-01-29 22:20:20 +00:00
Greg Clayton b25406cd9d <rdar://problem/13107904>
wchar_t causes problem with certain compilers. Removing it for now.

llvm-svn: 173823
2013-01-29 20:03:58 +00:00
Enrico Granata 59de94bd4e Since an address (0x12346) is an expression, be brief.
llvm-svn: 173757
2013-01-29 02:46:04 +00:00
Enrico Granata b84a9dbf6b <rdar://problem/12552374>
Replacing the address argument type with address-expression in cases where StringToAddress() is used, and hence an expression can be passed where previously only a numeric address was allowed
This makes the documentation more clear and helps users discover that they can truly pass in an expression in these situations.

llvm-svn: 173753
2013-01-29 01:48:30 +00:00
Enrico Granata 9a31ccbad8 <rdar://problem/12890171>
Providing a compact display mode for "po" to use where the convenience variable name and the pointer value are both hidden.
This is for convenience when dealing with ObjC instances where the description often gets it right and the debugger-provided information is not useful to most people.
If you need either of these, "expr" will still show them.

llvm-svn: 173748
2013-01-29 01:35:01 +00:00
Greg Clayton 3c94737fb7 <rdar://problem/12524607>
Flush the process when symbols are loaded/unloaded manually. This was going on in:
- "target modules load" command
- SBTarget::SetSectionLoadAddress(...)
- SBTarget::ClearSectionLoadAddress(...)
- SBTarget::SetModuleLoadAddress(...)
- SBTarget::ClearModuleLoadAddress(...)

llvm-svn: 173745
2013-01-29 01:17:09 +00:00
Enrico Granata d7760bffda Describe the data formatters as part of the architecture
llvm-svn: 173734
2013-01-29 00:42:12 +00:00
Enrico Granata 3c8d169843 Adding a Makefile. Hopefully that will make the Linux buildbot happy
llvm-svn: 173732
2013-01-29 00:29:33 +00:00
Greg Clayton c96029e118 Fixed a "wchar_t" typo.
llvm-svn: 173731
2013-01-29 00:29:18 +00:00
Enrico Granata 5548cb50b2 <rdar://problem/12978143>
Data formatters now cache themselves.
This commit provides a new formatter cache mechanism. Upon resolving a formatter (summary or synthetic), LLDB remembers the resolution for later faster retrieval.
Also moved the data formatters subsystem from the core to its own group and folder for easier management, and done some code reorganization.
The ObjC runtime v1 now returns a class name if asked for the dynamic type of an object. This is required for formatters caching to work with the v1 runtime.
Lastly, this commit disposes of the old hack where ValueObjects had to remember whether they were queried for formatters with their static or dynamic type.
Now the ValueObjectDynamicValue class works well enough that we can use its dynamic value setting for the same purpose.

llvm-svn: 173728
2013-01-28 23:47:25 +00:00
Greg Clayton 5b2a789c6f Always define types from stdint.h so they are always available for use in expressions no matter what debug info you have. Types added are:
int8_t
uint8_t
int16_t
uint16_t
int32_t
uint32_t
int64_t
uint64_t
intptr_t
uintptr_t
size_t
ptrdiff_t
whar_t

llvm-svn: 173724
2013-01-28 22:31:43 +00:00
Greg Clayton ba7b8e2c8c Make sure that multi-line expressions don't create a default target. We recently switched to using a built-in m_exe_ctx when running commands in the DoExecute() so that we can have common code where commands can required having a valid target/process/thread/frame by specifying flags, this caused multi-line expression to always create a new dummy target because m_exe_ctx gets cleared when DoExecute exits. A new input reader has been pushed to handle the input for the expression, which will get popped off and then it was checking the target in m_exe_ctx (which was cleared).
llvm-svn: 173596
2013-01-26 23:54:29 +00:00
Jason Molenda ec2546ab97 One more change of a uint32_t variable to offset_t
to match Greg's dataextractor patch, this one in some
#if defined arm code.

llvm-svn: 173564
2013-01-26 07:06:09 +00:00
Jason Molenda 4eacc7647d Add comments showing the symbolic names for the exc_code types we
receive with an EXC_BREAKPOINT mach exception on arm.

llvm-svn: 173560
2013-01-26 05:30:38 +00:00
Jim Ingham 2995077d8a Add "target.process.stop-on-shared-library-events" setting, and make it work.
Add the ability to give breakpoints a "kind" string, and have the StopInfoBreakpoint
print that in the brief description if set.  Also print the kind - if set - in the breakpoint
listing.
Give kinds to a bunch of the internal breakpoints.
We were deleting the Mac OS X dynamic loader breakpoint as though the id we had stored away was
a breakpoint site ID, but in fact it was a breakpoint id, so we never actually deleted it.  Fixed that.

llvm-svn: 173555
2013-01-26 02:19:28 +00:00
Jim Ingham 9d8dd4bf52 Missing newline in a warning message.
llvm-svn: 173519
2013-01-25 23:05:01 +00:00
Daniel Malea 318cbcef91 Disable confirmation prompts for testing
- set auto-confirm to false when running TestExprs (avoid hang when using API)
- set prompt-on-quit to false in test helper (avoid timeout when using lldb CLI)

llvm-svn: 173485
2013-01-25 20:38:49 +00:00
Daniel Malea eb19a95322 Remove hardcoded -arch from lang/cpp testcase makefiles
- skip rdar12991846 (already marked expected-fail) to avoid introducing a i386 crash

llvm-svn: 173483
2013-01-25 20:33:59 +00:00
Greg Clayton e2a2222d53 Fix buildbot building errors.
llvm-svn: 173473
2013-01-25 19:40:54 +00:00
Daniel Malea d6a5531d42 Fix indenting typo in TestSTL.py
llvm-svn: 173470
2013-01-25 19:14:49 +00:00
Han Ming Ong 00a5799698 <rdar://13073234>
Get the number of threads correct.

llvm-svn: 173466
2013-01-25 18:32:24 +00:00
Greg Clayton c7bece56fa <rdar://problem/13069948>
Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary.

So I defined a new "lldb::offset_t" which should be used for all file offsets.

After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed.

Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections.

llvm-svn: 173463
2013-01-25 18:06:21 +00:00
Jason Molenda a71919c9d6 <rdar://problem/13072285>
Change the GDBRemoteRegisterContext::AddRegister function to take
its RegisterInfo argument by value instead of using a reference -
it will modify the object and modifying the contents of the 
g_register_infos table in GDBRemoteRegisterContext.cpp can cause a
crash the next time we step through it.

llvm-svn: 173406
2013-01-25 01:05:30 +00:00
Daniel Malea 2745d8467b Update test scripts and Makefiles to allow testing with GCC:
- introduce new variable ARCHFLAG in make/Makefile.rules to switch between "-arch" on Mac and "-m" everywhere else
- update testcase makefiles to use LD_EXTRAS instead of LDFLAGS (the former interacts with Makefile.rules badly)
- special treatment for gcc 4.6: replace "-std=c++11" with "-std=c++0x" as the former is not handled correctly
- remove hardcoded "-arch" from test Makefile

This patch should not have any effect on lldb on Mac OS X.

llvm-svn: 173402
2013-01-25 00:31:48 +00:00
Daniel Malea be230793fb Mark test cases affected by PR 15036 (GCC-generated DWARF causes parser crash)
- Add new decorator "@skipIfGcc" to lldbtest.py

llvm-svn: 173394
2013-01-24 23:52:09 +00:00
Jim Ingham d30df9e24c Don't listen for EXC_RESOURCE exceptions, those should really be handled by the system
handler.  Also put in string translations for a couple of exceptions we were missing.

llvm-svn: 173390
2013-01-24 23:33:19 +00:00
Daniel Malea db14eb25a0 Skip 32-bit testing of check_public_api_headers (on all platforms, not just Mac OS X)
- since the test program needs to link with LLDB, the test is invalid in 32-bit mode.

llvm-svn: 173372
2013-01-24 21:01:12 +00:00
Daniel Malea b8f80ee67f Marking test cases with @expectedFailureLinux as per recently opened bugs
- PR 15038: missing wide char support on Linux
- PR 14600 - Exception state registers not supported on Linux
- PR 15039: SBProcess.GetSTDOUT() returns an empty buffer
- PR 15037: stop-hooks sometimes fail to fire on Linux

llvm-svn: 173363
2013-01-24 19:47:06 +00:00
Daniel Malea cf7304a201 PR14426 (breakpoint hit count incorrect) is resolved.
llvm-svn: 173362
2013-01-24 19:35:57 +00:00
Jim Ingham 8bebe00a24 Check for NULL breakpoint option thread name & queue name before comparing their values to the new value.
<rdar://problem/13065198>

llvm-svn: 173308
2013-01-23 23:14:13 +00:00
Jason Molenda 761263bf47 Remove a compile time warning in RNBRemote::HandlePacket_qProcessInfo
for non-x86 builds.

llvm-svn: 173226
2013-01-23 04:39:43 +00:00
Jason Molenda fa85ca5fff Change the container-regs kv pair in the qRegsiterInfo
reply to be hex encoded, not decimal.

Fix the whitespace in the container-regs/invalidate-regs
documentation, fix one ambiguous hex/decimal number in an
example.

llvm-svn: 173225
2013-01-23 04:38:32 +00:00
Enrico Granata f7b1a34e47 <rdar://problem/12711206>
Extending ValueObjectDynamicValue so that it stores a TypeAndOrName instead of a TypeSP.
This change allows us to reflect the notion that a ValueObject can have a dynamic type for which we have no debug information.
Previously, we would coalesce that to the static type of the object, potentially losing relevant information or even getting it wrong.
This fix ensures we can correctly report the class name for Cocoa objects whose types are hidden classes that we know nothing about (e.g. __NSArrayI for immutable arrays).
As a side effect, our --show-types argument to frame variable no longer needs to append custom dynamic type information.

llvm-svn: 173216
2013-01-23 01:17:27 +00:00
Enrico Granata c50b44801c lldb.thread is not to be used anymore
llvm-svn: 173119
2013-01-22 02:32:56 +00:00
Sean Callanan b1de8dd986 Quick fix to make LLDB TOT work with Clang TOT.
Avoids an error about an ambiguous constructor
call.

llvm-svn: 173118
2013-01-22 02:20:20 +00:00