Commit Graph

4551 Commits

Author SHA1 Message Date
Andy Gibbs 70f94f9712 Fix some more mismatched integer types causing compiler warnings.
llvm-svn: 184737
2013-06-24 14:04:57 +00:00
Jim Ingham 02ff8e0931 Remember to update the m_thread_list_real after you do UpdateThreadList.
<rdar://problem/14147303>

llvm-svn: 184622
2013-06-22 00:55:02 +00:00
Jim Ingham dee1bc98f9 Add some useful logging for tracking thread matching problems.
llvm-svn: 184619
2013-06-22 00:27:45 +00:00
Han Ming Ong ef171f24d3 <rdar://problem/14004410>
Remove old GetNextThreadIndexID() from lldb

llvm-svn: 184600
2013-06-21 22:38:16 +00:00
Han Ming Ong 399289e931 <rdar://problem/13980489>
I added scan type to ‘qGetProfileData’ previously but forgot to update the check to be a substring search.

llvm-svn: 184588
2013-06-21 19:56:59 +00:00
Enrico Granata 2c75f11e86 Adding two new markers to the ${var..} specifier
- %N = show the name of the variable
- %> = show the expression path of the variable

llvm-svn: 184502
2013-06-21 00:04:51 +00:00
Enrico Granata aad8e48054 In thread and frame format strings, it is now allowed to use Python functions to generate part or all of the output text
Specifically, the ${target ${process ${thread and ${frame specifiers have been extended to allow a subkeyword .script:<fctName> (e.g. ${frame.script:FooFunction})
The functions are prototyped as

def FooFunction(Object,unused)

where object is of the respective SB-type (SBTarget for target.script, ... and so on)

This has not been implemented for ${var because it would be akin to a Python summary which is already well-defined in LLDB

llvm-svn: 184500
2013-06-20 23:40:21 +00:00
Jim Ingham c575a37ac9 Don't go to the trouble of trying to figure out the implementation function for selectors sent
to nil objects, it won't work anyway.

llvm-svn: 184474
2013-06-20 21:36:52 +00:00
Sean Callanan a4e8105bfd Fixed a problem with materialization and
dematerialization of registers that caused
conditional breakpoint expressions not to
work properly.  Also added a testcase.

<rdar://problem/14129252>

llvm-svn: 184451
2013-06-20 18:42:16 +00:00
Greg Clayton e2c93dafc7 Fixed a crasher that I encountered when looking up a virtual base class offset.
llvm-svn: 184390
2013-06-20 01:24:52 +00:00
Greg Clayton 0fc4f31e4b Unique types a bit more using the clang type to make sure we don't get multiple copies of the same type due to the debug info having multiple types that get uniqued.
llvm-svn: 184388
2013-06-20 01:23:18 +00:00
Greg Clayton d8c3d4b1e9 Implemented a types.py module that allows types to be inspected for padding.
The script was able to point out and save 40 bytes in each lldb_private::Section by being very careful where we need to have virtual destructors and also by re-ordering members.

llvm-svn: 184364
2013-06-19 21:50:28 +00:00
Andy Gibbs 897f50c5ba Use LLDB_INVALID_REGNUM at Mike Sartain's suggestion
llvm-svn: 184342
2013-06-19 20:04:56 +00:00
Enrico Granata c71f349a9e <rdar://problem/14005652>
Fixing a bug with the NSString data formatter where some strings would be truncated

llvm-svn: 184336
2013-06-19 19:15:29 +00:00
Andy Gibbs 44f4db784b Fix two 'variable is used uninitialised' warnings. Change assert to llvm_unreachable.
llvm-svn: 184334
2013-06-19 19:05:52 +00:00
Andy Gibbs a297a97e09 Sort out a number of mismatched integer types in order to cut down the number of compiler warnings.
llvm-svn: 184333
2013-06-19 19:04:53 +00:00
Enrico Granata 5c47969350 Improvements to "command script import" to better support reloading in Xcode
Xcode spawns a new LLDB SBDebugger for each debug session, and this was causing the reloading of python modules to fail across debug sessions

(long story short: the module would not be loaded in the current instance of the ScriptInterpreter, but would still be present in sys.modules, hence the import call would just make a copy of it and not run it again
Greg's new decorator uncovered the issue since it relies on actually loading the module's code rather than using __lldb_init_module as the active entity)

This patch introduces the notion of a local vs. global import and crafts an appropriate command to allow reloading to work across debug sessions

llvm-svn: 184279
2013-06-19 03:05:52 +00:00
Jim Ingham fc65a50f41 Don't actually Halt in the Interrupt handler for the Process, just send an AsyncInterrupt.
That's actually not async-signal-clean, but it is a lot safer than Halt...

llvm-svn: 184270
2013-06-19 00:56:17 +00:00
Enrico Granata 08a1bb8199 <rdar://problem/14194140>
Adding support for correctly extracting children out of vector types for data formatter purposes

llvm-svn: 184262
2013-06-19 00:00:45 +00:00
Greg Clayton f02500c74c Added the ability to get a list of types from a SBModule or SBCompileUnit. Sebastien Metrot wanted this, and sent a hollowed out patch. I filled in the blanks and did the low level implementation. The new functions are:
//------------------------------------------------------------------
/// Get all types matching \a type_mask from debug info in this
/// module.
///
/// @param[in] type_mask
///     A bitfield that consists of one or more bits logically OR'ed
///     together from the lldb::TypeClass enumeration. This allows
///     you to request only structure types, or only class, struct
///     and union types. Passing in lldb::eTypeClassAny will return
///     all types found in the debug information for this module.
///
/// @return
///     A list of types in this module that match \a type_mask
//------------------------------------------------------------------
lldb::SBTypeList
SBModule::GetTypes (uint32_t type_mask)


//------------------------------------------------------------------
/// Get all types matching \a type_mask from debug info in this
/// compile unit.
///
/// @param[in] type_mask
///    A bitfield that consists of one or more bits logically OR'ed
///    together from the lldb::TypeClass enumeration. This allows
///    you to request only structure types, or only class, struct
///    and union types. Passing in lldb::eTypeClassAny will return
///    all types found in the debug information for this compile
///    unit.
///
/// @return
///    A list of types in this compile unit that match \a type_mask
//------------------------------------------------------------------
lldb::SBTypeList
SBCompileUnit::GetTypes (uint32_t type_mask = lldb::eTypeClassAny);

This lets you request types by filling out a mask that contains one or more bits from the lldb::TypeClass enumerations, so you can only get the types you really want.

llvm-svn: 184251
2013-06-18 22:51:05 +00:00
Enrico Granata a2e7f9ab2b <rdar://problem/14194128>
ClangASTContext was failing to retrieve fields and base class info for ObjC variables
This checkin fixes that and adds a test case

llvm-svn: 184248
2013-06-18 22:40:36 +00:00
Matt Kopec 246a89562c Add assertion for when no watchpoint found in POSIX watchnotify handler.
Also, ensure x86_64 watchpoint registers are initialized before they are accessed on the POSIX side.

llvm-svn: 184246
2013-06-18 21:58:02 +00:00
Jim Ingham c64623179b We were getting an assert because somebody was making a watchpoint that was
neither read nor write.  Tighten up the checking so this isn't possible.

<rdar://problem/14111167>

llvm-svn: 184245
2013-06-18 21:52:48 +00:00
Matt Kopec 362f503519 Temporarily disable checking of watchpoint hit on FreeBSD on trace message.
Patch from Ed Maste.

llvm-svn: 184241
2013-06-18 21:35:32 +00:00
Jason Molenda a721731fdd PlatformDarwinKernel was treating its file path arg as a kext bundle id -- but when the user
did a manual "target modules add", it would be a file path.  If the kext bundle lookup fails,
fall back to calling PlatformDarwin's GetSharedModule which will handle a file path correctly.
<rdar://problem/14179858> 

llvm-svn: 184237
2013-06-18 21:23:14 +00:00
Jim Ingham cc0273d784 Fix the help for "image dump line-table" - its arguments are compilation units not modules.
llvm-svn: 184226
2013-06-18 20:27:11 +00:00
Adrian Prantl 5eeaf7402b Fix a missing pointer deref that was uncovered by one of the buildbots.
llvm-svn: 184216
2013-06-18 18:24:04 +00:00
Enrico Granata 68ae4117d9 <rdar://problem/12717717>
Modifying our data formatters matching algorithm to ensure that "const X*" is treated as equivalent to "X*"
Also, a couple improvements to the "lldb types" logging

llvm-svn: 184215
2013-06-18 18:23:07 +00:00
Enrico Granata 5342c4409b This patch fixes the issue where our command-line tab completer would sometimes replicate commands
e.g.

(lldb) pl<TAB>
Available completions:
	platform
	plugin
	platform
	plugin

Thanks to Matthew Sorrels for doing work and testing on this issue

llvm-svn: 184212
2013-06-18 18:01:08 +00:00
Bill Wendling d63d0a8fe3 Update to new API.
llvm-svn: 184177
2013-06-18 07:50:43 +00:00
Enrico Granata ca5acdbef8 <rdar://problem/13270271>
Only add the — (double dash) separator to a command syntax if it has any options to be separated from arguments
Also remove the unused Translate() method from CommandObject 

llvm-svn: 184163
2013-06-18 01:17:46 +00:00
Enrico Granata 9b27c6f0d4 <rdar://problem/13926101>
Allow “command script import” to work with folder names that have a ‘ (tick) in them

Kudos to StackOverflow (question 1494399) for the replace_all code!

llvm-svn: 184158
2013-06-18 00:58:06 +00:00
Greg Clayton 0076e71592 A collection of 3 patches to the COFF file ObjectFile parser from Virgile Bello:
3 patches, aiming to improve PE/COFF support:
- First patch fix symbol reading (invalid header size from sizeof() == 20 != 18, and various bugfixes such as invalid skipping of auxiliary symbols, 4 bytes shift from beginning, etc...).
- Second patch add image_base to section vmaddr offset so that VM addr is in image_base space.
- Third patch add support for DWARF section in PECOFF (taken from ELF counterpart), since they are generated by gcc/clang under windows.

llvm-svn: 184153
2013-06-18 00:08:58 +00:00
Enrico Granata 63123b6484 Renaming the "--wipe" option to "command history" to "--clear" (-C) for coherence with the rest of the LLDB command-line interface
llvm-svn: 184147
2013-06-17 23:28:27 +00:00
Michael Sartain 9eb4cc6266 Add new files to CMakeLists.txt to fix cmake build error.
llvm-svn: 184143
2013-06-17 23:07:22 +00:00
Enrico Granata 7594f14f7d <rdar://problem/14134716>
This is a rewrite of the command history facility of LLDB

It takes the history management out of the CommandInterpreter into its own CommandHistory class
It reimplements the command history command to allow more combinations of options to work correctly (e.g. com hist -c 1 -s 5)
It adds a new --wipe (-w) option to command history to allow clearing the history on demand
It extends the lldbtest runCmd: and expect: methods to allow adding commands to history if need be
It adds a test case for the reimplemented facility

llvm-svn: 184140
2013-06-17 22:51:50 +00:00
Sean Callanan ad7cc466d7 Fixed a problem in the expression parser that
caused the IR interpreter not to work if the
process had finished running.

<rdar://problem/14124301>

llvm-svn: 184125
2013-06-17 21:19:31 +00:00
Michael Sartain d55eadf0be Add newer Linux AT_ defines from elf.h.
llvm-svn: 184094
2013-06-17 17:44:53 +00:00
Michael Sartain c493bd1f59 Remove extra modules.Append() as it causes dupes in the m_images array. (Used with image list, etc.)
llvm-svn: 184082
2013-06-17 15:35:42 +00:00
Michael Sartain ff5b497c1f Fix unitialized variable in AuxVector::GetEntryName() which crashed in AuxVector::DumpToLog
llvm-svn: 184023
2013-06-15 00:25:52 +00:00
Rafael Espindola d0c19ec0af Fix the build. clang/Driver/OptTable.h was removed.
llvm-svn: 183991
2013-06-14 18:04:50 +00:00
Greg Clayton 1d4c540688 Added a SBSection::GetParent() to the API.
llvm-svn: 183948
2013-06-13 21:23:23 +00:00
Rafael Espindola ffcfa52e2a Don't depend on the transitive inclusion of PathV1.h
llvm-svn: 183946
2013-06-13 21:10:56 +00:00
Rafael Espindola 09079162ee Don't depend on set being transitively included.
llvm-svn: 183936
2013-06-13 20:10:23 +00:00
Greg Clayton 405fab9062 Be sure to print out the full file path when dumping breakpoint resolvers for file and line when the full path was specified.
llvm-svn: 183932
2013-06-13 19:39:56 +00:00
Rafael Espindola ff89ff297f Update for llvm change.
llvm-svn: 183929
2013-06-13 19:25:41 +00:00
Rafael Espindola 6ba87f65e6 Use the global functions instead of the Program methods.
llvm-svn: 183862
2013-06-12 20:47:14 +00:00
Enrico Granata 9b62d1d5ee <rdar://problem/11914077>
If you type help command <word> <word> <word> <missingSubCommand> (e.g. help script import or help type summary fake), you will get help on the deepest matched command word (i.e. script or type summary in the examples)
Also, reworked the logic for commands to produce their help to make it more object-oriented

llvm-svn: 183822
2013-06-12 01:50:57 +00:00
Greg Clayton d8cf1a119d Huge performance improvements when one breakpoint contains many locations.
325,000 breakpoints for running "breakpoint set --func-regex ." on lldb itself (after hitting a breakpoint at main so that LLDB.framework is loaded) used to take up to an hour to set, now we are down under a minute. With warm file caches, we are at 40 seconds, and that is with setting 325,000 breakpoint through the GDB remote API. Linux and the native debuggers might be faster. I haven't timed what how much is debug info parsing and how much is the protocol traffic to/from GDB remote.

That there were many performance issues. Most of them were due to storing breakpoints in the wrong data structures, or using the wrong iterators to traverse the lists, traversing the lists in inefficient ways, and not optimizing certain function name lookups/symbol merges correctly.

Debugging after that is also now very efficient. There were issues with replacing the breakpoint opcodes in memory that was read, and those routines were also fixed.

llvm-svn: 183820
2013-06-12 00:46:38 +00:00
Enrico Granata aded51daeb <rdar://problem/13299214>
Make the error message here more interesting for the user

llvm-svn: 183818
2013-06-12 00:44:43 +00:00
Enrico Granata 6f63001879 Removing a redundant write
llvm-svn: 183814
2013-06-12 00:32:31 +00:00
Enrico Granata e34ade7986 Improvements to the data formatters SB API:
- exposing new accessors: formats/format, ..., that allow you to iterate over all formatters
 e.g. sys_category = lldb.debugger.GetCategory("system").summary['char *']
- ensuring that C++-based synthetic children provider can at least print their description accurately, if nothing else

llvm-svn: 183805
2013-06-11 22:58:32 +00:00
Greg Clayton bc8fc0f5e0 Use llvm::APFloat for formatting if a target is available. Each target when debugging has a "ASTContext" that helps us to use the correct floating point semantics. Now that APFloat supports toString we now use that. If we don't have a target, we still fall back on the old display methodology, but the important formatting should always have a target available and thus use the compiler floating point code.
Modified the test programs to use floating point constants that always will display correctly. We had some numbers that were being rounded, and now that we are using clang, we no longer round them and we get more correct results.

llvm-svn: 183792
2013-06-11 21:56:55 +00:00
Enrico Granata 05db523f3c Making our Python decrefs NULL-safe
llvm-svn: 183774
2013-06-11 19:13:50 +00:00
Enrico Granata 7bd2bbb9ac <rdar://problem/13779789>
Allow memory read -t to take persistent types (those defined with expression struct $....)

llvm-svn: 183766
2013-06-11 18:47:55 +00:00
Greg Clayton 3fb543b06d Remove eFormatHalfFloat as it isn't needed. eFormatFloat should be used and the byte size will tell us how to display it.
llvm-svn: 183755
2013-06-11 17:32:06 +00:00
Enrico Granata 012d4fcaf0 <rdar://problem/12876503>
Adding a new setting interpreter.stop-command-source-on-error that dictates a default behavior for whether command source should stop upon hitting an error
You can still override the setting for each individual invocation with the usual -e setting

llvm-svn: 183719
2013-06-11 01:26:35 +00:00
Enrico Granata 97fe23e00a <rdar://problem/12783351>
Add support for half-floats, as specified by IEEE-754-2008
With this checkin, you can now say:
(lldb) x/7hf foo

to read 7 half-floats at address foo

llvm-svn: 183716
2013-06-11 00:18:18 +00:00
Enrico Granata 4c648b1884 <rdar://problem/14101771>
Hardening the CFBitVector data formatter against failed reads

llvm-svn: 183706
2013-06-10 22:26:15 +00:00
Matt Kopec b96a126b5b Add output of fault address on an address related crash (ie. segfault).
llvm-svn: 183701
2013-06-10 22:14:47 +00:00
Jim Ingham 4e5c821087 Don't retry the Connect when starting up debugserver if the reason for the previous failure was
EINTR.  That means the user was trying to interrupt us, and we should just stop instead.

<rdar://problem/13184758>

llvm-svn: 183577
2013-06-07 22:09:53 +00:00
Jim Ingham e96ade8bf6 Make the "SearchFilterByModuleListAndCU" work correctly for searches at the CompUnit
level.  Fixes a bug in "break set --source-pattern-regexp" when a shared library is
specified.  

Also cleaned up the help text for --source-pattern-regexp so it is a little clearer.

<rdar://problem/14084261>

llvm-svn: 183476
2013-06-07 01:13:00 +00:00
Greg Clayton 649f8b9b0b <rdar://problem/14086944>
lldb doesn't autocomplete objective C class methods. The regular expression was looking for strings that started with the completion string that was passed in. For objective C class methods, this string starts with "+" which wasn't being escaped. Added many other escapes that were missing just in case.

llvm-svn: 183470
2013-06-07 00:35:40 +00:00
Enrico Granata 39cf804683 <rdar://problem/14083928>
Making sure that if you invoke LLDB as lldb ./someBinary you can then launch the inferior with process launch —tty

llvm-svn: 183453
2013-06-06 22:23:02 +00:00
Jim Ingham d3480f5851 Address::GetSection() turns a weak pointer to a shared pointer which is a little slow. So in Address::operator== & != do the
cheap GetOffset() comparison first and only compare the sections if that is true.

llvm-svn: 183452
2013-06-06 22:16:56 +00:00
Sean Callanan 544053e353 Hardened the IR interpreter to prevent it from
reading non-standard value sizes.

<rdar://problem/14081292>

llvm-svn: 183448
2013-06-06 21:14:35 +00:00
Sean Callanan b4987e32fd Fixed a problem where evaluating a breakpoint
condition in two different processes (with the
same target) could cause crashes.  Now the breakpoint
condition is always evaluated (and possibly parsed)
by one thread at a time.

<rdar://problem/14083737>

llvm-svn: 183440
2013-06-06 20:18:50 +00:00
Sean Callanan 415422ce76 Fixes for the IR interpreter:
- Implemented the SExt instruction, and

 - eliminated redundant codepaths for constant
   handling.

Added test cases.

<rdar://problem/13244258>
<rdar://problem/13955820>

llvm-svn: 183344
2013-06-05 22:07:06 +00:00
Enrico Granata b26fdada54 <rdar://problem/13125225>
Adding data formatters for std::set, std::multiset and std::multimap for libc++
The underlying data structure is the same as std::map, so this change is very minimal and mostly consists of test cases

llvm-svn: 183323
2013-06-05 17:47:23 +00:00
Ashok Thirumurthi a3dd4899e8 Use std::vector for the array of RegisterInfo structs that describe the register context.
- Ensures that this container is populated once for the lifetime of lldb
--- In particular, static methods can query this data even after the first RegisterContext has been destroyed.
- Uses a singleton function to avoid global constructors.

Thanks to Greg Clayton for the suggestion!

llvm-svn: 183313
2013-06-05 14:12:43 +00:00
Jason Molenda 23399d765c Change UnwindLLDB::SearchForSavedLocationForRegister so that it will allow for
the link register save location being in the link register - in which case we
should iterate down the stack, not recursively try to find the lr in the current
frame over and over.

<rdar://problem/13932954>

llvm-svn: 183282
2013-06-05 00:12:50 +00:00
Jim Ingham 31caf980c6 Remember to tell the breakpoints to update themselves when new symbols are added.
<rdar://problem/14054840>

llvm-svn: 183277
2013-06-04 23:01:35 +00:00
Enrico Granata d325bf9da1 <rdar://problem/13239809>
Two things:
1) fixing a bug where memory read was not clearing the m_force flag after it was passed, so that subsequent memory reads would not need to be forced even if over boundary
2) adding a setting target.max-memory-read-size that you can set instead of the hardcoded 1024 bytes limit we had before

llvm-svn: 183276
2013-06-04 22:54:16 +00:00
Enrico Granata daa0ac48e6 <rdar://problem/12582328>
If you want to define a formatter for "array of Foo of any size", ordinarily you would say

-x "Foo \[[0-9]+\]"

this checkin allows you to instead say "Foo[]" (or "Foo []") and LLDB will automatically create the regular expression and add the -x flag on your behalf

llvm-svn: 183272
2013-06-04 22:25:36 +00:00
Enrico Granata 983920d1a9 <rdar://problem/14003462>
Formatters for unsigned char* and const variant

llvm-svn: 183254
2013-06-04 21:53:55 +00:00
Greg Clayton 76ea03ea7b Add a more clear explanation of what is missing for core files with no LC_THREAD load commands.
llvm-svn: 183253
2013-06-04 21:48:36 +00:00
Greg Clayton 9645e82ce2 Make sure a core file has thread contexts before we try and load it.
llvm-svn: 183252
2013-06-04 21:34:37 +00:00
Greg Clayton e86cef633b Fixed printf build warning.
llvm-svn: 183250
2013-06-04 21:30:42 +00:00
Greg Clayton a3f14d8bf1 <rdar://problem/13941992>
Accept mach-o files with bad segments. Many core files are not created correctly and we should still be able to glean any information we can from them.

llvm-svn: 183247
2013-06-04 20:27:06 +00:00
Daniel Malea 6f0a5edb3f More minor FreeBSD fixes.
- link libexecinfo (as libc is missing backtrace())
- enable FreeBSD-specific plugins

Patch by Ed Maste!

llvm-svn: 183233
2013-06-04 15:59:01 +00:00
Jim Ingham 60c4118c88 If ThreadPlanCallFunction hasn't set its notion of the "real stop info" yet, just return the current PrivateStopInfo.
Also renamed a few more places where we were using StopReason in functions that were returning StopInfo's.

<rdar://problem/14042692>

llvm-svn: 183177
2013-06-04 01:40:51 +00:00
Daniel Malea f051dbce73 Fix crash (in optimized builds) due to invalid metadata operand
- ConstantDataArray is not a valid MDNode operand
- encode function-name strings in metadata by wrapping in an MDString instead

- should resolve reported by http://llvm-jenkins.debian.net/job/llvm-toolchain-quantal-binaries/architecture=amd64,distribution=quantal/173/

llvm-svn: 183153
2013-06-03 20:45:54 +00:00
Matt Kopec edee182bef Fix FreeBSD build due to previous changes to ProcessMonitor::Detach.
llvm-svn: 183150
2013-06-03 19:48:53 +00:00
Jim Ingham 35579dde40 Fix a couple of error message typos.
llvm-svn: 183145
2013-06-03 19:34:01 +00:00
Matt Kopec ef14371d3f Fix various build warnings.
llvm-svn: 183140
2013-06-03 18:00:07 +00:00
Matt Kopec 6f961239ae Fix setting of watchpoints on inferior thread creation for Linux.
llvm-svn: 183139
2013-06-03 17:40:20 +00:00
Ashok Thirumurthi 880728f3eb Matched a vector new with vector delete.
Thanks to Daniel and valgrind.

llvm-svn: 183110
2013-06-03 15:53:40 +00:00
Matt Kopec 085d6cec1a Add ability to attach/detach to multi-threaded inferiors on Linux.
All running threads will be detected and stopped on attach and all threads get resumed on detach.

llvm-svn: 183049
2013-05-31 22:00:07 +00:00
Daniel Malea c91e4ab26e Use C-style include to match style in file (instead of C++ style)
- as per review comment from Dimitry Andric!

llvm-svn: 183039
2013-05-31 20:21:38 +00:00
Daniel Malea 132c4a266c CMake FreeBSD fix: add missing Process plugin directory
Patch by Ed Maste!

llvm-svn: 183038
2013-05-31 20:16:40 +00:00
Han Ming Ong 79371ceedf <rdar://problem/13752848>
Add 'JoinExistingSession' to XPC for root debugging.

llvm-svn: 183037
2013-05-31 20:15:19 +00:00
Daniel Malea e376a65182 FreeBSD cmake build fixes.
- missing #include <cstdlib> in Mangled.cpp
- missing include dirs in FreeBSD CMakeLists.txt

Patch by Ed Maste!

llvm-svn: 183032
2013-05-31 19:24:53 +00:00
Enrico Granata b294fd2037 <rdar://problem/14035604>
Fixing an issue where formats would not propagate from parents to children in all cases
Details follow:
an SBValue has children and those are fetched along with their values
Now, one calls SBValue::SetFormat() on the parent
Technically, the format choices should propagate onto the children (see ValueObject::GetFormat())
But if the children values are already fetched, they won't notice the format change and won't update themselves
This commit fixes that by making ValueObject::GetValueAsCString() check if any format change intervened from the previous call to the current one
A test case is also added

llvm-svn: 183030
2013-05-31 19:18:19 +00:00
Enrico Granata 39d5141085 Small code cleanups
llvm-svn: 183024
2013-05-31 17:43:40 +00:00
Sean Callanan 7d01ddd6f8 Fixed value evaluation to handle null constants.
<rdar://problem/14005311>

llvm-svn: 183022
2013-05-31 17:29:03 +00:00
Enrico Granata 1c333d071f An NSData with 0 bytes in it would report a summary of “0 byte”
Making sure that I get my English right by saying “0 bytes” instead

llvm-svn: 182978
2013-05-31 01:14:22 +00:00
Enrico Granata e0c70f1b2c <rdar://problem/11109316>
command script import now does reloads - for real
If you invoke command script import foo and it detects that foo has already been imported, it will
 - invoke reload(foo) to reload the module in Python
 - re-invoke foo.__lldb_init_module
 This second step is necessary to ensure that LLDB does not keep cached copies of any formatter, command, ... that the module is providing

Usual caveats with Python imports persist. Among these:
 - if you have objects lurking around, reloading the module won't magically update them to reflect changes
 - if module A imports module B, reloading A won't reload B
These are Python-specific issues independent of LLDB that would require more extensive design work

The --allow-reload (-r) option is maintained for compatibility with existing scripts, but is clearly documented as redundant - reloading is always enabled whether you use it or not

llvm-svn: 182977
2013-05-31 01:03:09 +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
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
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
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 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 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
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
Greg Clayton d389cc3a2e Don't compare 4 characters on a 2 character string.
llvm-svn: 182540
2013-05-22 23:36:10 +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
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
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
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 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 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 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
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
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 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