Commit Graph

7343 Commits

Author SHA1 Message Date
Ed Maste 81ca910af7 Tests require GNU make, called gmake on FreeBSD
llvm-svn: 184748
2013-06-24 15:40:27 +00:00
Ed Maste 5d34af358a Sync FreeBSD files to Linux equivalents, to reduce noise in diff
- Sort functions in the same order
- Match whitespace
- Remove commetned out code
- Make filename in comments match filename

llvm-svn: 184746
2013-06-24 15:09:18 +00:00
Ed Maste 428a6784b7 Update comment to match class name
llvm-svn: 184745
2013-06-24 15:04:47 +00:00
Ed Maste da9f9ae7d4 Use canonical termios.h location
llvm-svn: 184744
2013-06-24 15:03:16 +00:00
Ed Maste 5a9a6260c6 Eliminate missing virtual destructor warning on FreeBSD
Akin to r181712 (88e529b7) of Linux/ProcessMonitor.cpp

llvm-svn: 184742
2013-06-24 14:55:03 +00:00
Ed Maste 69b76d5d65 Update for Linux->POSIX rename
Revision r147613 (2341d35) renamed this file with s/Linux/POSIX/, but
header guards and comments were not updated to match.

llvm-svn: 184741
2013-06-24 14:51:39 +00:00
Andy Gibbs 4e279ae0c8 Using offsetof to an item within an array is an extension so mark it as such to avoid compiler warnings.
llvm-svn: 184738
2013-06-24 14:05:59 +00:00
Andy Gibbs 70f94f9712 Fix some more mismatched integer types causing compiler warnings.
llvm-svn: 184737
2013-06-24 14:04:57 +00:00
Ed Maste 6b807839e3 Remove comment that is no longer applicable
Since r181446 the m_private_run_lock has been used for all platforms.

llvm-svn: 184733
2013-06-24 13:29:34 +00:00
Greg Clayton 57d1c4865e Added a regex that can be specified to avoid showing contents on types that match. Also split things up a bit so this can be run as a stand alone script or in lldb.
llvm-svn: 184628
2013-06-22 01:42:49 +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
Enrico Granata 091dd7be12 Test suite support for setting arguments through the environment
Set your env variable LLDB_TEST_ARGUMENTS to one or more options to be passed to the lldb test suite and those will be picked automatically

No more fighting about whether the progress bar is good or bad :-)

llvm-svn: 184615
2013-06-22 00:15:25 +00:00
Enrico Granata 57a8ca3a06 make command history test case run silently regardless of import status of module foo
llvm-svn: 184613
2013-06-22 00:01:21 +00:00
Enrico Granata c20eed4280 Lots of cleanup on the SWIG wrapping layer
Now, the way SWIG wrappers call into Python is through a utility PyCallable object, which overloads operator () to look like a normal function call
Plus, using the SBTypeToSWIGWrapper() family of functions, we can call python functions transparently as if they were plain C functions
Using this new technique should make adding new Python call points easier and quicker

The PyCallable is a generally useful facility, and we might want to consider moving it to a separate layer where other parts of LLDB can use it

llvm-svn: 184608
2013-06-21 23:27:16 +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 c972c70e60 Change the SWIG wrappers to stop directly casting SB object to SWIG objects, and instead use a safer type-checked API (thanks templates)
Any time a SWIG wrapper needs a PyObject for an SB object, it now should call into SBTypeToSWIGWrapper<SBType>(SBType*)
If you try to use it on an SBType for which there is not an implementation yet, LLDB will fail to link - just add your specialization to python-swigsafecast.swig and rebuild

This is the first step in simplifying our SWIG Wrapper layer

llvm-svn: 184580
2013-06-21 18:57:30 +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
Jason Molenda e445f8fb4d Also report any OS python plugin in use.
llvm-svn: 184487
2013-06-20 22:05:35 +00:00
Jason Molenda 1332988f5a Print the general purpose registers for frame 0.
llvm-svn: 184483
2013-06-20 21:57:34 +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
Andy Gibbs ac93aedc76 Revise r184335 so that warning suppression flag is only for clang 3.4 and higher
llvm-svn: 184399
2013-06-20 06:47:36 +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 694b49f0f8 Cleanup the output a bit by removing old print statements and also printing the number of types found.
llvm-svn: 184389
2013-06-20 01:23:56 +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
Enrico Granata 6d2cfb80ba Huge speedup for testsuite categories
This ensures that we won't try to do cleanups of test cases that we are skipping
e.g. this brings down the time required to run the cmdline category on my machine from ~70s to ~30s

llvm-svn: 184363
2013-06-19 21:48:09 +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
Ashok Thirumurthi d5dcec1181 Updated the LLDB download page to reflect Debian package locations for 3.3 as well as the incremental 3.4 releases.
llvm-svn: 184339
2013-06-19 19:32: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 ef19a014d6 The 'register' keyword is now deprecated in C++11, so ignore the warning when compiling lldb with clang since python headers commonly use the keyword.
llvm-svn: 184335
2013-06-19 19:06:44 +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
Jason Molenda 8359214427 A few small enhancements to the diagnose-unwind command.
Change the simple-minded stack walk to not depend on lldb to unwind
the first frame.

Collect a list of Modules and Addresses seen while backtracing (with
both methods), display the image list output for all of those modules,
plus disassemble and image show-unwind any additional frames that
the simple backtrace was able to unwind through instead of just the 
lldb unwind algorithm frames.

Remove checks for older lldb's that didn't support -a for disassemble
or specifying the assembler syntax on x86 targets.

llvm-svn: 184280
2013-06-19 04:52:55 +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
Greg Clayton 88e0f618ea Added a new decorator function in the "lldb" module that can register a command automatically. We have just a few kinks to work out for the Xcode workflow and we will be ready to switch over to using this. To use this, you can decorate your python function as:
@lldb.command("new_command", "Documentation string for new_command...")
def new_command(debugger, command, result, dict):
    ....
    
No more need to register your command in the __lldb_init_module function!

llvm-svn: 184274
2013-06-19 01:38:02 +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 9ac21aef9b <rdar://problem/14086503>
Hardening the libstdc++ std::map test case against line table changes

llvm-svn: 184265
2013-06-19 00:20:57 +00:00
Enrico Granata d223563a59 <rdar://problem/14086503>
Hardening the libstdc++ std::vector test case against line table changes

llvm-svn: 184264
2013-06-19 00:14:02 +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
Jim Ingham 8c8c6fab4c Make the lldb "Release" configuration use the same llvm build "Release+Asserts" as the lldb "Debug" configuration.
No need to rebuild llvm and remove asserts to build the local optimized lldb.

llvm-svn: 184243
2013-06-18 21:44:59 +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