Commit Graph

5696 Commits

Author SHA1 Message Date
Greg Clayton a0ca6601bc <rdar://problem/12462048>
<rdar://problem/12068650>

More fixes to how we handle paths that are used to create a target.

This modification centralizes the location where and how what the user specifies gets resolved. Prior to this fix, the TargetList::CreateTarget variants took a FileSpec object which meant everyone had the opportunity to resolve the path their own way. Now both CreateTarget variants take a "const char *use_exe_path" which allows the TargetList::CreateTarget to centralize where the resolving happens and "do the right thing".

llvm-svn: 166186
2012-10-18 16:33:33 +00:00
Greg Clayton 453925530d <rdar://problem/12462048>
LLDB changes argv[0] when debugging a symlink. Now we have the notion of argv0 in the target settings:

target.arg0 (string) = 

There is also the program argument that are separate from the first argument that have existed for a while:

target.run-args (arguments) =

When running "target create <exe>", we will place the untouched "<exe>" into target.arg0 to ensure when we run, we run with what the user typed. This has been added to the ProcessLaunchInfo and all other needed places so we always carry around the:
- resolved executable path
- argv0
- program args

Some systems may not support separating argv0 from the resolved executable path and the ProcessLaunchInfo needs to carry all of this information along so that each platform can make that decision.

llvm-svn: 166137
2012-10-17 22:57:12 +00:00
Enrico Granata d228483d8c Improvements to the data formatters logging - plus, new log messages when our dynamic type changes
llvm-svn: 166133
2012-10-17 22:23:56 +00:00
Sean Callanan c5069ad26c Fixed ClangASTContext to own its TargetOptions
using a reference-counted pointer.  This avoids
memory-management problems when the TargetOptions
are deleted.

llvm-svn: 166132
2012-10-17 22:11:14 +00:00
Sean Callanan aa0f9cbc9a Added support for "bool", "true", and "false" to
the expression parser (also wchar_t) and added a
test case.

llvm-svn: 166131
2012-10-17 22:09:59 +00:00
Greg Clayton 84ffa16de6 Added register write examples and also how to modify the pc. For this we show and example of GDB using the "jump" command, and LLDB using "register write" with an expression.
llvm-svn: 166127
2012-10-17 20:58:52 +00:00
Enrico Granata 13ac0e253d <rdar://problem/12503640> Fixing an issue where the dynamic type of an Objective-C pointer changed but we still reported the one-true-definition for the previous type. This was causing issues where a variable could be reported as being of an entirely different type after an assignment
llvm-svn: 166119
2012-10-17 19:03:34 +00:00
Jason Molenda 5c1ac4ea72 Add code to UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly
to handle an addition class of early-return instructions we find in arm code:
tail-call optimziation returns where we restore the register state from the
function entry and jump directly (not branch & link) to another function --
when that other function returns, it will return to our caller.

Previously this mid-function epilogue sequence was not being correctly detected.
We would not re-instate the prologue setup instructions for the rest of the function
so unwinds would break from that point until the end of the function.
<rdar://problem/12502597> 

llvm-svn: 166081
2012-10-17 00:41:14 +00:00
Greg Clayton cced1566e2 API cleanup.
llvm-svn: 166070
2012-10-16 22:58:25 +00:00
Jim Ingham 35e1bda695 Add the ability to set timeout & "run all threads" options both from the "expr" command and from
the SB API's that evaluate expressions.

<rdar://problem/12457211>

llvm-svn: 166062
2012-10-16 21:41:58 +00:00
Enrico Granata 430e540b6b Removing the two extra GetXSize(bool) calls since we do not desire to support them long-term
llvm-svn: 166060
2012-10-16 21:11:14 +00:00
Enrico Granata cd4d24d5e9 <rdar://problem/12446320> Fixing an issue with our Driver where setting an immediate output would not cause suppression of the final printout. This allows effective output redirection for Python commands
llvm-svn: 166058
2012-10-16 20:57:12 +00:00
Jason Molenda 981d4dfa0f llvm needs the OS to be set to either iOS or Mac OS X
to work properly; when doing bare-boards rom debugging
force the OS to be one of those when initializing llvm.
<rdar://problem/12504138>

llvm-svn: 166057
2012-10-16 20:45:49 +00:00
Greg Clayton 743ecf4393 Patch from Matt Kopec:
This patch fixes an issue where if lldb fails to attach to a process (ie. invalid pid) on Linux, the process monitor thread gets stuck waiting for a signal from the attach thread, which never comes due to not being signaled. It also implements StopOpThread which is used for both attach/launch cases as I'm not aware of any special handling needed for the attach case. Also, propagate 'Error' from the Detach function instead of using a bool.

llvm-svn: 166055
2012-10-16 20:20:18 +00:00
Sean Callanan 794baf6fb7 If a full path to a compiler is provided on the
command line to dotest.py, replace / with _ in
the logfile names that mention that compiler so
that we don't try to put log files in weird
places.

llvm-svn: 166038
2012-10-16 18:22:04 +00:00
Jason Molenda af2521fd74 Add a new ABI plugin method which specifies whether the architecture
must push something on the stack for a function call or not.  In
x86, the stack pointer is decremented when the caller's pc is saved
on the stack.  In arm, the stack pointer and frame pointer don't
necessarily have to change for a function call, although most
functions need to use some stack space during their execution.

Use this information in the RegisterContextLLDB to detect invalid 
unwind scenarios more accurately.

<rdar://problem/12348574>

llvm-svn: 166005
2012-10-16 02:39:21 +00:00
Jim Ingham 5d88a068ee Patch from Matt Kopec <matt.kopec@intel.com> to fix the problem that if two breakpoints were set on consecutive addresses, the continue from the
first breakpoint would skip the second.

llvm-svn: 166000
2012-10-16 00:09:33 +00:00
Greg Clayton 02686b80fa Added "process plugin packet send" and "process plugin packet history" for GDB remote. "process plugin packet send" will send a packet and receive a response. "process plugin packet history" will dump the packet history buffer.
llvm-svn: 165991
2012-10-15 22:42:16 +00:00
Greg Clayton 193f70427c Build with SDKROOT = macosx for "Debug" "DebugClang" and "Release" builds when building with Xcode.
llvm-svn: 165980
2012-10-15 21:17:37 +00:00
Greg Clayton c4c5e89152 Fixed a logic error that showed up when compiling with a newer version of clang where:
lldb::BasicType
ClangASTContext::GetLLDBBasicTypeEnumeration (clang_type_t clang_type)

would return a bogus value.

llvm-svn: 165979
2012-10-15 21:16:43 +00:00
Greg Clayton 3c6aa277b9 Patch from Daniel Malea -- Updated build instructions for Linux.
llvm-svn: 165964
2012-10-15 20:39:39 +00:00
Enrico Granata 958513ab77 Mention that the code signing process also applies to Mountain Lion
llvm-svn: 165876
2012-10-13 17:06:33 +00:00
Greg Clayton f402f78eb7 Make sure we always use lldb::tid_t for thread IDs so we don't truncate a 64 bit thread ID.
llvm-svn: 165862
2012-10-13 02:11:55 +00:00
Greg Clayton 998255bfe8 <rdar://problem/12491387>
I added the ability for a process plug-in to implement custom commands. All the lldb_private::Process plug-in has to do is override:

virtual CommandObject *
GetPluginCommandObject();

This object returned should be a multi-word command that vends LLDB commands. There is a sample implementation in ProcessGDBRemote that is hollowed out. It is intended to be used for sending a custom packet, though the body of the command execute function has yet to be implemented! 

llvm-svn: 165861
2012-10-13 02:07:45 +00:00
Greg Clayton eaafa732df <rdar://problem/12490588>
From SBType, we can now get a lldb::BasicType enumeration out of an existing type.

llvm-svn: 165857
2012-10-13 00:20:27 +00:00
Greg Clayton 01db0c6823 Provide an SSL context ref in case SLL is needed for communication.
llvm-svn: 165856
2012-10-13 00:18:18 +00:00
Greg Clayton ea561dcffb <rdar://problem/12490558>
SBProcess::SetSelectedThreadByID() had a "uint32_t tid" parameter which would truncate 64 bit thread IDs (lldb::tid_t is 64 bit).

llvm-svn: 165852
2012-10-12 23:32:11 +00:00
Greg Clayton b556c9b9db <rdar://problem/12489931>
Memory write wasn't working (assert was firing) when writing memory.

llvm-svn: 165848
2012-10-12 23:24:05 +00:00
Sean Callanan 9a97f8fad3 Fixed build problems with LLDB on Mac OS X,
specifically related to the deployment settings.
Also some minor alphabetization.

<rdar://problem/12433905>

llvm-svn: 165823
2012-10-12 21:31:06 +00:00
Greg Clayton 25177af7a4 Make SBDeclaration.h a public header in the LLDB.framework.
llvm-svn: 165820
2012-10-12 20:31:06 +00:00
Jim Ingham 28eb57114d Bunch of cleanups for warnings found by the llvm static analyzer.
llvm-svn: 165808
2012-10-12 17:34:26 +00:00
Greg Clayton df3df25a71 Patch from Daniel Malea that cleans up the process parameters for Process/Thread classes for POSIX and Linux.
llvm-svn: 165806
2012-10-12 16:23:23 +00:00
Greg Clayton 3c2fabf27a Patch from Andrew Kaylor that centralized where the info for:
ConstString Host::GetVendorString();
ConstString Host::GetOSString();

comes from. It now all comes from the Host::GetArchitecture (eSystemDefaultArchitecture) like the Apple build was doing to minimize the number of places that need to be updated when Host::GetArchitecture () is called.

llvm-svn: 165805
2012-10-12 16:15:28 +00:00
Greg Clayton 926cce7619 Modified patch from Matt Kopec that makes sure the run lock is acquired when attaching and makes sure the pid is being set on linux in the process info.
llvm-svn: 165804
2012-10-12 16:10:12 +00:00
Greg Clayton 3e672345bc <rdar://problem/12042500>
Fixed an issue where we would try to launch an application twice and the second failure would cover up the first.

llvm-svn: 165756
2012-10-11 22:05:13 +00:00
Greg Clayton 1698be7352 Fix build warnings.
llvm-svn: 165755
2012-10-11 22:04:01 +00:00
Sean Callanan 95769bf489 Fixed the IR interaction layer to deal with a
change in the LLDB target data API.

llvm-svn: 165754
2012-10-11 22:00:52 +00:00
Greg Clayton fc6d50e120 Fixed an indentation issue that only shows up when dumping .o files that use linked addresses (DWARF in .o files with debug map).
llvm-svn: 165740
2012-10-11 20:42:53 +00:00
Greg Clayton f0246d1518 <rdar://problem/12331741>
Dynamic type code must be efficient and fast. Now it is.

Added ObjC v1 support for getting the complete list of ISA values.

The main flow of the AppleObjCRuntime subclasses is now they must override "virtual bool UpdateISAToDescriptorMap_Impl();". This function will update the complete list of ISA values and create ClassDescriptorSP objects for each one. Now we have the complete list of valid ISA values which we can use for verification when doing dynamic typing.

Refactored a bunch of stuff so that the AppleObjCRuntime subclasses don't have to implement as many functions as they used to.

llvm-svn: 165730
2012-10-11 18:07:21 +00:00
Greg Clayton b29e6c6e84 Patch from Andrew Kaylor that fixes Linux default host triple values.
llvm-svn: 165728
2012-10-11 17:38:58 +00:00
Micah Villmow 083189730e Add in the first iteration of support for llvm/clang/lldb to allow variable per address space pointer sizes to be optimized correctly.
llvm-svn: 165726
2012-10-11 17:21:41 +00:00
Jason Molenda 3f9fa52ca7 When OptionValueFileSpec is given a filename starting
with ~, we need to realpath it.  Fixes the case where

settings set target.expr-prefix ~/lldb.prefix.header

wouldn't read this prefix header file.  <rdar://problem/12475676> 

llvm-svn: 165704
2012-10-11 06:05:54 +00:00
Jason Molenda 22f2fff3ff Change the scratch buffer for x86 assembly instructions in AssemblyParse_x86 from
malloc'ed heap to an llvm SmallVector.

llvm-svn: 165703
2012-10-11 06:04:37 +00:00
Enrico Granata 10de09044e <rdar://problem/12462744> Implement a new SBDeclaration class to wrap an lldb_private::Declaration - make a GetDeclaration() API on SBValue to return a declaration. This will only work for vroot variables as they are they only objects for which we currently provide a valid Declaration
llvm-svn: 165672
2012-10-10 22:54:17 +00:00
Jason Molenda 64dc7798a4 Move the scratch buffer allocation for x86 instructions from being allocated each instruction,
to once in the AssemblyParse_x86 ctor.
an instruction

llvm-svn: 165662
2012-10-10 21:37:00 +00:00
Jim Ingham 4f465cff8a Change the Thread constructor over to take a Process& rather than a ProcessSP. We can't create Threads with a NULL ProcessSP, so it makes no sense to use the SP.
Then make the Thread a Broadcaster, and get it to broadcast when the selected frame is changed (but only from the Command Line) and when Thread::ReturnFromFrame 
changes the stack.
Made the Driver use this notification to print the new thread status rather than doing it in the command.
Fixed a few places where people were setting their broadcaster class by hand rather than using the static broadcaster class call.

<rdar://problem/12383087>

llvm-svn: 165640
2012-10-10 18:32:14 +00:00
Jim Ingham 71bf299581 Don't make regexp commands as regular commands - they are "short cuts" and users should be able to override them with "unalias" but you can't unalias normal commands.
llvm-svn: 165630
2012-10-10 16:51:31 +00:00
Jason Molenda a72778119e Free the opcode_data malloc'ed memory instead of leaking it - thanks for catching that, Chris.
llvm-svn: 165597
2012-10-10 03:47:23 +00:00
Jason Molenda a8399a8cf1 Change the x86 unwinder from using edis as its disassembler
API (to get the length of x86 instructions) to using the LLVM-MC
disassembler.
<rdar://problem/12411000>

llvm-svn: 165587
2012-10-10 01:45:33 +00:00
Greg Clayton 64809ce783 Someone was using vi and left a little something in the code.
llvm-svn: 165580
2012-10-10 00:58:07 +00:00