Commit Graph

7378 Commits

Author SHA1 Message Date
Daniel Malea 4a01e59354 Improve TestExitDuringStep to verify thread behaviour during step-over, step-in in addition to step-inst
Patch by Brian Minard!

llvm-svn: 182961
2013-05-30 21:14:31 +00:00
Enrico Granata 0f6a057147 This checkin enables Python summaries to return any string-convertible object
Upon encountering an object not of type string, LLDB will get the string representation of it (akin to calling str(X) in Python code) and use that as the summary to display

Feedback is welcome as to whether repr() should be used instead (but the argument for repr() better be highly persuasive :-)

llvm-svn: 182953
2013-05-30 18:56:47 +00:00
Matt Kopec ef7ea33178 Disabling another watchpoint test with intermittent failure.
llvm-svn: 182952
2013-05-30 18:54:48 +00:00
Matt Kopec 03da5167cd Remove extraneous files from test directory.
llvm-svn: 182943
2013-05-30 17:59:36 +00:00
Greg Clayton 83793fc188 <rdar://problem/13956179>
Cleaned up the thread updating code in the OperatingSystemPython class. It doesn't need to clear the "new_thread_list" anymore as it is always empty. 

It also now assigns the "core_thread_list" to "new_thread_list" if no threads are detected through python.

llvm-svn: 182893
2013-05-29 23:31:14 +00:00
Greg Clayton 086e085efa Remove unused variable.
llvm-svn: 182892
2013-05-29 23:22:22 +00:00
Andrew Kaylor baa14e852b Fixing problems with thread create during step test.
llvm-svn: 182888
2013-05-29 22:40:17 +00:00
Andrew Kaylor bc46d567b7 Disabling watchpoint test with intermittent failure.
llvm-svn: 182887
2013-05-29 22:12:53 +00:00
Sean Callanan 467441d511 Error out if the expression for a breakpoint
condition doesn't return a result, instead
of blindly trying to use that result.

<rdar://problem/14009519>

llvm-svn: 182875
2013-05-29 20:22:18 +00:00
Jim Ingham cbf7e26b3b For "expr", say what the timeout units are in the help string.
llvm-svn: 182873
2013-05-29 19:40:14 +00:00
Ashok Thirumurthi 6eb0cadda7 Refactors to provide two variants for evaluation of text_list:
- The original test now passes on Linux with clang because a breakpoint is hit prior to evaluation of text_list, which improves text coverage.
- The new test fails because 4 steps are requested, and only two occur prior to evaluation of text_list.
--- Note that the loss of every second "next" command can be reproduced using lldb manually with this script.

llvm-svn: 182860
2013-05-29 14:58:27 +00:00
Andrew Kaylor 288ae669b4 Removing expected fail from another test that is now passing.
llvm-svn: 182815
2013-05-29 01:15:49 +00:00
Andrew Kaylor 0e46dbd119 Removing expected failures for watchpoint tests which are now passing.
llvm-svn: 182813
2013-05-29 00:26:53 +00:00
Andrew Kaylor 93132f504f Adding support for stopping all threads of multithreaded inferiors on Linux. Also adding multithreaded test cases.
llvm-svn: 182809
2013-05-28 23:04:25 +00:00
Daniel Malea bb43721a35 Fixed continue issues with process attach/detach
- added code for tracking transition from eStateAttaching to eStateStopped in event listener and handling process continuation there.

Patch by Arthur Evstifeev!

llvm-svn: 182806
2013-05-28 21:27:03 +00:00
Daniel Malea d72b3ceb6b Add instructions for running LLDB tests with non-default compiler/architectures
- documented the cmake variable LLDB_TEST_ARGS

llvm-svn: 182797
2013-05-28 19:14:44 +00:00
Enrico Granata 2db281e910 <rdar://problem/13863031>
Giving a timeout for the call to NSPrintForDebugger() that happens when you “po” objects

This is a temporary workaround until a more detailed solution to the general problem of canceling actions is found

llvm-svn: 182782
2013-05-28 18:02:49 +00:00
Daniel Malea f92c4a814a Add CMake targets to build LLDB reference docs
- [ninja|make] lldb-cpp-doc builds the C++ API reference docs
- [ninja|make] lldb-python-doc builds the python API reference docs
- updated build page on website to include instructions to build docs

Tested on Linux/Mac OS X

llvm-svn: 182752
2013-05-28 03:47:34 +00:00
Daniel Malea d77e9d4565 Mac OS X CMake fix: generate LLDB version from xcodeproj
- This resolves the remaining issues related to building lldb utility/dylib
- TODO: fix up debugserver build

Patch by Ahmed Bougacha!

llvm-svn: 182751
2013-05-28 03:44:37 +00:00
Filipe Cabecinhas 251f496578 lldbPluginOSDarwinKernel doesn't exist.
llvm-svn: 182687
2013-05-24 22:46:06 +00:00
Filipe Cabecinhas f104a830d4 Update countTrailingZeros function usage to match llvm's r182667.
llvm-svn: 182683
2013-05-24 22:24:17 +00:00
Sean Callanan 0b342b6ddf Fixed signed operations in the IR interpreter.
Scalar now can make itself signed if needed.

<rdar://problem/13977632>

llvm-svn: 182668
2013-05-24 20:36:56 +00:00
Ashok Thirumurthi 2a27227da0 Updated the status page to reflect the current Linux status.
- Fix for attach by name
- Details for register support
- Punted on i386 details as its status has drifted since this page was originally posted
- Multi-threaded target support is soon to be released on Linux
- Partial back-trace is called out since its a high-profile issue

llvm-svn: 182664
2013-05-24 19:25:33 +00:00
Ashok Thirumurthi 780593580f Added a parameter for relocation info to keep lldb in step with llvm due to r182625,
which takes a first step towards symbolization of disassembled instructions.

llvm-svn: 182650
2013-05-24 15:55:54 +00:00
Greg Clayton 7bcb93d5a5 <rdar://problem/13643315>
Fixed performance issues that arose after changing SBTarget, SBProcess, SBThread and SBFrame over to using a std::shared_ptr to a ExecutionContextRef. The ExecutionContextRef doesn't store a std::weak_ptr to a stack frame because stack frames often get replaced with new version, so it held onto a StackID object that would allow us to ask the thread each time for the frame for the StackID. The linear function was too slow for large recursive stacks. We also fixed an issue where anytime the std::shared_ptr<ExecutionContextRef> in any SBTarget, SBProcess, SBThread objects was turned into an ExecutionContext object, it would try to resolve all items in the ExecutionContext which are shared pointers. Even if the StackID in the ExecutionContextRef was invalid, it was looking through all frames in every thread. This causes a lot of unnecessary frame accesses.

llvm-svn: 182627
2013-05-24 00:58:29 +00:00
Filipe Cabecinhas 477d86d84d Adds PT_TLS and PT_GNU_EH_FRAME names to DumpELFProgramHeaders
llvm-svn: 182619
2013-05-23 23:01:14 +00:00
Daniel Malea 96a6f90d84 Improve vim-lldb expression commands for objective-c and implement evaluate-under-cursor:
1. Added new :Lpo command
2. :Lpo and :Lprint can be invoked without parameters. In that case
cursor word will be used
3. Added :LpO command in that case instead of <cword> will be used
stripped <cWORD>. This command is useful for printing objective-c
properties (for ex.: self.tableView). 

Patch by Arthur Evstifeev!!

llvm-svn: 182613
2013-05-23 21:34:26 +00:00
Michael Sartain c836ae7d36 ObjectFileELF::GetModuleSpecifications on Linux should work now.
Which means "platform process list" should work and list the architecture.
We are now parsing the elf build-id if it exists, which should allow us to load stripped symbols (looking at that next).

llvm-svn: 182610
2013-05-23 20:57:03 +00:00
Michael Sartain c3ce7f2740 Add ${ansi.XX} parsing to lldb prompt, use-color setting, and -no-use-colors command line options.
settings set use-color [false|true]
settings set prompt "${ansi.bold}${ansi.fg.green}(lldb)${ansi.normal} "
also "--no-use-colors" on the command prompt

llvm-svn: 182609
2013-05-23 20:47:45 +00:00
Greg Clayton cc24775b42 <rdar://problem/13966084>
Make sure to not call "regexec" from <regex.h> with a NULL C string, otherwise we can crash.

llvm-svn: 182607
2013-05-23 20:27:15 +00:00
Daniel Malea f18cff4767 Adding .arcconfig file to LLDB to allow using Phabricator for reviews
llvm-svn: 182606
2013-05-23 20:21:28 +00:00
Sean Callanan ed3fceaaa1 GCC gets confused by enums in bitfields, so I
removed the bitfields.  This should be conforming
C++11, though, cf. C++03 9.6(3):
"
A bit-field shall have integral or enumeration
type (3.9.1).
"

llvm-svn: 182545
2013-05-23 01:53:54 +00:00
Greg Clayton d389cc3a2e Don't compare 4 characters on a 2 character string.
llvm-svn: 182540
2013-05-22 23:36:10 +00:00
Michael Sartain 816cf1d88a Fix shutdown to correctly close stdout and stop showing garbage characters on exit.
Patch by Matthew Sorrels

llvm-svn: 182539
2013-05-22 23:31:28 +00:00
Greg Clayton 43d8279ffd Cleaned up the File API a bit.
llvm-svn: 182538
2013-05-22 23:30:09 +00:00
Greg Clayton fdbdc9c0ff Fixed a file leak introduced with my last checkin. Also be sure to include <stdio.h> just in case.
llvm-svn: 182537
2013-05-22 23:29:16 +00:00
Greg Clayton 62f80036be Added a new "lldb" log channel named "os" for the OperatingSystem plug-ins to use.
Added logging for the OS plug-in python objects in OperatingSystemPython so we can see the python dictionary returned from the plug-in when logging is enabled.

llvm-svn: 182530
2013-05-22 23:04:27 +00:00
Han Ming Ong e86321865a <rdar://problem/13963648>
Changes after feedback:
Directly use function pointer, just to be safer on 10.8.

llvm-svn: 182529
2013-05-22 23:00:47 +00:00
Sean Callanan fbf5c682cb Fixed a bug where persistent variables did not
live as long as they needed to.  This led to
equality tests involving persistent variables
often failing or succeeding when they had no
business doing so.

To do this, I introduced the ability for a
memory allocation to "leak" - that is, to
persist in the process beyond the lifetime of
the expression.  Hand-declared persistent
variables do this now.

<rdar://problem/13956311>

llvm-svn: 182528
2013-05-22 22:49:06 +00:00
Han Ming Ong b153c2f749 <rdar://problem/13963648>
Collect 'anonymous memory' info, if possible

llvm-svn: 182523
2013-05-22 21:32:42 +00:00
Greg Clayton a1b5dd9a20 <rdar://problem/13956179>
Fixed ProcessMachCore to be able to locate the main executeable in the core file even if it doesn't start at a core file address range boundary. Prior to this we only checked the first bytes of each range in the core file for mach_kernel or dyld. Now we still do this, but if we don't find the mach_kernel or dyld anywhere, we go through all core file ranges and check every 0x1000 to see if we can find dyld or the mach_kernel.

Now that we can properly detect the mach_kernel at any address, we don't need to call "DynamicLoaderDarwinKernel::SearchForDarwinKernel(Process*)" anymore.

llvm-svn: 182513
2013-05-22 21:00:49 +00:00
Greg Clayton 217b28baee <rdar://problem/13880690>
Lock the lldb_private::Module mutex while tearing down the module to make sure we don't get clients accessing the contents on a module as it is going away.

llvm-svn: 182511
2013-05-22 20:13:22 +00:00
Daniel Malea 6d73a8ec08 Add entries to vim-lldb plugin docs/help page for :Lattach and :Ldetach
llvm-svn: 182491
2013-05-22 17:29:38 +00:00
Daniel Malea 2e88c6b661 LLDB Vim plugin usability improvement: ":Lshow" now displays all panes
- no longer requires a pane name argument

Patch by Arthur Evstifeev

llvm-svn: 182484
2013-05-22 16:05:55 +00:00
Daniel Malea a7c86e1553 Implement attach by name in LLDB Vim plugin using ":Lattach <process-name>"
patch by Arthur Evstifeev

llvm-svn: 182483
2013-05-22 16:04:28 +00:00
Greg Clayton 8caea6db71 <rdar://problem/13455021>
Another fix to make sure that if we aren't able to extract an object file for any reason, we don't crash when trying to parse the debug map info.

llvm-svn: 182441
2013-05-22 00:10:28 +00:00
Greg Clayton 23386cb1df <rdar://problem/13455021>
Add test case to make sure we don't regress on fat files full of skinny BSD archives.

llvm-svn: 182440
2013-05-21 23:58:54 +00:00
Greg Clayton 80e6c043e9 <rdar://problem/13455021>
lldb crashes with universal file containing skinny BSD archives when doing DWARF with .o file debugging.

llvm-svn: 182437
2013-05-21 23:36:34 +00:00
Enrico Granata 4e284caa9b Adding a newline for better overall readability
llvm-svn: 182434
2013-05-21 22:34:17 +00:00
Greg Clayton fc2f7a53f7 Quiet the new exec test case down so it doesn't spew debug prints.
llvm-svn: 182429
2013-05-21 22:00:39 +00:00
Greg Clayton 8cda7f0830 Added a test case that verifies that LLDB can debug across a process exec'ing itself into a new program. This currently is only enabled for Darwin since we exec from 64 bit to 32 bit and vice versa for 'x86_64' targets.
This can easily be adapted for linux and other platforms, but I didn't want to break any buildbots by assuming it will work.

llvm-svn: 182428
2013-05-21 21:55:59 +00:00
Enrico Granata 397ddd5f96 <rdar://problem/13878726>
Yet another implementation of the python in dSYM autoload :)
This time we are going with a ternary setting:
true - load, do not warn
false - do not load, do not warn
warn - do not load, warn (default)

llvm-svn: 182414
2013-05-21 20:13:34 +00:00
Enrico Granata 3189891857 <rdar://problem/13925432>
A user request such as: memory read -fc -s10 -c1 *charPtrPtr would cause us to crash upon trying to read 1 char of size 10 from memory
This request is now translated into: memory read -fc -s1 -c10 *charPtrPtr (i.e. read 10 chars of size 1 from memory) which is probably also what the user originally wanted

llvm-svn: 182398
2013-05-21 17:39:04 +00:00
Greg Clayton 15fc2be75b <rdar://problem/13892516>
LLDB can now debug across calls to exec when the architecture changes from say i386 to x86_64 (on darwin).

llvm-svn: 182345
2013-05-21 01:00:52 +00:00
Enrico Granata b936b86d0c s/to override/To override/
Thanks to Greg Clayton for catching this

llvm-svn: 182339
2013-05-21 00:22:30 +00:00
Enrico Granata 9730339bdf Improving the previous checkin about target.load-script-from-symbol-file
There are two settings:
target.load-script-from-symbol-file is a boolean that says load or no load (default: false)
target.warn-on-script-from-symbol-file is also a boolean, it says whether you want to be warned when a script file is not loaded due to security (default: true)

the auto loading on change for target.load-script-from-symbol-file is preserved

llvm-svn: 182336
2013-05-21 00:00:30 +00:00
Enrico Granata 68ae91cf83 <rdar://problem/13925626>
Correctly handle the case of a ValueObjectVariable backed by a Vector

llvm-svn: 182330
2013-05-20 22:58:35 +00:00
Enrico Granata 0519e142b8 <rdar://problem/13925626>
Replacing an assertion with an error - at least we won’t crash

llvm-svn: 182326
2013-05-20 22:49:13 +00:00
Enrico Granata caa84cbc01 Forgot to check for empty error strings in the previous checkin
llvm-svn: 182325
2013-05-20 22:40:54 +00:00
Enrico Granata 84a53dfb49 <rdar://problem/13878726>
This changes the setting target.load-script-from-symbol-file to be a ternary enum value:
default (the default value) will NOT load the script files but will issue a warning suggesting workarounds
yes will load the script files
no will not load the script files AND will NOT issue any warning

if you change the setting value from default to yes, that will then cause the script files to be loaded
(the assumption is you didn't know about the setting, got a warning, and quickly want to remedy it)

if you have a settings set command for this in your lldbinit file, be sure to change "true" or "false" into an appropriate "yes" or "no" value

llvm-svn: 182323
2013-05-20 22:29:23 +00:00
Greg Clayton 885b4b71be Patch from Yacine Belkadi that fixes a typo in an error message.
llvm-svn: 182302
2013-05-20 16:52:10 +00:00
Greg Clayton 958d4eb12a Patch from Yacine Belkadi that fixes an issue in Variable::GetValuesForVariableExpressionPath().
llvm-svn: 182301
2013-05-20 16:50:51 +00:00
Sean Callanan e8cde68a2a Fixed a problem where the dynamic checkers (i.e.,
the Objective-C object checker and the pointer
checker) were not always installed into expressions.

<rdar://problem/13882566>

llvm-svn: 182183
2013-05-18 00:38:20 +00:00
Greg Clayton 6ecb232b31 <rdar://problem/11398407>
Name matching was working inconsistently across many places in LLDB. Anyone doing name lookups where you want to look for all types of names should used "eFunctionNameTypeAuto" as the sole name type mask. This will ensure that we get consistent "lookup function by name" results. We had many function calls using as mask like "eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeMethod | eFunctionNameTypeSelector". This was due to the function lookup by name evolving over time, but as it stands today, use eFunctionNameTypeAuto when you want general name lookups. Either ModuleList::FindFunctions() or Module::FindFunctions() will figure out the right kinds of names to lookup and remove the "eFunctionNameTypeAuto" and replace it with the exact subset of what the name can be.

This checkin also changes eFunctionNameTypeAny over to use eFunctionNameTypeAuto to reflect this.

llvm-svn: 182179
2013-05-18 00:11:21 +00:00
Enrico Granata 5a9c4fe272 <rdar://problem/13928053>
Fix the fact that an empty NSString (e.g. one obtained from @"" would show no summary)

llvm-svn: 182173
2013-05-17 23:28:13 +00:00
Matt Kopec 841a5488fb The Linux process plugin wasn't returning the correct linux signals. This fixes that.
Thus, this patch also negates a previous fix for handling SIGCHLD.

llvm-svn: 182166
2013-05-17 22:21:08 +00:00
Greg Clayton b1e4a25b03 Added a few linux build configure/make examples.
llvm-svn: 182160
2013-05-17 21:06:45 +00:00
Ashok Thirumurthi 7129bd8e25 Avoided the use of two test decorators with xfail/xpass logic in the same test.
- Used xfail and skip, temporarily, while resolving bugzilla #15671.

llvm-svn: 182159
2013-05-17 21:00:56 +00:00
Greg Clayton 9826c3f33d Allow LLDB to be built on a system with an installed gcc/g++ that isn't the default. I recently installed gcc-4.7/g++-4.7 on Ubuntu and tried to build by specifying:
CC=gcc-4.7 CXX=g++-4.7

as configure and make args, but it didn't work when being run with makefiles. This patch fixes that.

llvm-svn: 182158
2013-05-17 20:56:55 +00:00
Daniel Malea 01b384c978 Fix CMake install target
- copy lldb python module into directory specified with CMAKE_INSTALL_PREFIX
- make liblldb.so a symlink (to liblldb.so.X.Y where X.Y is the LLVM version)

llvm-svn: 182157
2013-05-17 20:55:19 +00:00
Ashok Thirumurthi c97a6083e2 Fix xpasses on the gcc buildbots using compiler versions to qualify the xfail.
- Note that this is not correct, as the failure is associated with build options of libc.so, however it's failing on a Debian buildbot that uses gcc 4.6.2 (and the real goal is a complete backtrace even with -fomit-frame-pointer).

- Adds helpers to lldbtest.py to check the expectedCompiler and expectedVersion, with an eventual goal of reducing the number of test decorators.
--- Currently allows a comparison operator and a compiler version to be specified.
--- Can be extended to support ranges of compiler versions.

llvm-svn: 182155
2013-05-17 20:15:07 +00:00
Matt Kopec a360d7e7a3 ProcessMonitor improvements for Linux.
-Remove tracing of fork/vfork until we add support for tracing inferiors' children on Linux.
-Add trace exec option for ptrace so that we don't receive legacy SIGTRAP signals on execve calls.
-Add handling of SIGCHLD sent by kernel (for now, deliver the signal to the inferior).

llvm-svn: 182153
2013-05-17 19:27:47 +00:00
Daniel Malea 21b16cc752 Append missing version number to lldb binary built by cmake
- now, the output binary is called 'lldb-3.4' instead of 'lldb'
- a symlink 'lldb' -> 'lldb-3.4' is also created
- this fixes one of the problems preventing CMake from building Debian packages

llvm-svn: 182148
2013-05-17 18:51:03 +00:00
Daniel Malea 716d924e4c Update LLDB web docs with instructions to run individual test suites/directories
llvm-svn: 182117
2013-05-17 16:08:45 +00:00
Ashok Thirumurthi 26c0a19f62 Modifies the log directory to ensure that the log file will be found on tear-down (i.e. for CI agents that clean up artifacts aggressively).
- Uses the cwd following the model of TestPublicAPIHeaders.py

llvm-svn: 182116
2013-05-17 15:44:58 +00:00
Ashok Thirumurthi b4e5134ff8 Adds a test case for bugzilla #15671 patterned after TestInferiorCrashing.py.
- On Linux, the partial back-trace after an assert can cause the basic test to fail as discussed on lldb-dev.
- Uses SBFrame to walk up the stack to the assert site and tests expression evaluation of locals, globals and arguments.

Thanks to Daniel for review and testing on OS/X.

llvm-svn: 182115
2013-05-17 15:35:15 +00:00
Ashok Thirumurthi 51e9c19334 Uses a helper to consistently verify the stop reason in all tests.
- Also removes a redundant import statement.

llvm-svn: 182111
2013-05-17 15:22:33 +00:00
Ashok Thirumurthi 14238b6c78 Updated TestAbbreviations to reflect the changed output in r182068.
llvm-svn: 182104
2013-05-17 15:03:59 +00:00
Ashok Thirumurthi 84cf70ec09 Fixed the build to reflect the API name change in r182085.
- Also added a comment as lldb doesn't flush the instruction cache after dy-load.

llvm-svn: 182099
2013-05-17 14:46:59 +00:00
Sylvestre Ledru b4dc9f0137 Fix a typo (ouput => output)
llvm-svn: 182090
2013-05-17 12:31:43 +00:00
Michael Sartain adeab5086e Comment out ObjectFileELF::GetModuleSpecifications() function until I can debug where it's causing tests to fail.
llvm-svn: 182069
2013-05-17 02:00:55 +00:00
Jim Ingham af3753eb3a Apropos should search user commands as well as built-in commands.
rdar://problem/13916722

llvm-svn: 182068
2013-05-17 01:30:37 +00:00
Greg Clayton ef2129d13b <rdar://problem/13217784>
"source list -n <func>" can now show more than one location that matches a function name. It will unique multiple of the same source locations so they don't get displayed. It also handles inline functions correctly.

llvm-svn: 182067
2013-05-17 00:56:10 +00:00
Greg Clayton 9e9f219a8c <rdar://problem/13893094>
Show variables that were in the debug info but optimized out. Also display a good error message when one of these variables get used in an expression.

llvm-svn: 182066
2013-05-17 00:55:28 +00:00
Michael Sartain 9f0013d867 Implement ObjectFileELF::GetModuleSpecifications(), and add PlatformLinux code to deal with unknown arch properties.
CR: Greg Clayton
llvm-svn: 182065
2013-05-17 00:20:21 +00:00
Michael Sartain b9931496f5 test commit
llvm-svn: 182064
2013-05-17 00:08:09 +00:00
Filipe Cabecinhas 22b40f7b0b Fix ObjectFileELF to not use the file_offset twice.
llvm-svn: 182061
2013-05-16 23:29:36 +00:00
Enrico Granata e8be51d7d7 the return False in breakpoint actions should also be mentioned on the website
llvm-svn: 182060
2013-05-16 23:17:25 +00:00
Enrico Granata f5f560caea Note in the documentation about the fact that Python callbacks can return a value and if that value is False, LLDB won’t stop at the breakpoint
llvm-svn: 182059
2013-05-16 23:09:09 +00:00
Jim Ingham 641a67ce26 Handle the case where there is a user breakpoint set at the location of one of our
function call exception catching breakpoints.  We need to force ourselves to stop in
that case.

<rdar://problem/13903801>

llvm-svn: 182056
2013-05-16 21:52:36 +00:00
Daniel Malea 3be69dac8d Fix Linux 'platform status' command. Its output is now closer to that on Mac OS X
- resolves llvm.org/pr14806

Patch by Matthew Sorrels!

llvm-svn: 182030
2013-05-16 17:52:04 +00:00
Sean Callanan bb77704cd1 Added a per-process cache for reserved memory
regions that aren't actually allocated in the
process.  This cache is used by the expression
parser if the underlying process doesn't support
memory allocation, to avoid needless repeated
searches for unused address ranges.

Also fixed a silly bug in IRMemoryMap where it
would continue searching even after it found a
valid region.

<rdar://problem/13866629>

llvm-svn: 182028
2013-05-16 17:30:37 +00:00
Greg Clayton 8b2a1d69cb <rdar://problem/13891604>
Fixed a 2 second delay when sending the 'k' (kill) packet that happened due to a race condition.

llvm-svn: 182025
2013-05-16 16:56:02 +00:00
Enrico Granata 15a501b04d <rdar://problem/11158023>
Make type summary add and breakpoint command add show an helpful prototype + argument reference when manually typing Python code for these elements

llvm-svn: 181968
2013-05-16 01:24:29 +00:00
Greg Clayton ff1596c2a1 Removed unused code and an unused event.
llvm-svn: 181948
2013-05-16 00:15:36 +00:00
Ashok Thirumurthi 863bd4a534 Fixed an xpass due to r181841 on Linux with gcc. Note that the clang variant contains to xfail, and r181841 is a fix for the test.
llvm-svn: 181918
2013-05-15 20:26:30 +00:00
Greg Clayton 9aae0a13bf <rdar://problem/13128331>
Fixed "target symbols add" to correctly extract all module specifications from a dSYM file that is supplied and match the symbol file to a current target module using the UUID values if they are available.

This fixes the case where you add a dSYM file (like "foo.dSYM") which is for a renamed executable (like "bar"). In our case it was "mach_kernel.dSYM" which didn't match "mach_kernel.sys". 

llvm-svn: 181916
2013-05-15 19:52:08 +00:00
Daniel Malea e8bdd1f5c0 Clean up linux test decorators and add links to known bugs
- s/skipOnLinux/skipIfLinux/ to match style of every other decorator
- linkify bugizilla/PR numbers in comments

No intended change in functionality.

llvm-svn: 181913
2013-05-15 18:48:32 +00:00
Jim Ingham 5c42d8a87c Fixed a few obvious errors pointed out by the static analyzer.
llvm-svn: 181911
2013-05-15 18:27:08 +00:00
Daniel Malea 243b379aa1 Re-enable tests disabled due to llvm.org/pr14541
- "platform process list" command works on Linux now
- "process attach -n" (attach to process by name also works on Linux now)

llvm-svn: 181905
2013-05-15 17:55:12 +00:00
Daniel Malea 25d7eb0d9a Implement "platform process list" on Linux
- read process information from /proc
- resolves llvm.org/pr14541 :)

Patch by Mike Sartain!

llvm-svn: 181904
2013-05-15 17:54:07 +00:00
Daniel Malea 5cb6ea08f1 Revert r181833: lldb prompt issue still occurs on buildbot (http://lab.llvm.org:8011/builders/lldb-x86_64-linux/builds/4124)
- maybe consider checking in the 'good' version of libedit to avoid ancient system version

llvm-svn: 181903
2013-05-15 17:50:37 +00:00
Daniel Malea 0a693d9d66 Disable test case that causes assertion failure on Linux
- filed llvm.org/pr16016
- fixed URL for llvm.org/pr16000

llvm-svn: 181902
2013-05-15 17:46:16 +00:00
Daniel Malea e3a0a6ec91 Fix cmake builds from checkouts with multiple remotes
- newlines from GetRepositoryPath output were interfering with ninja builds
- replace newlines with spaces
- remove *only* trailing spaces from repo path

llvm-svn: 181899
2013-05-15 17:23:19 +00:00
Sylvestre Ledru 99446cfb1a Include also sys/wait.h in the case of a FreeBSD kernel with a glibc (Debian KFreeBSD for example)
llvm-svn: 181885
2013-05-15 13:56:44 +00:00
Sylvestre Ledru e2af9ea00f Only include under arm and an Apple system. Otherwise, it will fail under a GNU/Linux under ARM
llvm-svn: 181876
2013-05-15 09:32:35 +00:00
Enrico Granata c8fcaab6ce <rdar://problem/13883385>
Python breakpoint actions can return False to say that they don't want to stop at the breakpoint to which they are associated
Almost all of the work to support this notion of a breakpoint callback was in place, but two small moving parts were missing:
a) the SWIG wrapper was not checking the return value of the script
b) when passing a Python function by name, the call statement was dropping the return value of the function
This checkin addresses both concerns and makes this work
Care has been taken that you only keep running when an actual value of False has been returned, and that any other value (None included) means Stop!

llvm-svn: 181866
2013-05-15 02:46:08 +00:00
Jim Ingham 362e39a0a7 Change the mechanism around SBValue::GetSP() so that it always requires the target API lock AND the
process StopLocker (if there is a process) before it will hand out SBValues.  We were doing this in 
an ad hoc fashion previously, and then playing whack-a-mole whenever we found a place where we should
have been doing this but weren't.  Really, it doesn't make sense to be poking at SBValues when the target
is running, the dynamic and synthetic values can't really be computed, and the underlying memory may be
incoherent.

<rdar://problem/13819378> Sometimes when stepping fast, my inferior is killed by debugserver

llvm-svn: 181863
2013-05-15 02:16:21 +00:00
Jim Ingham b78d73fe76 Don’t pop the process input reader for a “stop” event if ShouldBroadcastEvent has restarted the process.
llvm-svn: 181859
2013-05-15 01:21:48 +00:00
Jim Ingham c0dfddb302 Didn't mean to check in this change...
llvm-svn: 181858
2013-05-15 01:12:43 +00:00
Jim Ingham bd4a5eccd6 Need to add the LLDB.framework directory to the rpath for the driver programs or they won't run.
llvm-svn: 181857
2013-05-15 01:11:30 +00:00
Greg Clayton 9e57dcd359 <rdar://problem/13892319>
The command "po" by itself yields odd errors. I fixed the alias.

llvm-svn: 181856
2013-05-15 01:03:08 +00:00
Enrico Granata a3962a77cd <rdar://problem/13821289>
Changes to the libc++ std::string data formatter

llvm-svn: 181855
2013-05-15 00:47:46 +00:00
Greg Clayton f21feadcd9 A first pass at auto completion for variables and their children. This is currently hooked up for "frame variable" only. With a little work we can also enable it for the "expression" command and also for other things.
llvm-svn: 181850
2013-05-14 23:43:18 +00:00
Greg Clayton 609a433159 Unbreak the linux buildbot tests. This still fails for the clang that is being used on linux.
llvm-svn: 181845
2013-05-14 23:21:47 +00:00
Greg Clayton dacc4a953d <rdar://problem/13748253>
Combine N_GSYM stab entries with their non-stab counterpart (data symbols) to make the symbol table smaller with less duplicate named symbols.

llvm-svn: 181841
2013-05-14 22:19:37 +00:00
Greg Clayton bc8d23956c Fixed the test case to pass on Darwin. This might pass on linux as well. The test case now properly validates g_points as a global for the class A version, and the static variable for the file static.
llvm-svn: 181840
2013-05-14 22:17:29 +00:00
Daniel Malea 9d38385861 Remove XFAIL from tests affected by llvm.org/pr-14637
- unable to repro locally, much like many people commenting on the issue

llvm-svn: 181833
2013-05-14 21:19:22 +00:00
Daniel Malea 9fbc230de2 Fix GCC buildbot failures in API/Multithreaded tests
- fix typo initializing unique_ptr
- add missing throw specifier to play nice with older libstdc++ exception class

llvm-svn: 181831
2013-05-14 21:00:47 +00:00
Daniel Malea 4835990a6f Skip C++ API/Multithreaded tests that are unsupported with Clang/libstdc++
- older versions of clang are unable to include <chrono> from libstdc++
- skipping tests until buildbots are updated

llvm-svn: 181829
2013-05-14 20:48:54 +00:00
Daniel Malea b2132553d9 Adding C++ tests that drive LLDB from multiple threads
- test_breakpoint_callback -- filed llvm.org/pr-16000
- test_listener_resume -- resume a process from a thread waiting on SBListener
- test_listener_event_description -- SBEvent description from SBListener thread
- test_listener_event_process -- query process/thread/stack info from SBListener thread

llvm-svn: 181819
2013-05-14 19:13:25 +00:00
Matt Kopec 04e5d58c8d strncmp was checked incorrectly in the Linux symbol lookup fix.
llvm-svn: 181818
2013-05-14 19:00:41 +00:00
Greg Clayton eea37eed5d <rdar://problem/13764135>
The "lldb" driver was interfering with STDOUT and STDERR if the output was over 1024 charcters long. The output was grabbing 1024 characters at a time, before it output the characters, it was writing characters to the screen to clear the current line. This has been fixed.

I also fixed the command interpreter from mixing the "(lldb) " prompt in with program output by always manually checking for program output. This was done by having the command interpreter know when it is in the middle of executing a command by setting a bool. This was needed since sometimes when a command would run the target, like with a command like 'expression (int)printf("hello\n")', the process would push a new input reader, and then pop it when it was done. This popping of the input reader would cause the command interpreter to get sent a reactivated message (from the private process state thread) and cause it to ask for another command, even though we were still in the middle of the command ('expression (int)printf("hello\n")'). Now we set a bool to true, run the command and set the bool to false. If we get reactivated while we are in the middle of a command, we don't say we are ready for a new command. This coupled with emitting the STDOUT/STDERR first after each command, followed by the command results, followed by then saying we are ready for a new command, should help cleanup the command line output on all platforms.

llvm-svn: 181807
2013-05-14 17:36:51 +00:00
Daniel Malea 246cb61104 Fix inline stepping test case on Linux because Thread::ThreadStoppedForAReason ignored virtual steps.
- add IsVirtualStep() virtual function to ThreadPlan, and implement it for
  ThreadPlanStepInRange
- make GetPrivateStopReason query the current thread plan for a virtual stop to
  decide if the current stop reason needs to be preserved
- remove extra check for an existing process in GetPrivateStopReason

llvm-svn: 181795
2013-05-14 15:20:12 +00:00
Ashok Thirumurthi b5209bd875 Avoid $rax for 32-bit inferiors to fix a failing i386 test on the darwin buildbots.
llvm-svn: 181789
2013-05-14 13:34:25 +00:00
Jason Molenda ddf91778b1 A few more small tweaks to arm core file handling.
Most importantly, have DoReadGPR/DoReadFPU/DoReadEXC return -1
to indicate failure if they're called.  Else these could override
the Error setting for the relevant thread state -- if the core file
didn't include a floating point thread state, for instance, these
functions would clear the Error setting for that register set and 
lldb would display random bytes as those registers' contents.
<rdar://problem/13665075> 

llvm-svn: 181757
2013-05-14 04:50:47 +00:00
Jason Molenda 663d2e1803 Small change to the previous checkin, read in the fpu register context
in one large block - and be sure toget the fpscr value as well when
processing a core file.

llvm-svn: 181756
2013-05-14 03:52:22 +00:00
Jason Molenda 2e7236fa66 Fixes to read the floating point and exception registers sets out
of arm Mach-O core files.
<rdar://problem/13665075>

llvm-svn: 181755
2013-05-14 03:25:58 +00:00
Andrew Kaylor d4dc579304 Adding new test cases for inferior crashing.
llvm-svn: 181742
2013-05-13 23:47:25 +00:00
Matt Kopec 201284a8d3 Add expression tests for a function in an anonymous namespace.
llvm-svn: 181741
2013-05-13 22:00:32 +00:00
Daniel Malea ca9409dd55 Fix Mac OS X build issue introduced by incorrect using statements
llvm-svn: 181739
2013-05-13 21:52:06 +00:00
Ashok Thirumurthi cdb5b61a2d Prevent convenience registers from being included in "read register" as they are derived registers.
- Also refactors TestRegisters.py because test_convenience_registers_with_process_attach now fails with an assert.

TODO: Cross-reference the skipOnLinux decorator with a bugzilla report after root-causing this issue.
llvm-svn: 181737
2013-05-13 21:45:50 +00:00
Daniel Malea b218b7f22a Unset CFLAGS/CXXFLAGS when running tests via cmake/make check targets
- should fix automatic tests set up on http://llvm-jenkins.debian.net
- needed in order to make Debian package builds depend on passing test suite

llvm-svn: 181736
2013-05-13 21:41:35 +00:00
Daniel Malea 09ec3a51c6 Cleanup test output when run via cmake/make check targets
llvm-svn: 181735
2013-05-13 21:37:02 +00:00
Ashok Thirumurthi 1999b6d68c Fixed expression evaluation with convenience registers.
- Also improved test coverage for passing tests to include expr/x
and a sanity check for $eax as the lower half of $rax.

llvm-svn: 181727
2013-05-13 19:56:46 +00:00
Daniel Malea 487dd5dde6 Fixed build break introduced by r181717
- added missing ConstString header
- moved "using lldb*" statements to OS-independent section

llvm-svn: 181724
2013-05-13 19:35:07 +00:00
Matt Kopec 62502c6897 Add setting of lldb thread names on Linux.
Patch by Mike Sartain.

llvm-svn: 181722
2013-05-13 19:33:58 +00:00
Sean Callanan a49d9bef05 Removed a duplicate entry from the GDB to
LLDB transition page.  Also fixed a <b>...</b>
tag.

<rdar://problem/13871874>

llvm-svn: 181720
2013-05-13 18:30:58 +00:00
Greg Clayton daa8cd73a4 <rdar://problem/13875830>
Unblock linux builds. The real fix for this is tracked by the above radar, but this temporary hack should fix things for now.

llvm-svn: 181717
2013-05-13 18:22:55 +00:00
Daniel Malea dd15b78fc1 Fix Linux warning about missing virtual destructor in Operation classes
llvm-svn: 181712
2013-05-13 17:32:07 +00:00
Daniel Malea e5b6468885 Unbreak cmake builds by skipping Darwin kernel plugin on non-Mac platforms
llvm-svn: 181711
2013-05-13 17:30:30 +00:00
Enrico Granata 2ea43cdcab <rdar://problem/13183720>
Provide a mechanism through which users can disable loading the Python scripts from dSYM files
This relies on a target setting: target.load-script-from-symbol-file which defaults to false ("do NOT load the script")
You need to set it to true before creating your target (or in your lldbinit file if you constantly rely on this feature) to allow the scripts to load

llvm-svn: 181709
2013-05-13 17:03:52 +00:00
Sylvestre Ledru 7a89d6fe8a Also pass the MCRegInfo to createMCAsmInfo. Follow the modification introduced in commit r181680 of llvm
llvm-svn: 181703
2013-05-13 13:41:13 +00:00
Sylvestre Ledru 02240c5c02 Under GNU/Linux, do not build lldbPluginDynamicLoaderDarwinKernel.a. It was breaking the build
llvm-svn: 181695
2013-05-13 10:18:51 +00:00
Sylvestre Ledru f8cec0e0e6 Add a new constructor with ConstString (and not only const char *). Hopefully fixes the build of lldb
llvm-svn: 181694
2013-05-13 09:43:11 +00:00
Jason Molenda 2e56a2545e Update ProcessKDP and ProcessMachCore to use ConstString plugin
names when specifying the DynamicLoaderDarwinKernel.

ProcessGDBRemote wasn't setting the dyld string any more; remove
the remaining code tracking the dyld plugin name altogether from
that process plugin.

llvm-svn: 181658
2013-05-11 03:09:05 +00:00
Jason Molenda 408fa33340 A couple of small fixes to make core file debugging less noisy.
Don't want about being unable to find a needed objective-c runtime
function when we're core file debugging and can't jit anything
anyway.  Don't warn when quitting a debug session on a core file,
the program state can be reconstructed by re-running lldb on the
same core file again.

llvm-svn: 181653
2013-05-11 00:52:25 +00:00
Greg Clayton f9b57b9d77 <rdar://problem/13700260>
Avoid a deadlock when using the OperatingSystemPython code and typing "process interrupt". There was a possible lock inversion between the target API lock and the process' thread list lock due to code trying to discard the thread list. This was fixed by adding a boolean to Process::Halt() that indicates if the thread plans should be discarded and doing it in the private state thread when we process the stopped state.

llvm-svn: 181651
2013-05-10 23:48:10 +00:00
Matt Kopec a189d497f0 Use mangled and demangled names when checking for a function in a namespace and a function in an anonymous namespace, respectively.
llvm-svn: 181645
2013-05-10 22:55:24 +00:00
Sean Callanan ec537a24eb Hardened LLDB against NULL conditions being
passed to breakpoints.

<rdar://problem/13853205>

llvm-svn: 181636
2013-05-10 21:58:45 +00:00
Greg Clayton 57abc5d6a6 <rdar://problem/13854277>
<rdar://problem/13594769>

Main changes in this patch include:
- cleanup plug-in interface and use ConstStrings for plug-in names
- Modfiied the BSD Archive plug-in to be able to pick out the correct .o file when .a files contain multiple .o files with the same name by using the timestamp
- Modified SymbolFileDWARFDebugMap to properly verify the timestamp on .o files it loads to ensure we don't load updated .o files and cause problems when debugging

The plug-in interface changes:

Modified the lldb_private::PluginInterface class that all plug-ins inherit from:

Changed:

virtual const char * GetPluginName() = 0;

To: 

virtual ConstString GetPluginName() = 0;

Removed:

virtual const char * GetShortPluginName() = 0;

- Fixed up all plug-in to adhere to the new interface and to return lldb_private::ConstString values for the plug-in names. 
- Fixed all plug-ins to return simple names with no prefixes. Some plug-ins had prefixes and most ones didn't, so now they all don't have prefixed names, just simple names like "linux", "gdb-remote", etc.

llvm-svn: 181631
2013-05-10 21:47:16 +00:00
Matt Kopec d608996610 Add temporary fix for calling c++ global/anonymous functions on Linux.
llvm-svn: 181613
2013-05-10 17:53:48 +00:00
Andrew Kaylor 29d65744c9 Adding support for setting thread stop state when a process stops.
This re-submission of this patch fixes a problem where the code sometimes caused a deadlock.  The Process::SetPrivateState method was locking the Process::m_private_state variable and then later calling ThreadList::DidStop, which locks the ThreadList mutex.  Other methods in ThreadList which were being called from other threads lock the ThreadList mutex and then call Process::GetPrivateState which locks the Process::m_private_state mutex.  To avoid deadlocks, Process::SetPrivateState now locks the ThreadList mutex before locking the Process::m_private_state mutex.

llvm-svn: 181609
2013-05-10 17:19:04 +00:00
Ashok Thirumurthi 1fef0071ac Removed expectedFailureDarwin, and added a note about the disparity between the automated tests and testing at the lldb command-line.
llvm-svn: 181602
2013-05-10 16:10:23 +00:00
Ashok Thirumurthi f19caa1227 Added an integration test to step through a crash and then test for globals, locals, arguments, registers and the back-trace.
llvm-svn: 181599
2013-05-10 14:37:49 +00:00
Jason Molenda 58a6208976 Scratch that, the problem was elsewhere.
llvm-svn: 181582
2013-05-10 02:18:50 +00:00
Jason Molenda 041e367563 Temporarily roll back r181375 - it is causing an unexpected regression,
I'll revisit this and apply once I figure out how to address that.

llvm-svn: 181581
2013-05-10 02:15:22 +00:00
Jason Molenda ca2ffa7e65 Add an explicit check for a darwin kernel KDP_VERSIONSTRING when
starting a kdp communication session, instead of assuming darwin
kernel for any "non-EFI" kdp session.
<rdar://problem/13854098>

llvm-svn: 181566
2013-05-09 23:52:21 +00:00
Sean Callanan de9ce87f03 Don't completely drop methods we don't want to put
into a CXXRecordDecl on the ground; rather, put
them into the translation unit as functions.

<rdar://problem/13834404>

llvm-svn: 181560
2013-05-09 23:13:13 +00:00
Ashok Thirumurthi acbb1a5db5 Fixed "log enable linux registers" and added a test.
- Eliminated the use of static for methods that read m_register_infos, so that these routines can be implemented in the base class.
- Eliminated m_register_infos in the base class because this is not used when derived classes call UpdateRegisterInfo.
- Also moved the namespace using declarations from headers to source files.

Thanks to Daniel and Samuel for their review feedback.

llvm-svn: 181538
2013-05-09 19:59:47 +00:00
Enrico Granata 078551c7b1 <rdar://problem/13831149>
Recursive commands invocations are not currently supported by our CommandInterpreter
CommandScriptImport can actually be made to invoke itself recursively, so we need to work around that by clearing the m_exe_ctx
This is a short-term workaround, a more interesting solution would be to actually make sure recursive command invocations work properly

llvm-svn: 181537
2013-05-09 19:33:49 +00:00
Daniel Malea e347243061 Revert r181482 as it causes occasional hangs in LLDB buildbots
llvm-svn: 181526
2013-05-09 17:34:40 +00:00
Ashok Thirumurthi 582133e88e Skipping a test that asserts with gcc and icc to allow the test suite to run to completion on the gcc buildbot.
llvm-svn: 181512
2013-05-09 14:46:01 +00:00
Ashok Thirumurthi a91a561571 Fixed a build failure introduced by r181501.
Patch by Yao Qi.

llvm-svn: 181511
2013-05-09 13:58:54 +00:00
Greg Clayton 6e0ff1a3cb Changed the formerly pure virtual function:
namespace lldb_private {
    class Thread
    {
        virtual lldb::StopInfoSP
        GetPrivateStopReason() = 0;
    };
}

To not be virtual. The lldb_private::Thread now handles the correct caching and will call a new pure virtual function:

namespace lldb_private {
    class Thread
    {
        virtual bool
        CalculateStopInfo() = 0;
    }
}

This function must be overridden by thead lldb_private::Thread subclass and the only thing it needs to do is to set the Thread::StopInfo() with the current stop reason and return true, or return false if there is no stop reason. The  lldb_private::Thread class will take care of calling this function only when it is required. This allows lldb_private::Thread subclasses to be a bit simpler and not all need to duplicate the cache and invalidation settings.

Also renamed:

lldb::StopInfoSP
lldb_private::Thread::GetPrivateStopReason();

To:

lldb::StopInfoSP
lldb_private::Thread::GetPrivateStopInfo();

Also cleaned up a case where the ThreadPlanStepOverBreakpoint might not re-set its breakpoint if the thread disappears (which was happening due to a bug when using the OperatingSystem plug-ins with memory threads and real threads).

llvm-svn: 181501
2013-05-09 01:55:29 +00:00
Enrico Granata 083fcdb414 Providing a more interesting command template for LLDB
This one actually exploits the SB API to obtain information about your inferior process

llvm-svn: 181500
2013-05-09 01:32:24 +00:00
Sean Callanan 04b2bfa3a9 Add all Decls found through FindExternalLexicalDecls
to the DeclContext.  This fulfils the contract that
we make with Clang by returning ELR_AlreadyLoaded.

This is a little aggressive in that it does not allow
the ASTImporter to import the child decls with any
lexical parent other than the Decl that reported them
as children.

<rdar://problem/13517713>

llvm-svn: 181498
2013-05-09 01:09:49 +00:00
Enrico Granata da144dc216 Changing the std::map test case to use source breakpoints instead of relying on the nexting always "getting it right" to stop at the locations of interest
This should make us more robust in the face of changing compiler line tables and other library modifications

llvm-svn: 181497
2013-05-09 01:04:59 +00:00
Jim Ingham 77e82d1ebd Fix the error reporting for ProcessKDP::DoDetach.
llvm-svn: 181493
2013-05-09 00:05:35 +00:00
Greg Clayton 65c163529d Fixed the process attach by name test to get the target _after_ doing process attach. Otherwise the target isn't valid. This fixes 2 test suite failures on darwin.
llvm-svn: 181488
2013-05-08 23:45:06 +00:00
Greg Clayton dbe445fdd8 Remove debug print statement.
llvm-svn: 181486
2013-05-08 23:37:59 +00:00
Andrew Kaylor 14263f31ae Adding code to set thread state to stopped when the process stops.
llvm-svn: 181482
2013-05-08 23:15:46 +00:00
Enrico Granata 068c11096a Now that you can "command script import" packages, the docs should reflect the best practice
llvm-svn: 181475
2013-05-08 21:39:19 +00:00
Greg Clayton 610f9260fa Quiet g++-4.7 warnings about const issues and fix the scope of the "if (IsValid())".
llvm-svn: 181474
2013-05-08 21:35:24 +00:00
Enrico Granata b7d6e2a4e0 Test case added for importing packages
llvm-svn: 181472
2013-05-08 21:26:37 +00:00
Enrico Granata cc7f9bf51e <rdar://problem/13621080>
This commit changes the ${function.name-with-args} prompt keyword to also tackle structs
Previously, since aggregates have no values, this would show up as foo=(null)
This checkin changes that to instead print foo=(Foo at 0x123) (i.e. typename at address)
There are other potential choices here (summary, one-liner printout of all members, ...) and I would love to hear feedback about better options, if any

llvm-svn: 181462
2013-05-08 20:27:37 +00:00
Enrico Granata e1432cfe4c Improvements to the package importing feature - test case will follow
llvm-svn: 181461
2013-05-08 20:25:10 +00:00
Matt Kopec 23f23f4b7a Update lldb status page to reflect watchpoint support on Linux.
llvm-svn: 181460
2013-05-08 19:45:07 +00:00
Matt Kopec 4fadea28d1 Mark multi-threaded watchpoint test as skip on Linux due to lldb assertions in the debian buildbot.
llvm-svn: 181454
2013-05-08 17:52:17 +00:00
Matt Kopec 52c8476a47 Fix assertion from previous fix for debian os watchpoints.
Also mark one of the tests as expected fail on Linux due to the debian fix.

llvm-svn: 181448
2013-05-08 16:52:34 +00:00
Matt Kopec 667f12b53d Attempt to fix failing watchpoints for debian os buildbot.
llvm-svn: 181447
2013-05-08 16:10:09 +00:00
Daniel Malea 5d3e8a62e0 Remove distinction between Apple/Linux for Process run locks:
- Played with the current dual run lock implementation for a few days, noticed
  no regressions, so enabling in trunk so we see if any problems are detected
  by buildbots.

llvm-svn: 181446
2013-05-08 15:46:04 +00:00
Daniel Malea ee6481273e Adding test-case for llvm.org/pr15936 (known failure with GCC 4.6/4.7)
- verify that backtraces for stacks that include functions which contain 
  illegal instructions are correct, and that variables in said functions can be
  printed.

llvm-svn: 181442
2013-05-08 15:09:30 +00:00
Daniel Malea 32052b62ae Fix rdar-13338477 test-case for Linux.
- Using __builtin_trap confuses the stack unwinder
- __builtin_trap specific test will be added shortly

llvm-svn: 181441
2013-05-08 15:07:24 +00:00
Sean Callanan 1aee70b773 Fixed IRExecutionUnit build failures due to changes
in the underlying llvm::JITMemoryManager API.

llvm-svn: 181387
2013-05-08 01:30:52 +00:00
Jim Ingham 55d24311f2 If the MemoryCache is asked to look up an address that is in an invalid
range, it should set the error in the Error passed into the function.

llvm-svn: 181386
2013-05-08 01:20:53 +00:00
Jim Ingham 221d51cf84 Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value.  This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh!  I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.

Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming.  That allows 
us to handle resuming in a more controlled fashion.

Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--

M    test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M    include/lldb/Target/ThreadList.h
M    include/lldb/Target/ThreadPlanStepOut.h
M    include/lldb/Target/Thread.h
M    include/lldb/Target/ThreadPlanBase.h
M    include/lldb/Target/ThreadPlanStepThrough.h
M    include/lldb/Target/ThreadPlanStepInstruction.h
M    include/lldb/Target/ThreadPlanStepInRange.h
M    include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M    include/lldb/Target/ThreadPlanStepUntil.h
M    include/lldb/Target/StopInfo.h
M    include/lldb/Target/Process.h
M    include/lldb/Target/ThreadPlanRunToAddress.h
M    include/lldb/Target/ThreadPlan.h
M    include/lldb/Target/ThreadPlanCallFunction.h
M    include/lldb/Target/ThreadPlanStepOverRange.h
M    source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M    source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M    source/Target/StopInfo.cpp
M    source/Target/Process.cpp
M    source/Target/ThreadPlanRunToAddress.cpp
M    source/Target/ThreadPlan.cpp
M    source/Target/ThreadPlanCallFunction.cpp
M    source/Target/ThreadPlanStepOverRange.cpp
M    source/Target/ThreadList.cpp
M    source/Target/ThreadPlanStepOut.cpp
M    source/Target/Thread.cpp
M    source/Target/ThreadPlanBase.cpp
M    source/Target/ThreadPlanStepThrough.cpp
M    source/Target/ThreadPlanStepInstruction.cpp
M    source/Target/ThreadPlanStepInRange.cpp
M    source/Target/ThreadPlanStepOverBreakpoint.cpp
M    source/Target/ThreadPlanStepUntil.cpp
M    lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme

llvm-svn: 181381
2013-05-08 00:35:16 +00:00
Jason Molenda fa76156064 Add code to ReplaceDSYMSectionsWithExecutableSections() to handle the case where
a new section is added to the executable after the dSYM has been created, e.g.
the CTF segment added to mach_kernel after all other linking and processing has
been finished.
<rdar://problem/13258780> 

llvm-svn: 181375
2013-05-07 22:55:04 +00:00
Andrew Kaylor bf9b4c171a Adding support for process attach by pid on Linux.
llvm-svn: 181374
2013-05-07 22:46:38 +00:00
Enrico Granata 78f05f13ad Adding some LLDB-specific logic to the tracer (in a separate tracer module) to improve the quality of the output when debugging data formatters
(more improvements are necessary before this is really legible)

llvm-svn: 181367
2013-05-07 21:42:18 +00:00
Enrico Granata c8b36f160c First iteration of a Python tracer module
This module uses Python's sys.settrace() mechanism so setup a hook that can log every significant operation
This is a first step in providing a good debugging experience of Python embedded in LLDB
This module comprises an OO infrastructure that wraps Python's tracing and inspecting mechanisms, plus a very simple logging tracer
Output from this tracer looks like:

call print_keyword_args from <module> @ 243 args are kwargs are {'first_name': 'John', 'last_name': 'Doe'}
running print_keyword_args @ 228 locals are {'kwargs': {'first_name': 'John', 'last_name': 'Doe'}}
running print_keyword_args @ 229 locals are {'key': 'first_name', 'value': 'John', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}}
first_name = John
running print_keyword_args @ 228 locals are {'key': 'first_name', 'value': 'John', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}}
running print_keyword_args @ 229 locals are {'key': 'last_name', 'value': 'Doe', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}}
last_name = Doe
running print_keyword_args @ 228 locals are {'key': 'last_name', 'value': 'Doe', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}}
return from print_keyword_args value is None locals are {'key': 'last_name', 'value': 'Doe', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}}

llvm-svn: 181343
2013-05-07 19:49:59 +00:00
Matt Kopec e9ea0da82e Add watchpoint support for Linux on 64-bit host.
llvm-svn: 181341
2013-05-07 19:29:28 +00:00
Andrew Kaylor ba4e61d3f5 Reinstating r181091 and r181106 with fix for Linux regressions.
llvm-svn: 181340
2013-05-07 18:35:34 +00:00
Ashok Thirumurthi f5b92402bf Temporarily reverting r181091 and r181106 due to the vast test breakage on the Linux buildbots
while we develop a better understanding of how to manage the thread lists in a platform-independant fashion.

Reviewed by: Daniel Malea

llvm-svn: 181323
2013-05-07 15:01:34 +00:00
Enrico Granata e5cc5cd5ac Making it possible to specify a substring for a category name as long as the match is unique
llvm-svn: 181281
2013-05-07 00:36:28 +00:00
Jason Molenda a8ea4bae08 In ProcessKDP, if the remote connection is not EFI,
force this to be a DynamicLoaderDarwinKernel debug
session even if we didn't get back a load address
for the kernel.

llvm-svn: 181264
2013-05-06 23:02:03 +00:00
Enrico Granata 6e088d810e <rdar://problem/13063912>
If the user pressed ^D, that would bypass the exit confirmation mechanism
This checkin remedies that by making sure that users get prompted on exit when appropriate even if they use CTRL+D instead of typing quit at the prompt

llvm-svn: 181257
2013-05-06 22:10:33 +00:00
Daniel Malea 0b7c611f56 Fix typo in C++11 flag for the GCC 4.6 code path: missing '-'
llvm-svn: 181239
2013-05-06 19:31:31 +00:00
Enrico Granata 14b74fd153 <rdar://problem/11669154>
Make a summary format for libc++ STL containers that shows the number of items as before, but also shows the pointer value for pointer-to-container

llvm-svn: 181236
2013-05-06 18:55:52 +00:00
Enrico Granata 36aa5ae625 Converting ScanFormatDescriptor to use std::string instead of a manually managed buffer of bytes
llvm-svn: 181218
2013-05-06 17:18:22 +00:00
Jason Molenda db7d11c7a2 A few small fixes to make things like image list not
print "//mach_kernel" if you are debugging an executable
in the top level directory.

llvm-svn: 181190
2013-05-06 10:21:11 +00:00
Jason Molenda 513db4d9f4 Change ProcessKDP::UpdateThreadList's call to FindThreadByProtocolID
to not let it update the thread list or else we'll infinite recurse
call back to UpdateThreadList.

llvm-svn: 181106
2013-05-04 05:51:02 +00:00
Greg Clayton 1b7746e383 After recent OperatingsSystem plug-in changes, the lldb_private::Process and lldb_private::Thread subclasses were changed and the API was not respected properly.
This checkin aims to fix this. The process now has two thread lists: a real thread list for threads that are created by the lldb_private::Process subclass, and the user visible threads. The user visible threads are the same as the real threas when no OS plug-in in used. But when an OS plug-in is used, the user thread can be a combination of real and "memory" threads. Real threads can be placed inside of memory threads so that a thread appears to be different, but is still controlled by the actual real thread. When the thread list needs updating, the lldb_private::Process class will call the: lldb_private::Process::UpdateThreadList() function with the old real thread list, and the function is expected to fill in the new real thread list with the current state of the process. After this function, the process will check if there is an OS plug-in being used, and if so, it will give the old user thread list, the new real thread list and the OS plug-in will create the new user thread list from both of these lists. If there is no OS plug-in, the real thread list is the user thread list.

These changes keep the lldb_private::Process subclasses clean and no changes are required.

llvm-svn: 181091
2013-05-04 01:38:48 +00:00
Jason Molenda fe806906d4 fix a couple of clang static analyzer warnings.
Most important was a new[] + delete mismatch in ScanFormatDescriptor()
and a couple of possible memory leaks in FileSpec::EnumerateDirectory().

llvm-svn: 181080
2013-05-04 00:39:52 +00:00
Jason Molenda c16b4af0d7 Remove the UUID::GetAsCString() method which required a buffer to save the
UUID string in; added UUID::GetAsString() which returns the uuid string in
a std::string.  Updated callers to use the new method.

llvm-svn: 181078
2013-05-03 23:56:12 +00:00
Enrico Granata 3880c4cebd Don’t use the resolved value to calculate the location unless the variable is in a register
This was causing a bunch of test cases to fail in python_api/process since they relied on SBValue::GetLocation()

llvm-svn: 181075
2013-05-03 23:28:47 +00:00
Greg Clayton b23b11300a Unbreak lldb/test/macosx/universal.
llvm-svn: 181074
2013-05-03 23:22:20 +00:00
Greg Clayton 5fe0e7b2f6 Fixed a test suite typo error that caused the test to fail.
llvm-svn: 181069
2013-05-03 23:04:47 +00:00
Jim Ingham a8ca6e2145 Don't check the private state in DoOnRemoval, check whether THIS event caused a restart.
rdar://problem/13788593

llvm-svn: 181068
2013-05-03 23:04:37 +00:00
Jason Molenda 60e58967f9 Small adjustment to PlatformDarwinKernel::ExamineKextForMatchingUUID to
help performance -- if the FileSpec we're examining does not contain the
UUID we're looking for, don't bother examining the file any further.

llvm-svn: 181063
2013-05-03 22:28:10 +00:00
Greg Clayton aa49c83cd9 Clear up any deadlocks on Apple builds that were due to the lldb_private::Process.m_private_run_lock variable.
If someone on Linux and/or FreeBSD can try to comment out the " #if defined(__APPLE__)" that surrounds access to "m_private_run_lock" and run the test suite, that would be nice. The new location where the locking/unlocking happens is bulletproof on MacOSX, and I want to verify that it is good on linux as well.

llvm-svn: 181061
2013-05-03 22:25:56 +00:00
Ashok Thirumurthi d36712df8d Refactoring for struct UserArea:
- Decouples RegisterContext_x86_64 from UserArea.
- Restores the original definition of UserArea so that it can be used to generate offsets for use with ptrace.
- Moves UserArea to the 64-bit Linux specialization.

- Also fixes an off-by-one error for the size of m_gpr.
- Also adds a TODO comment noting the need for a mechanism to identify the correct plugin based on the target OS (and architecture).

Reviewed by: Matt Kopec and Samuel Jacob

llvm-svn: 181055
2013-05-03 20:00:17 +00:00
Andrew Kaylor 3a8625dda9 Fix logic error in ProcessInfo::SetArg0
llvm-svn: 181049
2013-05-03 19:38:09 +00:00
Enrico Granata 4ffff2791f Harden against potential empty nodes in the map
llvm-svn: 181045
2013-05-03 19:07:20 +00:00
Enrico Granata d03a273b96 <rdar://problem/13749871>
Improvements to the std::map data formatter to recognize when invalid memory is being explored and bail out instead of looping for a potentially very long time

llvm-svn: 181044
2013-05-03 19:04:35 +00:00
Greg Clayton 6991afe31b Added a few things that need to be installed on linux to build LLDB.
llvm-svn: 181028
2013-05-03 16:29:42 +00:00
Ashok Thirumurthi d77e8aefe3 Fixed 'command script import' by eliminating the shadowing of basename.
Reviewed by: Daniel Malea

llvm-svn: 181027
2013-05-03 15:56:59 +00:00
Sylvestre Ledru 5b5a6e0162 Fixed the build to reflect the removal of OperatingSystem/Darwin-Kernel in r180993.
llvm-svn: 181024
2013-05-03 15:28:03 +00:00
Ashok Thirumurthi 72b4c8dce3 Fixed the build to reflect the removal of OperatingSystem/Darwin-Kernel in r180993.
llvm-svn: 181018
2013-05-03 14:45:11 +00:00
Jason Molenda 9dbe9e630e Add a hard limit to how many frames lldb will unwind in a single
thread before UnwindLLDB::AddOneMoreFrame calls it quits.  We have
a couple of reports of unending backtraces in the field and we
haven't been able to collect any information about what kind of
backtrace is causing this.  We've found on Mac OS X that it's tricky
to get more than around 200k stack frames before a process exceeds
its stack space so we're starting with a hard limit of 300,000 frames.
<rdar://problem/13383069> 

llvm-svn: 180995
2013-05-03 04:48:41 +00:00
Jason Molenda 90e536caf7 Remove the initialization/termination of the now-removed OperatingSystemDarwinKernel.
llvm-svn: 180994
2013-05-03 03:55:48 +00:00
Greg Clayton e26dcbddda Remove unused OperatingSystem plugin.
llvm-svn: 180993
2013-05-03 03:05:52 +00:00
Jason Molenda 0faf3311fa Pass down the architecture of the module we're trying to
match when looking at kext on the local filesystem.
<rdar://problem/13785112> 

llvm-svn: 180989
2013-05-03 01:31:44 +00:00
Enrico Granata c3387333ce <rdar://problem/11742979>
SWIG is smart enough to recognize that C++ operators == and != mean __eq__ and __ne__ in Python and do the appropriate translation
But it is not smart enough to recognize that mySBObject == None should return False instead of erroring out
The %pythoncode blocks are meant to provide those extra smarts (and they play some SWIG&Python magic to find the right function to call behind the scenes with no risk of typos :-)
Lastly, SBBreakpoint provides an == but never provided a != operator - common courtesy is to provide both

llvm-svn: 180987
2013-05-03 01:29:27 +00:00
Greg Clayton a80ea12703 <rdar://problem/13751683>
Make sure to handle all thumb variants correctly.

llvm-svn: 180984
2013-05-03 01:05:04 +00:00
Andrew Kaylor 46791da61a Adding test for non-API process attach
llvm-svn: 180977
2013-05-03 00:10:27 +00:00
Enrico Granata bfa9fb134b <rdar://problem/11558812>
Allow command script import to load packages.

e.g.:
egranata$ ./lldb
(lldb) command script import lldb.macosx.crashlog
"crashlog" and "save_crashlog" command installed, use the "--help" option for detailed help
"malloc_info", "ptr_refs", "cstr_refs", and "objc_refs" commands have been installed, use the "--help" options on these commands for detailed help.
The "unwind-diagnose" command has been installed, type "help unwind-diagnose" for detailed help.
(lldb) 

./lldb
(lldb) command script import theFoo
I am happy
(lldb) fbc
àèìòù
(lldb)

egranata$ ls theFoo/
__init__.py theBar.py

egranata$ cat theFoo/__init__.py 
import lldb
import theBar

def __lldb_init_module(debugger, internal_dict):
	print "I am happy"
	debugger.HandleCommand("command script add -f theFoo.theBar.theCommand fbc")
	return None

egranata$ cat theFoo/theBar.py 
#encoding=utf-8

def theCommand(debugger, command, result, internal_dict):
	result.PutCString(u"àèìòù")
	return None

llvm-svn: 180975
2013-05-02 23:57:33 +00:00
Jim Ingham 076b7fc608 If HandleCommands is called with add_to_history set to false, turn on the m_command_source_depth so that when we forget the value for regex & alias commands it still stays off.
<rdar://problem/13795202>

llvm-svn: 180971
2013-05-02 23:15:37 +00:00
Enrico Granata 78081be1be <rdar://problem/13732521>
Updated the logic for the Sketch test case

llvm-svn: 180966
2013-05-02 22:40:22 +00:00
Greg Clayton 5378bbaec0 Mark TestConstVariables as expected to fail due to radar 13314878 on darwin. The tests are already skipped on linux.
llvm-svn: 180965
2013-05-02 22:19:05 +00:00
Greg Clayton 864fa8c085 <rdar://problem/13788674>
TestPlatformCommand failing on buildbot.

llvm-svn: 180963
2013-05-02 22:07:16 +00:00
Jason Molenda a4ce253819 If the Target's current architecture is incompatible with the kernel
DynamicLoaderDarwinKernel finds in memory, have DynamicLoaderDarwinKernel
re-set the Target's arch based on the kernel's cpu type / cpu subtype.

llvm-svn: 180962
2013-05-02 22:02:57 +00:00
Greg Clayton 6ad5269558 <rdar://problem/13788579>
TestRegisters failing on buildbot on MacOSX. Some registers that were valid for linux/freebsd, were not valid on MacOSX. The tests now allow a register be skipped if it doesn't exist on the host.

llvm-svn: 180961
2013-05-02 22:00:02 +00:00
Daniel Malea 55faa40823 Fix check_public_api_headers test on mac os x, and refactor some logic into lldbtest.py
- moved build logic from Makefile and TestPublicAPIHeaders.py into lldbtest to allow reuse
- added decorator @skipIfi386

llvm-svn: 180955
2013-05-02 21:44:31 +00:00
Daniel Malea c7da5d0122 Add missing include to LLDB.h -- SBStream
llvm-svn: 180954
2013-05-02 21:42:13 +00:00
Ashok Thirumurthi 759a217dab Changing the test to use eax rather than rax for compatibility with i386.
llvm-svn: 180952
2013-05-02 21:15:23 +00:00
Enrico Granata a9a50ffb02 <rdar://problem/13338477>
clang sugarcoats expressions of the sort *(int (*)[3])foo where foo is an int* saying that their type class is Paren
This checkin updates our lookup tables to properly desugar Paren into the actual type of interest

llvm-svn: 180938
2013-05-02 18:54:54 +00:00
Enrico Granata e55f77aec8 <rdar://problem/13499317>
Enabling Python commands to produce Unicode output via:

result.PutCString(u”whatever”)

llvm-svn: 180930
2013-05-02 17:29:04 +00:00
Greg Clayton 05e2c79f87 We aren't ready for the assertions to be enabled on the ReadWriteLock classes yet.
llvm-svn: 180928
2013-05-02 17:17:05 +00:00
Greg Clayton 4fea4f27e3 Clear the register context if our process is no longer alive.
llvm-svn: 180927
2013-05-02 17:16:00 +00:00
Jim Ingham c56781fffa This is a useful scheme for running a particular testsuite case under Xcode. Just edit the
run arguments to include the directory of the test you want to run, and run the scheme.

llvm-svn: 180926
2013-05-02 17:04:10 +00:00
Daniel Malea 5eff59e74c Update CMakeLists with RegisterContext* files added
llvm-svn: 180920
2013-05-02 15:23:53 +00:00
Greg Clayton bca31a3d64 Correctly create the register contexts in RegisterContextThreadMemory.
llvm-svn: 180908
2013-05-02 04:15:24 +00:00
Sean Callanan 3fa3e65d3b Since the IR interpreter does not (currently)
support operands with vector types, it now reports
that it cannot interpret expressions that use
vector types.  They get sent to the JIT instead.

<rdar://problem/13733651>

llvm-svn: 180899
2013-05-02 00:33:44 +00:00
Jim Ingham acff895015 Recommitting r180831 with trivial fix - remember to return errors if you compute.
llvm-svn: 180898
2013-05-02 00:27:30 +00:00
Greg Clayton 7060f8976c Return zero when we don't support the byte size. Previously is we were asked to read 3, 5, 6, or 7 byte integers, we would set the error, but still return that we read that number of bytes without populating the scalar.
llvm-svn: 180896
2013-05-01 23:41:30 +00:00
Sean Callanan 16f45ca6ba Make our eliding of artificially-generated methods
in debug information more aggressive.  Emitting
classes containing these methods causes crashes in
Clang when dealing with complex code bases.

<rdar://problem/12640887>

llvm-svn: 180895
2013-05-01 23:18:34 +00:00
Sean Callanan 7f13bd7678 Fixed Process::ReadScalarIntegerFromMemory()
to report proper errors when the size is not
correct.

<rdar://problem/13784456>

llvm-svn: 180888
2013-05-01 22:01:40 +00:00
Greg Clayton 160c9d81e0 <rdar://problem/13700260>
<rdar://problem/13723772>

Modified the lldb_private::Thread to work much better with the OperatingSystem plug-ins. Operating system plug-ins can now return have a "core" key/value pair in each thread dictionary for the OperatingSystemPython plug-ins which allows the core threads to be contained with memory threads. It also allows these memory threads to be stepped, resumed, and controlled just as if they were the actual backing threads themselves.

A few things are introduced:
- lldb_private::Thread now has a GetProtocolID() method which returns the thread protocol ID for a given thread. The protocol ID (Thread::GetProtocolID()) is usually the same as the thread id (Thread::GetID()), but it can differ when a memory thread has its own id, but is backed by an actual API thread.
- Cleaned up the Thread::WillResume() code to do the mandatory parts in Thread::ShouldResume(), and let the thread subclasses override the Thread::WillResume() which is now just a notification.
- Cleaned up ClearStackFrames() implementations so that fewer thread subclasses needed to override them
- Changed the POSIXThread class a bit since it overrode Thread::WillResume(). It is doing the wrong thing by calling "Thread::SetResumeState()" on its own, this shouldn't be done by thread subclasses, but the current code might rely on it so I left it in with a TODO comment with an explanation.

llvm-svn: 180886
2013-05-01 21:54:04 +00:00
Ashok Thirumurthi 0f3b9b819a Build fixes for FreeBSD 9.1.
- TODO: Support extended register sets on FreeBSD.

Patch by Samuel Jacob.

llvm-svn: 180879
2013-05-01 20:38:19 +00:00