Commit Graph

4479 Commits

Author SHA1 Message Date
Tim Northover 0614fcd0e3 Prevent race in when stopping a "read thread"
Both StopReadThread and the thread being stopped set the thread id to
0 after m_read_thread_enabled was set to false. If the thread being
stopped got there first then StopReadThread called pthread_join on an
invalid thread number. This is not a Good Thing,

Should fix a fairly regular segfault when quitting on Linux.

llvm-svn: 185107
2013-06-27 21:19:30 +00:00
Sean Callanan 7dcbe3d356 Cleanup of IRForTarget. Removed some relics of
the time when the IRInterpreter ran inside
IRForTarget.

llvm-svn: 185088
2013-06-27 18:08:02 +00:00
Sean Callanan 85fc876106 Fixed the IRInterpreter to reject any code that
has more than one function with a body.  This
prevents declarations e.g. of blocks from being
passed to the IRInterpreter; they must pass
through to the JIT.

<rdar://problem/14180236>

llvm-svn: 185057
2013-06-27 01:59:51 +00:00
Enrico Granata c76e60b012 Adding support for extracting line table information from .o files that do not have aranges
llvm-svn: 185055
2013-06-27 01:43:09 +00:00
Sean Callanan ffae944a39 Fixed IRExecutionUnit so that it looks up addresses
correctly.  We have been getting lucky since most
expressions generate only one section (or the first
code section contains all the code), but sometimes
it actually matters.

<rdar://problem/14180236>

llvm-svn: 185054
2013-06-27 01:42:47 +00:00
Sean Callanan 70cac8fd81 Remove the process's reservation cache and don't
bother checking if a region is safe to use.  In
cases where regions need to be synthesized rather
than properly allocated, the memory reads required
to determine whether the area is used are

- insufficient, because intermediate locations
  could be in use, and

- unsafe, because on some platforms reading from
  memory can trigger events.

All this only makes a difference on platforms
where memory allocation in the target is impossible.
Behavior on platforms where it is possible should
stay the same.

<rdar://problem/14023970>

llvm-svn: 185046
2013-06-27 00:10:26 +00:00
Matt Kopec eb7f2315f4 Remove unneeded limbo state flag.
llvm-svn: 185010
2013-06-26 18:46:08 +00:00
Rafael Espindola 68770d24aa Remove unused include.
llvm-svn: 184954
2013-06-26 15:12:41 +00:00
Ed Maste 4ba58652b3 Don't explicitly set update version
Host::GetOSVersion's caller already sets it to UINT32_MAX to determine
which version number components are set.

llvm-svn: 184953
2013-06-26 15:10:31 +00:00
Rafael Espindola 4609ea8998 Fix the lldb build.
llvm-svn: 184948
2013-06-26 14:10:56 +00:00
Enrico Granata c2a96407c5 Remove the #define USE_CACHE since the formatters cache has been operational for a while now and has not caused issues that warrant disabling it
Also, print the cache hits statistics if the log is in debugging mode vs. LLDB being a debug build - this should make it easier to gather useful metrics on cache success rate for real users

llvm-svn: 184900
2013-06-26 01:03:38 +00:00
Enrico Granata 15571f1571 <rdar://problem/14266578>
"command source" was not properly setting the stop-on-error option

llvm-svn: 184899
2013-06-26 00:36:27 +00:00
Enrico Granata fb1d9fe15e <rdar://problem/14243761>
The argument to -w (--category) in type * list is a regular expression
This caused unhappiness with the gnu-libstdc++ category because of the double ++

Now we check for exact textual match as-well-as regexp matching

llvm-svn: 184898
2013-06-26 00:31:21 +00:00
Enrico Granata b4675a4e12 <rdar://problem/14266411>
The semi-unofficial way of returning a status from a Python command was to return a string (e.g. return "no such variable was found") that LLDB would pick as a clue of an error having happened

This checkin changes that:
- SBCommandReturnObject now exports a SetError() call, which can take an SBError or a plain C-string
- script commands now drop any return value and expect the SBCommandReturnObject ("return object") to be filled in appropriately - if you do nothing, a success will be assumed

If your commands were relying on returning a value and having LLDB pick that up as an error, please change your commands to SetError() through the return object or expect changes in behavior

llvm-svn: 184893
2013-06-25 23:43:28 +00:00
Sean Callanan 6b2f22de5e Fixed a bug in ClangASTSource where we would return
the target of a typedef when asked for a typedef.

llvm-svn: 184886
2013-06-25 22:36:17 +00:00
Ed Maste 2f0d590713 Update version sscanf to match FreeBSD release info
Release strings are of the form 9.1-RELEASE-p3 or 10.0-CURRENT.

llvm-svn: 184876
2013-06-25 20:50:07 +00:00
Ed Maste 8b006c69c0 Correct use of __FreeBSD_kernel__
It is defined on recent FreeBSD versions, so must not be mutually
exclusive with an #elif FreeBSD block.

Patch submitted by Robert Millan.

Fixes PR#16447.

llvm-svn: 184867
2013-06-25 18:58:11 +00:00
Ed Maste a708a36cea Match printf format specifiers and arguments
llvm-svn: 184854
2013-06-25 14:47:45 +00:00
Ed Maste d66d3ec036 Update comment after Linux->POSIX rename
llvm-svn: 184850
2013-06-25 14:29:15 +00:00
Sean Callanan 70c86e1781 Fixed the instruction emulation so that it doesn't
print to standard output as part of normal
operation.

<rdar://problem/14247606>

llvm-svn: 184797
2013-06-25 00:32:45 +00:00
Han Ming Ong 91ed6b878f <rdar://problem/14182286>
Made sure that temporary object created from HarmonizeThreadIdsForProfileData() doesn’t get passed around without creating an object first.

Reviewed by Greg

llvm-svn: 184769
2013-06-24 18:15:05 +00:00
Sean Callanan 879425fadd We set the error when a breakpoint condition
doesn't return anything; that's great.

We should probably also return rather than
trying to access the nonexistent return value.

<rdar://problem/14009519>

llvm-svn: 184765
2013-06-24 17:58:46 +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
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