Commit Graph

9848 Commits

Author SHA1 Message Date
Rafael Espindola 97ae14e166 Use llvm::StringRefMemoryObject NFC.
llvm-svn: 221509
2014-11-07 04:24:12 +00:00
Greg Clayton 860fac5338 Fixes so tests compile and run remotely.
Fixes include:
- dont set or change LDFLAGS, but set LD_EXTRAS instead
- fix compilation errors for iOS based builds with objective C code
    - fix test cases to create classes instead of relying on classes from AppKit 
    - rename things where it makes sense

llvm-svn: 221496
2014-11-06 22:59:28 +00:00
Greg Clayton ef95321229 Changed program to go along with the previous commit to allow this test to be run remotely via lldb-platform.
llvm-svn: 221494
2014-11-06 22:56:56 +00:00
Greg Clayton f324020b7c Fix the test to not have to run the binary separately first to get the golden output, use the process STDOUT instead.
This helps this test be able to be run remotely.

llvm-svn: 221493
2014-11-06 22:56:15 +00:00
Greg Clayton 2dd4365038 Make sure stderr is filtered out in case xcodebuild or xcrun print errors when getting the SDK path and use xcrun to find the SDK path.
llvm-svn: 221492
2014-11-06 22:55:09 +00:00
Enrico Granata f35bc63220 This is a large, but clearical, commit that enables the C++ formatters to take on the additional TypeSummaryOptions argument. It is still not used for anything, but it is now there. Adding support for this extra argument to Python formatters will follow suit
llvm-svn: 221486
2014-11-06 21:55:30 +00:00
Enrico Granata c1247f5596 Introduce the notion of "type summary options" as flags that can be passed down to individual summary formatters to alter their behavior in a formatter-dependent way
Two flags are introduced:
- preferred display language (as in, ObjC vs. C++)
- summary capping (as in, should a limit be put to the amount of data retrieved)

The meaning - if any - of these options is for individual formatters to establish
The topic of a subsequent commit will be to actually wire these through to individual data formatters

llvm-svn: 221482
2014-11-06 21:23:20 +00:00
Sean Callanan 4c508df925 Handle types from the runtime that conform to
protocols.

<rdar://problem/18883778>

llvm-svn: 221476
2014-11-06 19:26:10 +00:00
Greg Clayton e6352e4797 Pick better floating point numbers (ones that can be exactly represented) in floating point instead of something that can't to avoid test suite failures on different devices and architectures.
<rdar://problem/18826900>

llvm-svn: 221468
2014-11-06 18:39:39 +00:00
Shawn Best eb3e905027 fixed minor code indenting http://reviews.llvm.org/D6127
llvm-svn: 221467
2014-11-06 17:52:15 +00:00
Deepak Panickal bc8c68ec02 Fix lldb-mi warnings so that it builds when --enable-werror is set.
llvm-svn: 221452
2014-11-06 13:42:49 +00:00
Greg Clayton 81eed943a3 Fixed the C++ method name class to be a bit more picky about what it identifies as a C++ method.
This was done by using regular expressions on any basename we find to ensure it is valid.

This fixed setting breakpoints by name with values like '[J]com.robovm.debug.server.apps.SleepLoop.startingUp()V'. This was previously triggering the C++ method name class to identify the string as C++ with a basename of '[J]com.robovm.debug.server.apps.SleepLoop.startingUp' which was obviously incorrect. 

The changes also fixed errors in templated function names like "void foo<int>(...)" where "void foo<int>" was being identified incorrectly as the basename. We also handle more C++ operators correctly now.

llvm-svn: 221416
2014-11-05 23:56:37 +00:00
Reid Kleckner ee3c175e6b cmake: Make the LLDB standalone build work for me
This allows me to generate a Visual Studio solution that builds LLDB if
you have standalone builds of LLVM and Clang lying around.
Unfortunately, you have to pass *four* CMake variables in, but it means
you don't have to take the extra step of installing Clang and LLVM to
some package prefix.

Hopefully this will generate a more usable XCode project too.

llvm-svn: 221413
2014-11-05 23:23:18 +00:00
Zachary Turner 742346a22f Decouple ProcessWindows from the Windows debug driver thread.
In the llgs world, ProcessWindows will eventually go away and
we'll implement a different protocol.  This patch decouples
ProcessWindows from the core debug loop so that this transition
will not be more difficult than it needs to be.

llvm-svn: 221405
2014-11-05 22:16:28 +00:00
Enrico Granata ab0e831485 Allow inline test case to register actually useful teardown hooks by allowing a hook to be passed back the test instance, were it not to be already bound to self. Use this ability to make the reversal of escape-non-printables a teardown hook for added reliability of the testing logic
llvm-svn: 221402
2014-11-05 21:31:57 +00:00
Sean Callanan 43270c34d5 Fixed the Objective-C stripped ivar test to ensure
that we load debug information properly.  If we don't
explicitly add-dsym, sometimes Spotlight will help out
and tell us about the dSYM but we shouldn't be relying
on that.  Thanks to Jim for catching this.

<rdar://problem/16424661>

llvm-svn: 221400
2014-11-05 21:24:27 +00:00
Enrico Granata ebdc1ac014 Add a setting escape-non-printables that drives whether the StringPrinter should or should not escape sequences such as \t, \n, .. and generally any non-printing character
The recent StringPrinter changes made this behavior the default, and the setting defaults to yes
If you want to change this behavior and see non-printables unescaped (e.g. "a\tb" as "a    b"), set it to false

Fixes rdar://12969594

llvm-svn: 221399
2014-11-05 21:20:48 +00:00
Zachary Turner 0d594e136e Fix LLDB build as a result of upstream LLVM changes.
llvm-svn: 221378
2014-11-05 18:37:53 +00:00
Shawn Best 629680e499 for Oleksiy Vyalov - Redirect stdin, stdout and stderr to /dev/null when launching LLGS process. Differential Revision: http://reviews.llvm.org/D6105
llvm-svn: 221324
2014-11-05 00:58:55 +00:00
Zachary Turner ea66dac7cd Rename some classes in ProcessWindows.
Renamed monitor -> driver, to make clear that the implementation here
is in no way related to that of other process plugins which have also
implemented classes with similar names such as DebugMonitor.

Also created a DebugEventHandler interface, which will be used by
implementors to get notified when debugging events happen in the
inferiors.

llvm-svn: 221322
2014-11-05 00:33:28 +00:00
Eric Christopher 8b1bea8aee Avoid building lldb-mi when --enable-werror is set
as it doesn't build and is optional.

llvm-svn: 221315
2014-11-04 23:30:30 +00:00
Shawn Best fd13743f57 for Siva Chandra: Fix compilation of StringPrinter.cpp with GCC. Differential Revision: http://reviews.llvm.org/D6122
llvm-svn: 221310
2014-11-04 22:43:34 +00:00
Enrico Granata 0eb0ec298c Fix a problem where ValueObjectVariable was not correctly setting its 'has value changed' flag for scalar valued variables. This fixes rdar://17851144
llvm-svn: 221298
2014-11-04 21:28:50 +00:00
Enrico Granata 404ab37e8b Fix the build for LLVM changes
llvm-svn: 221286
2014-11-04 19:33:45 +00:00
Jason Molenda 8030ffda91 Add recognition for another x86 epilogue sequence (ret followed by
a nop).  Fixes an instruction stepping problem when trying to step
over the final instructions of an epilogue.
<rdar://problem/18068877> 

llvm-svn: 221241
2014-11-04 05:48:11 +00:00
Jason Molenda 9bb421d38b Add one extra sanity check to RegisterContextLLDB::TryFallbackUnwindPlan
so it doesn't try the arch default if a comiler-generated (eh_frame,
compact unwind info) based unwind plan has failed.

llvm-svn: 221239
2014-11-04 05:35:32 +00:00
Jason Molenda 4b00893243 Back out r221229 -- instead of trying to identify the end of the unwind,
let's let lldb try the arch default unwind every time but not destructively --
it doesn't permanently replace the main unwind method for that function from
now on.

This fix is for <rdar://problem/18683658>.  

I tested it against Ryan Brown's go program test case and also a
collection of core files of tricky unwind scenarios 
<rdar://problem/15664282> <rdar://problem/15835846>
<rdar://problem/15982682> <rdar://problem/16099440>
<rdar://problem/17364005> <rdar://problem/18556719> 
that I've fixed over the last 6-9 months.

llvm-svn: 221238
2014-11-04 05:28:40 +00:00
Eric Christopher 0010b202ba Fix one more [-Werror,-Winconsistent-missing-override] error.
llvm-svn: 221232
2014-11-04 03:14:57 +00:00
Eric Christopher 7ab81b9149 Fix a bunch of [-Werror,-Winconsistent-missing-override] errors.
llvm-svn: 221231
2014-11-04 03:13:17 +00:00
Jason Molenda d98c3abf9f After we've completed a full backtrace, we'll have one frame which
is "invalid" -- it is past the end of the stack trace.  Add a new
method IsCompletedStackWalk() so we can tell if an invalid stack
frame is from a complete backtrace or if it might be worth re-trying
the last unwind with a different method.

This fixes the unwinder problems Ryan Brown was having with go
programs.  The unwinder can (under the right circumstances) still
destructively replace unwind plans permanently - I'll work on
that in a different patch.  

<rdar://problem/18683658> 

llvm-svn: 221229
2014-11-04 02:31:50 +00:00
Greg Clayton 8691dc5b75 Fixed SBTarget::ReadMemory() to work correctly and the TestTargetAPI.py test case that was reading target memory in TargetAPITestCase.test_read_memory_with_dsym and TargetAPITestCase.test_read_memory_with_dwarf.
The problem was that SBTarget::ReadMemory() was making a new section offset lldb_private::Address by doing:


size_t
SBTarget::ReadMemory (const SBAddress addr,
                      void *buf,
                      size_t size,
                      lldb::SBError &error)
{
        ...
        lldb_private::Address addr_priv(addr.GetFileAddress(), NULL);
        bytes_read = target_sp->ReadMemory(addr_priv, false, buf, size, err_priv);


This is wrong. If you get the file addresss from the "addr" argument and try to read memory using that, it will think the file address is a load address and it will try to resolve it accordingly. This will work fine if your executable is loaded at the same address (no slide), but it won't work if there is a slide.

The fix is to just pass along the "addr.ref()" instead of making a new addr_priv as this will pass along the lldb_private::Address that is inside the SBAddress (which is what we want), and not always change it into something that becomes a load address (if we are running), or abmigious file address (think address zero when you have 150 shared libraries that have sections that start at zero, which one would you pick). The main reason for passing a section offset address to SBTarget::ReadMemory() is so you _can_ read from the actual section + offset that is specified in the SBAddress. 

llvm-svn: 221213
2014-11-04 00:56:30 +00:00
Sean Callanan 11533184d7 Added a test case for reading ivars from the
Objective-C runtime.  We'll need to do more
(subclasses, partially-defined classes, etc.)
but this tests that at least the basics work.

llvm-svn: 221208
2014-11-04 00:06:34 +00:00
Zachary Turner 8f21174700 Implement a framework for live debugging on Windows.
When processes are launched for debugging on Windows now, LLDB
will detect changes such as DLL loads and unloads, breakpoints,
thread creation and deletion, etc.

These notifications are not yet propagated to LLDB in a way that
LLDB understands what is happening with the process.  This only
picks up the notifications from the OS in a way that they can be
sent to LLDB with subsequent patches.

Reviewed by: Scott Graham

Differential Revision: http://reviews.llvm.org/D6037

llvm-svn: 221207
2014-11-04 00:00:12 +00:00
Greg Clayton a3f3fd35ae Fix this test to set a breakpoint at the correct location that will always get hit so it doesn't intermittently fail on MacOSX.
llvm-svn: 221201
2014-11-03 23:10:56 +00:00
Greg Clayton ed59d756d8 Fixed a test suite error on MacOSX where people were using ".data" as the data section name for all file formats. Instead fix the test by finding the section by section type so the test is agnostic to the file format (and passes on MacOSX).
llvm-svn: 221197
2014-11-03 23:02:08 +00:00
Greg Clayton c91d49b505 Fixed a test suite error on MacOSX where people were using ".data" as the data section name for all file formats. Instead fix the test by finding the section by section type so the test is agnostic to the file format (and passes on MacOSX).
llvm-svn: 221196
2014-11-03 22:58:38 +00:00
Greg Clayton 118593a3af The change previously committed as 220983 broke large binary memory reads. I kept the "idx - 1" fix from 220983, but reverted the while loop that was incorrectly added.
The details are: large packets (like large memory reads (m packets) or large binary memory reads (x packet)) can get responses that come in across multiple read() calls. The while loop that was added meant that if only a partial packet came in (like only "$abc" coming for a response) GDBRemoteCommunication::CheckForPacket() was called, it would deadlock in the while loop because no more data is going to come in as this function needs to be called again with more data from another read. So the original fix will need to be corrected and resubmitted.

<rdar://problem/18853744>

llvm-svn: 221181
2014-11-03 21:02:54 +00:00
Filipe Cabecinhas dfa8688082 Fix the Makefile build by actually building ABI/SysV-ppc
llvm-svn: 221111
2014-11-02 22:03:15 +00:00
Ed Maste d455a1ecb8 Update for LLVM API change in r221024
llvm-svn: 221073
2014-11-02 00:24:22 +00:00
Justin Hibbits 3411c3ea53 Use kern.proc.auxv to get the aux data
Summary:
Instead of using a homegrown solution to get the auxv from a process, instead
use the OS-provided sysctl to get the needed data.  This allows the same code to
be used for both 32-bit and 64-bit processes on a 64-bit host.

Reviewers: emaste

Reviewed By: emaste

Subscribers: emaste, lldb-commits

Differential Revision: http://reviews.llvm.org/D6071

llvm-svn: 221063
2014-11-01 21:27:08 +00:00
Sean Callanan ada6d1693e Complete the superclass type when completing an
Objective-C class type.

llvm-svn: 221022
2014-10-31 23:55:36 +00:00
Shawn Best 3ab672d7ef TOT broken by R220956 - Differential Revision: http://reviews/llvm.org/D6066
llvm-svn: 221018
2014-10-31 23:20:13 +00:00
Stephane Sezer 15d810fa29 Always transmit SIGPROF back to the inferior.
Summary:
SIGPROF is used for profiling processes (with google-perftools for
instance), which results in the inferior receiving a SIGPROF from the
kernel every few milliseconds. Instead of stopping the debugging session
and notifying the user of this, we should just pass the signal and keep
running.

This follows the behavior we have in UnixSignals.cpp.

Test Plan: Run LLDB on linux with a binary using google-perftools, see that execution gets interrupted all the time because we receive SIGPROF. Apply the patch, everything works fine.

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D5953

llvm-svn: 221011
2014-10-31 22:37:24 +00:00
Jason Molenda fca26da446 SBAddress currently *may* have an Address object or it may not.
If it has an Address object, it is assumed to be Valid.
Change SBAddress to always have an Address object and check
whether it is valid or not in those case.

This is fixing a subtle problem where we ended up with
a SBAddress with an Address of LLDB_INVALID_ADDRESS could
run through a copy constructor and turn into an SBAddress
with no Address object being backed (because it wasn't
distinguishing between invalid-Address versus no-Address.)

The cost of an Address object is not high and this will be
an easy mistake for someone else to make; I'm fixing
SBAddress so it doesn't come up again.
<rdar://problem/18069407> 

llvm-svn: 221002
2014-10-31 21:30:59 +00:00
Shawn Best 396f80a1ea commit on behalf of Oleksiy Vyalov Fix junk content handling within GDBRemoteCOmmunication::CheckForPacket 1. Avoid removing of an extra symbol from m_bytes. 2. iterate over m_bytes until useful content is found. Differential Revision: http://reviews.llvm.org/D6042
llvm-svn: 220983
2014-10-31 18:18:23 +00:00
Sean Callanan acff5e60b5 In ValueObjectDynamicValue, trust what comes from
the runtime rather than trying to fix it up,
because now those types have ivars regardless of
whether they come from "frame variable" or from
expressions.

Patch by Enrico Granata.

llvm-svn: 220982
2014-10-31 18:07:44 +00:00
Sean Callanan 9dfe45ff1c Updated the Objective-C runtime type vendor to
load ivars into classes that are reported to the
Objective-C runtime.

llvm-svn: 220981
2014-10-31 18:06:26 +00:00
Sean Callanan b678b90749 - Fixed a bug where ::Describe for class descriptors
would fail if the class had no ivars.

- Updated use of the RealizeType API by the class
  descriptors to use "for_expression" rather than
  the misnamed "allow_unknownanytype."

llvm-svn: 220980
2014-10-31 18:05:26 +00:00
Sean Callanan a330933f15 - Use "for_expression" rather than "allow_unknownanytype"
to indicate that we're doing stuff for the expression
  parser.

- When for_expression is true, look through @s and find
  the actual class rather than just returning id. 

- Rename BuildObjCObjectType to BuildObjCObjectPointerType
  since it's actually returning an object *pointer* type.

llvm-svn: 220979
2014-10-31 18:02:30 +00:00
Justin Hibbits db39cdfbb7 Fix some bugs from D5988
Summary:
Ed Maste found some problems with the commit in D5988.  Address most of these.
While here, also add floating point return handling.  This doesn't handle
128-bit long double yet.  Since I don't have any system that uses it, I don't
currently have plans to implement it.

Reviewers: emaste

Reviewed By: emaste

Subscribers: emaste, lldb-commits

Differential Revision: http://reviews.llvm.org/D6049

llvm-svn: 220963
2014-10-31 15:57:52 +00:00