Commit Graph

7378 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
Greg Clayton 96eb9ab047 A bit more cleanup on the process_events.py to use best practices for event handling.
llvm-svn: 185089
2013-06-27 18:08:32 +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
Greg Clayton 6467ff9aea <rdar://problem/14195566>
Found a race condition when killing an application where the state could be set to exited by the waitpid_thread() _before_ we call task resume (via MachProcess::PrivateResume()) in MachProcess::Kill().

llvm-svn: 185048
2013-06-27 00:23:57 +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
Han Ming Ong b4e1d4c630 <rdar://problem/14281898>
Much faster way to get dirty size.

llvm-svn: 185033
2013-06-26 22:52:37 +00:00
Greg Clayton abc18417b6 Update the platform options help strings.
llvm-svn: 185028
2013-06-26 22:24:05 +00:00
Greg Clayton 111db4f94c Fixed the process_events.py example to be able to specify the platform and also use the debugger's listener.
llvm-svn: 185027
2013-06-26 22:23:45 +00:00
Han Ming Ong 6db14a9965 <rdar://problem/14262854>
Match up with top’s implementation on recent Cab as API has changed a bit.
Tested the same binary running on Zin as well. Tested ARM binary on iOS as well.

llvm-svn: 185017
2013-06-26 20:46:27 +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
Jason Molenda bd4dfade51 Remove ifdef LLDB_CONFIGURATION_DEBUG directives around the formatter
cache ivars/methods.

llvm-svn: 184901
2013-06-26 01:51:03 +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
Daniel Malea 795cc3afc3 Fix undefined behaviour in data formatter test -- ensure char* null-terminated
so LLDB does not read off the end of the array.

llvm-svn: 184877
2013-06-25 20:54:24 +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 3d3295daab Skip dsym tests also on FreeBSD
llvm-svn: 184874
2013-06-25 19:59:56 +00:00
Ed Maste 09617a5d03 Skip tests that hang on FreeBSD
There's still significant work to do in the FreeBSD port, so no point
in a pr for these yet.

llvm-svn: 184871
2013-06-25 19:11:36 +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
Jason Molenda 7a32393bcf If debugserver fails to interrogate the inferior process CPU type
for any reason, use debugserver own's cputype as a best guess when
we reply to the debugger's qProcessInfo packet or when initializing
our register tables.
<rdar://problem/13406879> 

llvm-svn: 184829
2013-06-25 06:42:09 +00:00
Jason Molenda 829713c258 Remove some unnecessary uses of nub_break_t in the arm specific
support files for debugserver to fix a build failure for arm.  Also
remove some of the code used for software-driven single instruction
stepping; this is slowly being yanked out and these particular bits
overlap with the nub_break_t going away.

llvm-svn: 184828
2013-06-25 06:01:20 +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
Jim Ingham 34e1edf2bf Direct dir to target.source-map.
llvm-svn: 184778
2013-06-24 19:37:49 +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 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