Commit Graph

5558 Commits

Author SHA1 Message Date
Jason Molenda 48cd333b7c When increasing the amount of a file read, read the total of the Mach-O header
plus the size of the load commands in case the LC_UUID load command comes near
the end of the file.
<rdar://problem/16599318> 

llvm-svn: 206865
2014-04-22 04:52:30 +00:00
Jim Ingham 23ef27cd46 Give the clang functions names. This is only for logging.
llvm-svn: 206836
2014-04-22 01:42:22 +00:00
Jim Ingham fd95f8961e Make RunThreadPlan start the timeout clock for each part of the expression evaluation AFTER the
successful resume for that part.  This will make the timeouts more stable when lldb is running
in a busy program.

llvm-svn: 206835
2014-04-22 01:41:52 +00:00
Sylvestre Ledru b96ca6b0c8 Remove useless declaration
llvm-svn: 206764
2014-04-21 17:43:17 +00:00
Ed Maste d4612ad0f3 Switch NULL to C++11 nullptr in source/Symbol and source/Utility
Patch by Robert Matusewicz

llvm-svn: 206713
2014-04-20 13:17:36 +00:00
Ed Maste d78c9576ca Switch NULL to C++11 nullptr in source/Interpreter
Patch by Robert Matusewicz

llvm-svn: 206711
2014-04-20 00:31:37 +00:00
Saleem Abdulrasool 97fb5e128a Utility: fix compilation on Linux
When compiling on Linux with GCC 4.8, compilation would fail due to the use of
the offsetof macro.  This is a standard macro, defined in stddef.h.  Include
this header to ensure that offsetof is declared.

llvm-svn: 206702
2014-04-19 21:18:28 +00:00
Sean Callanan af90cf528c Included <inttypes.h> in a few headers that were
using preprocessor constants for printf() format
specifications.

llvm-svn: 206679
2014-04-19 03:09:28 +00:00
Todd Fiala 3dbe13f6a8 Address hung tests in Linux.
Follow-up patch coming to address test failures exposed by this change.

llvm-svn: 206618
2014-04-18 17:01:01 +00:00
Greg Clayton c71e7bc415 After updating to Xcode.5.1.1 LLDB framework stopped to support partial (only for STDIN) pseudo terminal usage in the debugging process.
Here is the fix resolving this issue.

Patch from Alexey Ushakov.

llvm-svn: 206476
2014-04-17 17:27:28 +00:00
Ed Maste 94ba368946 elf-core: Add FreeBSD signals
Sponsored by: DARPA, AFRL
Differential Revision: http://reviews.llvm.org/D3401

llvm-svn: 206469
2014-04-17 13:09:29 +00:00
Ed Maste 41736e3c0d elf-core: Strip trailing whitespace
llvm-svn: 206468
2014-04-17 13:06:49 +00:00
Ed Maste dbb67c46db Move FreeBSDSignals to Utility
It will shortly be need by FreeBSD elf core support on all hosts.

llvm-svn: 206466
2014-04-17 13:03:10 +00:00
Jim Ingham fe1c34266f Clean up the logic in setting timeouts a bit, and the logging as well.
llvm-svn: 206351
2014-04-16 02:24:48 +00:00
Jim Ingham b8cd5750b4 m_interrupt_sent wasn't being initialized, and wasn't being reset after an
interrupt.  Do both of those.

llvm-svn: 206350
2014-04-16 02:24:17 +00:00
Ed Maste 9b8d847b8f Add FreeBSD-specific SIGTHR and SIGLIBRT signals
llvm-svn: 206319
2014-04-15 20:22:32 +00:00
Sylvestre Ledru a3e4cebd96 Remove trailing spaces
llvm-svn: 206278
2014-04-15 12:08:57 +00:00
Sylvestre Ledru 5ac35ae6f7 Make LLDB builds against the current LLVM sources (modification on createMCDisassembler introduced by r206241)
llvm-svn: 206277
2014-04-15 12:07:25 +00:00
Hafiz Abid Qadeer 224746a400 Remove > 1 check against a boolean.
I saw a complain about this code on the LLVM channel. It looks wrong to me
as has_tag is a boolean. I am committing it as obvious.

llvm-svn: 206270
2014-04-15 10:06:47 +00:00
Jason Molenda c6fa5db747 Add some basic sanity checks to DynamicLoaderDarwinKernel::ReadKextSummaryHeader()
when it is reading the kext table, in case we're reading out of a core file with
corrupt contents in this region.
<rdar://problem/16601915> 

llvm-svn: 206233
2014-04-15 01:04:00 +00:00
Greg Clayton 3434b578be Fix LLDB to build with top of tree LLVM/Clang.
Patch from Michael Tao.

llvm-svn: 206213
2014-04-14 21:33:38 +00:00
Greg Clayton 8334e14efc Fixed SBThread.GetStopReasonDataAtIndex() to correctly return breakpoint location ID.
Patch from Vyacheslav Karpukhin.

llvm-svn: 206040
2014-04-11 17:27:02 +00:00
Enrico Granata bd4885f129 <rdar://problem/16540961>
The "unexpected value" message only matters to me, but is bound to make the experience more confusing for people when some uninitialized memory looks like an NSNumber and then can't be formatted properly, and that error comes out in the UI

Just drop the error message entirely - nobody but me cares

llvm-svn: 205978
2014-04-10 18:17:30 +00:00
Enrico Granata 1ac6296376 <rdar://problem/12055586>
Enable data formatters to see-through pointers/references to typedefs

For instance, if Foo is a typedef to Bar, and there is a formatter for any/all of Bar*, Bar&, Bar&&, then Foo*, Foo&, and Foo&& should pick these up if Foo-specific formatters don't exist

llvm-svn: 205939
2014-04-10 00:14:07 +00:00
Enrico Granata 699e14f3ce When trying to extract the type info for an r-value reference type, dont' cast to an l-value reference type
llvm-svn: 205932
2014-04-09 21:54:17 +00:00
Enrico Granata a0db6ed44b <rdar://problem/16477472>
Set the correct FormatManager revision before starting to figure out the new formatters
This can avoid entering some corner cases where as part of figuring out formatters we try to figure out dynamic types, and in turn that causes us to go back in trying to fetch new formatters - it is not only a futile exercise, it's also prone to endless recursion

This would only cause a behavior change if getting this chain started would eventually cause something to run and alter the formatters, a very unlikely if at all possible sequence of events

llvm-svn: 205928
2014-04-09 21:06:11 +00:00
Ed Maste 5b031ebc70 Use the default TID format in curses UI
TIDs are conventionally shown as decimal values on FreeBSD and Linux.
Thus, use the ${thread.id%tid} format string to display the thread ID,
instead of a fixed hex format.

llvm.org/pr19380

llvm-svn: 205912
2014-04-09 16:39:30 +00:00
Sean Callanan 131be99d24 Fixed a problem where IRForTarget wasn't ignoring
dbg_value intrinsics appropriately.

<rdar://problem/16504649>

llvm-svn: 205825
2014-04-09 00:59:41 +00:00
Jim Ingham 35878c4752 Fix the behavior when hand-calling a function times out on one thread,
but by the time we go to halt, it has already stopped by hitting the 
function end breakpoint.  That wasn't being shown to the threads so the
Function call thread plan didn't know its job was done.

<rdar://problem/16515785>

llvm-svn: 205803
2014-04-08 21:33:21 +00:00
Jim Ingham 7e9eff664c This function should be const.
llvm-svn: 205790
2014-04-08 20:24:45 +00:00
Enrico Granata 2b8fc66df2 Fix the GetArrayElementType() call so it will not crash when called on a non-array thing
Also, the stride is now a pointer so one can avoid passing it if it's not required

llvm-svn: 205782
2014-04-08 18:36:09 +00:00
Ed Maste 42c549b346 Revert r205769 as it breaks the build on FreeBSD:
error: declaration of constexpr static data member 'spec' requires an
initializer

llvm-svn: 205776
2014-04-08 17:02:25 +00:00
Ed Maste 4a06df95b9 Accept DWARF version 2 and 3 in debug_line tables
Issue reported by Matthew Gardiner.  Further work is necessary to
synchronize LLDB's DWARF classes with the derivatives now in LLVM.

llvm-svn: 205771
2014-04-08 15:12:07 +00:00
Virgile Bello 97a70e4f7e Added i686 architecture (ArchSpec::Core::eCore_x86_32_i686).
llvm-svn: 205770
2014-04-08 14:48:48 +00:00
Virgile Bello 8250ebdd8a Improve demangler to compile with MSVC.
llvm-svn: 205769
2014-04-08 14:46:44 +00:00
Greg Clayton 86e70cb3ac Fixed an issue where if you called:
SBTarget::AddModule(const char *path,
                    const char *triple,
                    const char *uuid_cstr,
                    const char *symfile);
                    
If "symfile" was filled in, it would cause us to not correctly add the module. Same goes for:

SBTarget::AddModule(SBModuleSpec ...)

Where you filled in the symfile.

<rdar://problem/16529799>

llvm-svn: 205750
2014-04-07 23:50:17 +00:00
Greg Clayton c7797accb8 Fixed a case where we could spin indefinitely if we got an error from fgets that isn't EINTR.
<rdar://problem/16535437>

llvm-svn: 205740
2014-04-07 21:37:59 +00:00
Greg Clayton 78d1019703 Cleanup the code a bit.
llvm-svn: 205739
2014-04-07 21:37:03 +00:00
Greg Clayton 521c2278ab Disable JITLoaderGDB on "vendor == apple" for now due to performance slowdowns for every first run process as a global name lookup in all shared libraries if performed.
<rdar://problem/16542894>

llvm-svn: 205734
2014-04-07 20:13:57 +00:00
Greg Clayton d20deac32d Xcode 5 crashes if lldb stops at breakpoint if long c++ template lists are present.
This fix reduces the stack size of SymbolFileDWARF::ParseType(). It seems that clang is not very good at sharing locations on the stack with local variables in large functions that have many blocks and each variable gets unique locations. The reduction in size was done by:
1 - removing some large locals that were default constructed by not used
2 - Placing some larger local variables into std::unique_ptr<> to make them on the heap
3 - removing local variables there were large and being populated but not being used
4 - reducing the size of some typedefs to llvm::SmallVector<T, N> so that N wasn’t excessively large


<rdar://problem/16431645>

llvm-svn: 205640
2014-04-04 18:15:18 +00:00
Greg Clayton c9cf579837 Don’t exit the command interpreter if we get interrupted by an EINTR when calling fgets().
llvm-svn: 205638
2014-04-04 18:11:31 +00:00
Jim Ingham 2e3881c0f5 Remember to clear the cached data for the OptionValueFileSpec in SetValueFromCString.
<rdar://problem/16179718> target.expr-prefix contents appear to be cached for an entire session

llvm-svn: 205636
2014-04-04 18:06:54 +00:00
Greg Clayton 7ec287cda3 Don’t crash when we get an invalid .debug_aranges set, just ignore it. Also print out warning messages if LLDB_CONFIGURATION_DEBUG is defined.
<rdar://problem/16516343>

llvm-svn: 205634
2014-04-04 17:53:30 +00:00
Saleem Abdulrasool 324a103619 sweep up -Wformat warnings from gcc
This is a purely mechanical change explicitly casting any parameters for printf
style conversion.  This cleans up the warnings emitted by gcc 4.8 on Linux.

llvm-svn: 205607
2014-04-04 04:06:10 +00:00
Ed Maste 0fdeb7158e Avoid crash if symbol returns a null name
llvm-svn: 205555
2014-04-03 19:27:39 +00:00
Jim Ingham 2f4693aa77 Get "dis -c -s" working again.
pr19324

llvm-svn: 205544
2014-04-03 17:16:17 +00:00
Jim Ingham 6c9ed91cca Make the fail messages
llvm-svn: 205497
2014-04-03 01:26:14 +00:00
Jason Molenda 987cbaa09b Add a missing arm64 idef.
llvm-svn: 205488
2014-04-02 23:52:55 +00:00
Jim Ingham 46d005dbc4 Workaround for collision between enum members in LLVM's MachO.h and system headers
on Mac OS X (in particular mach/machine.h).

<rdar://problem/16494607>

llvm-svn: 205480
2014-04-02 22:53:21 +00:00
Greg Clayton 711861fec5 Don’t #include "llvm/Support/MachO.h” as it isn’t needed here.
llvm-svn: 205462
2014-04-02 20:39:20 +00:00
Greg Clayton 3657e9c592 Don’t include “llvm/Support/MachO.h” as it isn’t needed here.
llvm-svn: 205461
2014-04-02 20:38:03 +00:00
Greg Clayton eadcca97cb Don’t #include “llvm/Support/MachO.h” in a header file if we can avoid it.
llvm-svn: 205460
2014-04-02 20:36:22 +00:00
Andrew MacPherson 82aae0d835 Use getpgid() with waitpid() in case the process pgid is not equal to its pid, as is the case with a forked subprocess. Also a couple of fixes for unit test failures from Todd Fiala.
llvm-svn: 205405
2014-04-02 06:57:45 +00:00
Saleem Abdulrasool 3985c8c646 sanitise sign comparisons
This is a mechanical change addressing the various sign comparison warnings that
are identified by both clang and gcc.  This helps cleanup some of the warning
spew that occurs during builds.

llvm-svn: 205390
2014-04-02 03:51:35 +00:00
Jim Ingham d80102e420 Add the ability to set python breakpoint commands from the SBBreakpoint & SBBreakpointLocation API's.
You can either provide the function name, or function body text.
Also propagate the compilation error up from where it is checked so we can report compilation errors.

<rdar://problem/9898371>

llvm-svn: 205380
2014-04-02 01:04:55 +00:00
Ed Maste 4e0999bc22 Implement ProcessMonitor::Kill for Linux
On FreeBSD ptrace(PT_KILL) is used to terminate the traced process
(as if PT_CONTINUE had been used with SIGKILL as the signal to be
delivered), and is the desired behaviour for ProcessPOSIX::DoDestroy.

On Linux, after ptrace(PTRACE_KILL) the traced process still exists
and can be interrogated.  It is only upon resume that it exits as though
it received SIGKILL.

As the Linux PTRACE_KILL behaviour is not used by LLDB, rename
BringProcessIntoLimbo to Kill, and change the implementation to simply
call kill() instead of using ptrace.

Thanks to Todd F for testing (Ubuntu 12.04, gcc 4.8.2).

Sponsored by: DARPA, AFRL
Differential Revision: http://llvm-reviews.chandlerc.com/D3159

llvm-svn: 205337
2014-04-01 18:14:06 +00:00
Ed Maste a837576a2a Add mips64 to the list of 64-bit Host architectures
llvm-svn: 205333
2014-04-01 18:06:45 +00:00
Ed Maste af58e02d1c mips64: clean up register context storage
Store the gpr data in a DataBufferHeap and use a DataExtractor to
extract register values with appropriate endianness.  This avoids hard-
coding the register count, and with some further work would allow this
class to provide generic register context storage for any CPU.

llvm-svn: 205329
2014-04-01 17:27:25 +00:00
Ed Maste 70882939f1 Implement ProcessMonitor::Kill for FreeBSD
On FreeBSD ptrace(PT_KILL) is used to terminate the traced process
(as if PT_CONTINUE had been used with SIGKILL as the signal to be
delivered), and is the desired behaviour for ProcessPOSIX::DoDestroy.

On Linux, after ptrace(PTRACE_KILL) the traced process still exists
and can be interrogated.  It is only upon resume that it exits as though
it received SIGKILL.

For now I'm committing only the FreeBSD change, until the Linux change
(review D3159) is successfully tested.

http://llvm.org/pr18894

llvm-svn: 205315
2014-04-01 14:30:56 +00:00
Enrico Granata 7ca1c76520 <rdar://problem/16424592>
For some reason, the libc++ vector<bool> data formatter was essentially a costly no-up, doing everything required of it, except actually generating the child values!

This restores its functionality

llvm-svn: 205259
2014-03-31 23:02:25 +00:00
Ed Maste 801335cc64 Fix one thread timeout logic
This should fix the seemingly-random failures observed on the FreeBSD
buildbot.

llvm-svn: 205241
2014-03-31 19:28:14 +00:00
Jason Molenda f8310d40c8 Include string.h for memset() prototype. Thanks Dmitri.
llvm-svn: 205115
2014-03-29 19:29:04 +00:00
Jason Molenda a332978b2a lldb arm64 import.
These changes were written by Greg Clayton, Jim Ingham, Jason Molenda.

It builds cleanly against TOT llvm with xcodebuild.  I updated the
cmake files by visual inspection but did not try a build.  I haven't
built these sources on any non-Mac platforms - I don't think this
patch adds any code that requires darwin, but please let me know if
I missed something.

In debugserver, MachProcess.cpp and MachTask.cpp were renamed to
MachProcess.mm and MachTask.mm as they picked up some new Objective-C
code needed to launch processes when running on iOS.

llvm-svn: 205113
2014-03-29 18:54:20 +00:00
Jim Ingham 914f4e7092 Add the ability from the SB API's to set the "one thread" timeout
for expression evaluations that try one and then all threads.

<rdar://problem/15598528>

llvm-svn: 205060
2014-03-28 21:58:28 +00:00
Jim Ingham 6c8824d216 Wait for the reply from the 'D' detach packet before tearing down the debugger. Avoids a race
condition where we could end up killing debugserver (and thus the target) before it had a chance
to detach.
Also fix debugserver to send the OK AFTER it detaches to avoid the same race condition.

<rdar://problem/16202713>

llvm-svn: 205043
2014-03-28 20:00:07 +00:00
Greg Clayton 241de26bdf Add the "lldb_complete" .editrc command back in case veteran users of LLDB had .editrc key mappings in their ~/.editrc.
<rdar://problem/16279283>

llvm-svn: 204870
2014-03-26 22:48:57 +00:00
Greg Clayton bc711e0575 Fixed a crasher when using 1 character type names in “type summary”, “type synthetic” and “type filter”.
Also fixed a missing return when making python summary functions on the fly.

<rdar://problem/16265491>

llvm-svn: 204867
2014-03-26 22:35:52 +00:00
Sean Callanan c4ca2c1d60 Made the Materializer not write back variables
if they didn't change, just like it does for
registers.  This makes life easier for kernel
debugging and any other situation where values
are read-only.

<rdar://problem/16367795>

llvm-svn: 204764
2014-03-25 22:30:19 +00:00
Enrico Granata 894f735953 <rdar://problem/14862302>
For small structs, the frame format now prints them as one-liners
This follows the same definition that frame variable does for deciding what a "small struct" is, and as such should be fairly consistent with the variable display in general

llvm-svn: 204762
2014-03-25 22:03:52 +00:00
Andrew MacPherson 6ef17b96aa Make ProcessLinux return true for DetachRequiresHalt() because PTRACE_DETACH requires this.
llvm-svn: 204759
2014-03-25 21:40:04 +00:00
Enrico Granata afcbdb1570 <rdar://problem/14515139>
Add a GetFoundationVersion() to AppleObjCRuntime
This API is used to return and cache the major version of Foundation.framework, which is potentially a useful piece of data to key off of to enable or disable certain ObjC related behaviors (especially in data formatters)

llvm-svn: 204756
2014-03-25 20:53:33 +00:00
Andrew MacPherson c3826b5ba6 Move calls to DisableAllBreakpointSites() and m_thread_list.DiscardThreadPlans() into base Process::Destroy() instead of in subclass DoDestroy() methods.
llvm-svn: 204752
2014-03-25 19:59:36 +00:00
Sean Callanan 9287289d66 Added a missing "break" to avoid falling through
when other cases get added.

llvm-svn: 204751
2014-03-25 19:47:07 +00:00
Sean Callanan 576a4374b7 Fixed the IRInterpreter to ignore call instructions
that call debug-information intrinsics.

llvm-svn: 204750
2014-03-25 19:33:15 +00:00
Todd Fiala 4339f3a434 Improve Elf object file UUID calculation performance.
This change makes significant improvements in the performance of
calculating a UUID within ObjectFileELF, and handles both running
processes and core files correctly. This does lazy evaluation of
UUID generation and caches the result when calculated.

Change by Piotr Rak.

llvm-svn: 204749
2014-03-25 19:29:09 +00:00
Greg Clayton fc03f8fcb6 A fix for: http://llvm.org/bugs/show_bug.cgi?id=19241
When there was no process, the expression options were set to not ignore breakpoints. This causes debug info to be generated and causes errors when evaluating simple expressions.

llvm-svn: 204745
2014-03-25 18:47:07 +00:00
Ed Maste b9fe0dd781 Add ObjectFileJIT library
llvm-svn: 204698
2014-03-25 02:03:28 +00:00
Jim Ingham 2f2c876e4f Make "disassemble -a" work when the target is not running yet. It will dump all the functions matching that address, just like "disassemble -n" does before running.
<rdar://problem/16406570>

llvm-svn: 204689
2014-03-25 00:15:47 +00:00
Greg Clayton 6f228bf965 Add ObjectFile/JIT to the makefile.
llvm-svn: 204685
2014-03-24 23:30:43 +00:00
Greg Clayton 8541258b4e Make cmake build the new ObjectFileJIT.
llvm-svn: 204683
2014-03-24 23:11:37 +00:00
Greg Clayton 23f8c95a44 JITed functions can now have debug info and be debugged with debug and source info:
(lldb) b puts
(lldb) expr -g -i0 -- (int)puts("hello")

First we will stop at the entry point of the expression before it runs, then we can step over a few times and hit the breakpoint in "puts", then we can continue and finishing stepping and fininsh the expression.

Main features:
- New ObjectFileJIT class that can be easily created for JIT functions
- debug info can now be enabled when parsing expressions
- source for any function that is run throught the JIT is now saved in LLDB process specific temp directory and cleaned up on exit
- "expr -g --" allows you to single step through your expression function with source code

<rdar://problem/16382881>

llvm-svn: 204682
2014-03-24 23:10:19 +00:00
Greg Clayton baf6e8e4b1 Include <mutex> for std::once.
llvm-svn: 204632
2014-03-24 18:08:18 +00:00
Hafiz Abid Qadeer b768fe5ea1 Renamed a struct from i386 to i386_.
It is to avoid build error when gcc defines i386.

llvm-svn: 204628
2014-03-24 17:33:09 +00:00
Greg Clayton 1d77a8203b Modified patch from Piotr Rak that makes GetSharedModuleList() more thread safe and also fixed a missed member initialization on the copy contractor and also makes the assignment operator safer.
llvm-svn: 204622
2014-03-24 16:50:33 +00:00
Arnaud A. de Grandmaison 62e5f4de3d Cleanup some dead assignements reported by scan-build
No functionnal change.

llvm-svn: 204545
2014-03-22 20:23:26 +00:00
Jim Ingham 7dabe1a1b6 If a single step ends on a breakpoint, it should be reported as a breakpoint hit
even though the underlying exception is a trace exception.

<rdar://problem/15243355>

llvm-svn: 204534
2014-03-22 00:44:41 +00:00
Andrew MacPherson ea77a5528d Suppress SIGSTOP under Linux and don't explicitly call SetResumeSignal() in POSIXThread, instead just let StopInfo handle it.
llvm-svn: 204504
2014-03-21 19:08:37 +00:00
Hafiz Abid Qadeer 8455c44e6c Don't build LLDBWrapPython.cpp for mingw.
Previous check relied on -DLLDB_DISABLE_PYTHON which was not valid as
it is defined in the top level LLDB Makefile which is included after the check.
If this check is moved after the inclusion of top level Makefile then 
BUILT_SOURCES is not properly handled. So I am using the scheme present
in the Host/Makefile.

llvm-svn: 204459
2014-03-21 12:53:28 +00:00
Greg Clayton 56b26a5707 Fixed case typo.
llvm-svn: 204402
2014-03-20 21:45:00 +00:00
Greg Clayton 906e9acf91 Switch over to use the ArchSpec::GetMachine() instead of ArchSpec::GetCore() to keep the code more portable as we add new core types to ArchSpec.
llvm-svn: 204400
2014-03-20 21:31:55 +00:00
Greg Clayton f587f8ec9a Add support for dumping DW_LNE_set_discriminator line table extended entries.
llvm-svn: 204369
2014-03-20 18:31:11 +00:00
Ed Maste d494b29596 Quiet Clang warning about signed/unsigned comparison
llvm-svn: 204360
2014-03-20 17:34:26 +00:00
Jim Ingham e1c34bf380 Guard against reading from host address of 0 in getting the data from a Value.
llvm-svn: 204359
2014-03-20 17:13:28 +00:00
Hafiz Abid Qadeer 10511b2a73 Change the type in va_arg call from char to int.
It is supposed to take fully promoted types.

llvm-svn: 204336
2014-03-20 11:24:44 +00:00
Saleem Abdulrasool a68f7b67f1 cleanup unreferenced functions
This is a mechanical cleanup of unused functions.  In the case where the
functions are referenced (in comment form), I've simply commented out the
functions.  A second pass to clean that up is warranted.

The functions which are otherwise unused have been removed.  Some of these were
introduced in the initial commit and not in use prior to that point!

NFC

llvm-svn: 204310
2014-03-20 06:08:36 +00:00
Saleem Abdulrasool 2643b9053e Core: preprocess out TestPromptFormats
TestPromptFormats appears as though it may be a useful unit test.
Unfortunately, there is no invocation mechanism in place right now.  It is
unclear how to add a unit test for this scenario to the existing tests.  It
would be ideal to remove this entirely, but I am hopeful that this can/will be
pulled out into a test still since it uses a user accessible interface.

llvm-svn: 204309
2014-03-20 06:08:21 +00:00
Enrico Granata fcd974a1ed rdar://16361422
Add NSMutableData to the list of types that the NSData formatter knows to represent

llvm-svn: 204289
2014-03-20 01:15:44 +00:00
Greg Clayton ec99086718 Change the backtrace view into a process tree view where you can expand the process, its threads and see all frames under each thread.
llvm-svn: 204251
2014-03-19 16:22:48 +00:00
Ed Maste a09ed03ce1 Fix expression parsing (on FreeBSD, at least)
This reverts part of r204112 (Expression: cleanup unused include).
It looks like MCJIT.h is required to force MCJIT to be linked.

llvm-svn: 204170
2014-03-18 18:55:06 +00:00
Saleem Abdulrasool 47a35dfd7c Expression: cleanup unused include
The standard JIT has been discarded in favour of MCJIT.  USE_STANDARD_JIT is no
longer defined.  Furthermore, the execution engine is now built in
IRExecutionUnit.  Simply remove inclusion of both JIT headers.

llvm-svn: 204112
2014-03-18 04:43:53 +00:00
Saleem Abdulrasool 44edda0af7 create constants for multichar constants
Multichar constants are not portable as the byte order is undefined.  Use a
constant value instead.  This avoids a warning when compiling with gcc 4.8+
(-Wmultichar) and makes the code more portable.

llvm-svn: 204110
2014-03-18 04:43:47 +00:00
Jim Ingham 0eed738008 Get "ThreadPlanShouldStopHere" to handle auto-stepping through line number 0 code.
llvm-svn: 204087
2014-03-17 23:03:34 +00:00
Ed Maste 263c9280b3 Correct copy-and-pasted comments for DetachOperation
llvm-svn: 204064
2014-03-17 17:45:53 +00:00
Ed Maste b3a5333b07 Update copy-and-pasted log message
llvm-svn: 204057
2014-03-17 17:05:22 +00:00
Greg Clayton 26c1fe3568 Parse DW_AT_ranges for compile units on Darwin when .debug_aranges is not available for the current compile unit.
<rdar://problem/16321434> 

llvm-svn: 203985
2014-03-14 23:36:38 +00:00
Saleem Abdulrasool eb4592b18d build: fix libxml2 detection via CMake
libxml2's include path was unconditionally set to /usr/include/libxml2.  This
would work previously, however, Mavericks removed the /usr/include directory.
Since LLDB already requires clang, which via LLVM's build infrastructure
searches for libxml2, we have a proper include path for libxml2.  If
LIBXML2_FOUND is set, do not touch the libxml2 search path.  Instead, allow the
clang's definition to propagate throughout the LLVM build.  Otherwise, switch to
find_package(LibXml2) as clang does.  This will ensure that the correct path is
used for libxml2 irrespective of the platform.

Furthermore, treat libxml2 as a system provided library.  It is not part of the
LLVM source base so it is of little value to enable all warnings on its headers.
This unifies the treatment of libxml2 across clang and LLDB.

llvm-svn: 203955
2014-03-14 18:23:07 +00:00
Greg Clayton 05da458caf One more time. Multi-line expressions when there is no valid expression that follow “expr [options] —“.
llvm-svn: 203874
2014-03-13 23:48:40 +00:00
Greg Clayton 487143fdd3 Fixed crasher when “expr” was NULL due to no characters following the terminating "--".
llvm-svn: 203873
2014-03-13 23:46:26 +00:00
Greg Clayton cf28a8b7cd Allow a multi-line expression to follow expression commands with options when there is no expression following the option terminating “—“.
llvm-svn: 203872
2014-03-13 23:42:30 +00:00
Todd Fiala 8a5c5a016c Fix cmake build issues on Darwin.
llvm-svn: 203850
2014-03-13 21:16:13 +00:00
Hafiz Abid Qadeer b4bc64962a Changed "Windows.h" to "windows.h".
I missed this one in my earlier commit a few days ago.

llvm-svn: 203787
2014-03-13 11:39:01 +00:00
Hafiz Abid Qadeer a1b42ec0f2 Change type of a few members of a struct from unsigned to signed.
They are used in Windows APIs which expect a signed argument and
cause a build failure on Mingw.

llvm-svn: 203783
2014-03-13 10:47:49 +00:00
Andrew MacPherson eb4d0607bf Create a Process::ModulesDidLoad() method to handle process-related tasks, as suggested by Jim Ingham. Make JITLoader instances use this to probe only new modules for relevant JIT symbols. Also re-enable the JITLoader hooks in Process.
llvm-svn: 203774
2014-03-13 09:37:02 +00:00
Jason Molenda aac16e0f80 Add a SBQueue::GetKind() method to retrieve the type of libdispatch queue (serial or concurrent).
<rdar://problem/7964505>

llvm-svn: 203748
2014-03-13 02:54:54 +00:00
Jim Ingham 4b4b2478fc This commit reworks how the thread plan's ShouldStopHere mechanism works, so that it is useful not only
for customizing "step-in" behavior (e.g. step-in doesn't step into code with no debug info), but also 
the behavior of step-in/step-out and step-over when they step out of the frame they started in.

I also added as a proof of concept of this reworking a mode for stepping where stepping out of a frame
into a frame with no debug information will continue stepping out till it arrives at a frame that does
have debug information.  This is useful when you are debugging callback based code where the callbacks
are separated from the code that initiated them by some library glue you don't care about, among other
things.

llvm-svn: 203747
2014-03-13 02:47:14 +00:00
Jim Ingham 23b95f06e1 Don’t put Radar numbers in code.
llvm-svn: 203737
2014-03-12 23:43:15 +00:00
Jim Ingham 157831313d When clearing a breakpoint site, make sure the owning process still exists before asking it to remove the breakpoint site the rest of the way.
<rdar://problem/16303500>

llvm-svn: 203724
2014-03-12 22:03:13 +00:00
Greg Clayton 88e193a053 If DWARF debug info and verbose mode is enabled ("log enable dwarf info verbose"), then dump all DIEs for a compile unit after all DIEs have been parsed for a compile unit.
llvm-svn: 203692
2014-03-12 18:26:18 +00:00
Greg Clayton 181405d3c2 Allow verbose logging in the "dwarf" log channel.
llvm-svn: 203684
2014-03-12 17:58:29 +00:00
Ed Maste 16860ec640 Add Process/Utility include directory on FreeBSD
Needed after r203667

llvm-svn: 203672
2014-03-12 16:21:57 +00:00
Virgile Bello 3e699d419e Moved various RegisterContext files from Process/POSIX to Process/Utility for easier sharing.
Fix Windows build by adding JITLoaderGDB and ProcessElfCore.
RegisterContext: fixes for Windows build: sizeof(GPR::register) didn't work, switched to sizeof(((GPR*)NULL)->register).

llvm-svn: 203667
2014-03-12 16:04:29 +00:00
Hafiz Abid Qadeer 487767cfc8 Replace some Windows specific string functions with std::string.
llvm-svn: 203654
2014-03-12 10:53:50 +00:00
Hafiz Abid Qadeer 1c03005664 Moved a check in HostGetOpt.h.
It can be used in multiple files now.

llvm-svn: 203652
2014-03-12 10:48:19 +00:00
Hafiz Abid Qadeer 6eff101926 Replace some _MSC_VER with _WIN32.
This allows to use some code for mingw which was previously only
used for MSVC.

llvm-svn: 203651
2014-03-12 10:45:23 +00:00
Hafiz Abid Qadeer bdb515916c Added some missing header files.
They help fix mingw build.

llvm-svn: 203650
2014-03-12 10:39:46 +00:00
Hafiz Abid Qadeer 581eb95983 Add some missing defines that are already present in the cmake side.
This is to help fix mingw build.

llvm-svn: 203649
2014-03-12 10:35:00 +00:00
Sean Callanan e3236a1882 Fixed a problem where the expression parser was
erroneously completing Objective-C classes sourced
from the Objective-C runtime without checking if
there was an authoritative version in the debug
information.

<rdar://problem/16065049>

llvm-svn: 203600
2014-03-11 19:34:04 +00:00
Sean Callanan 339f61549f Followed up on Ed Maste's patch with a few more
User fixes.  Also changed our iterations across
global variables and instruction operands to
reflect the new C++11 approach.

llvm-svn: 203599
2014-03-11 19:19:16 +00:00
Jim Ingham f164d9404d After doing all the work to compute the target ValueObject we want to evaluate, make sure
we actually got something before proceeding.

<rdar://problem/16282875>

llvm-svn: 203591
2014-03-11 18:17:23 +00:00
Saleem Abdulrasool 1108cb3682 update for renaming in LLVM
llvm-svn: 203533
2014-03-11 03:09:08 +00:00
Saleem Abdulrasool 12390847fb build: fix bleeding whitespace
llvm-svn: 203531
2014-03-11 03:08:47 +00:00
Jason Molenda 2528631f12 Minor fix for a logging message.
llvm-svn: 203512
2014-03-10 23:18:34 +00:00
Hafiz Abid Qadeer a667875fb9 Fix Mingw build error by using lower case name for windows header files.
llvm-svn: 203505
2014-03-10 22:31:39 +00:00
Ed Maste bde27d2451 Fix #if 0'd code after range-based for loop change
llvm-svn: 203487
2014-03-10 20:49:37 +00:00
Ed Maste a855309bcd Update LLDB for LLVM iterator change in r203364
What was use_iterator is now user_iterator.  Also switch to range-based
APIs, as in Clang r203365.

(This part of the change was missed in r203463)

Differential Revision: http://llvm-reviews.chandlerc.com/D3030

llvm-svn: 203475
2014-03-10 17:24:16 +00:00
Ed Maste 80e8cc6dee Update LLDB for LLVM iterator change in r203364
What was use_iterator is now user_iterator.  Also switch to range-based
APIs, as in Clang r203365.

llvm-svn: 203463
2014-03-10 14:23:10 +00:00
Jason Molenda e32cd191f0 Correctly add the QueueID to a pending block's extended thread backtrace thread.
Seed the QueueItem objects with the item_refs and addresses when they are fetched
in one batch.  If additional information is needed from the QueueItem, fetch it
lazily one pending item per function call.
<rdar://problem/16270007>, <rdar://problem/16032150> 

llvm-svn: 203449
2014-03-10 08:42:03 +00:00
Jason Molenda 37e9b5ab38 libBacktraceRecording __introspection_dispatch_queue_get_pending_items is
changing the data it returns; this change accepts either the old format or
the new format.  It doesn't yet benefit from the new format's additions -
but I need to get this checked in so we aren't rev-locked.
Also add a missing .i entry for SBQueue::GetNumRunningItems() missing from
the last checkin.
<rdar://problem/16272115> 

llvm-svn: 203421
2014-03-09 21:17:08 +00:00
Jason Molenda fe95dc95b5 SBQueue::GetNumPendingItems() should not force a fetch of the pending
items; the backing Queue object has the number of pending items
already cached.  Also, add SBQueue::GetNumRunningItems() to provide
that information.
<rdar://problem/16272016> 

llvm-svn: 203420
2014-03-09 19:41:30 +00:00
Virgile Bello 2641e383a2 Fix unwind_plan test conditions (could result in NULL memory access).
llvm-svn: 203385
2014-03-09 10:01:25 +00:00
Virgile Bello be6ddab060 PlatformWindows: Fix ObjectFile presence test conditions (could result in NULL memory access)
llvm-svn: 203384
2014-03-09 10:00:40 +00:00
Virgile Bello 89eb1baea3 Implement ObjectFilePECOFF::GetModuleSpecifications().
llvm-svn: 203383
2014-03-09 09:59:36 +00:00
Saleem Abdulrasool 9174593d09 POSIX: fix possible API misuse
memcpy cannot be passed NULL.  Ensuring that the destination pointer is non-NULL
requires checking success.  Rather than performing the success check at that
point, increasing indentation an additional level, fold it into the previous
statement.

llvm-svn: 203359
2014-03-08 20:47:12 +00:00
Saleem Abdulrasool d41fca11af POSIX: fix possible invalid API usage
strcmp cannot be passed a NULL.  Add a short-circuiting check to avoid the
possible API misuse.

llvm-svn: 203358
2014-03-08 20:47:07 +00:00
Saleem Abdulrasool 03700ded1b POSIX: add missing curly braces
It seems that the original commit missed the curly braces for the scope, always
doing the string comparision.

llvm-svn: 203357
2014-03-08 20:47:03 +00:00
Virgile Bello 2756adf377 Implement ObjectFilePECOFF::SetLoadAddress().
llvm-svn: 203350
2014-03-08 17:17:20 +00:00
Virgile Bello ffeba25652 Remove %zx in printf (only GCC supports it, not MSVC).
llvm-svn: 203349
2014-03-08 17:15:35 +00:00
Virgile Bello da0fc76e7f Add inttypes.h to SBQueue.cpp (MSVC compilation error with PRIx32).
llvm-svn: 203348
2014-03-08 16:22:55 +00:00
Jason Molenda ac605f4a3a Add API logging to the SBQueue/SBQueueItem/SBThread calls.
llvm-svn: 203330
2014-03-08 01:34:55 +00:00
Jason Molenda 0d6a1ff23d Fix a small inferior process memory leak in SystemRuntimeMacOSX::PopulatePendingItemsForQueue().
llvm-svn: 203312
2014-03-07 23:28:54 +00:00
Jason Molenda 790b4e527b Re-enable ProcessElfCore for non-FreeBSD/Linux builds; with Greg's fix in r203274
this is not installing itself for Mach-O binaries.

llvm-svn: 203310
2014-03-07 23:23:10 +00:00
Greg Clayton 289dde27a2 Remove unused code.
llvm-svn: 203292
2014-03-07 21:51:19 +00:00
Greg Clayton 9cbd3c628c Verify we have a correct ELF or Mach core file before we return a valid instace of ProcessElfCore or ProcessMachCore respectively.
llvm-svn: 203274
2014-03-07 19:24:39 +00:00
Jim Ingham 4a65fb1f25 Don't hold the ThreadList lock over calls to the GetStatus (Process or Thread) calls
or the lower levels of the Process won't be able to restart.

<rdar://problem/16244835>

llvm-svn: 203233
2014-03-07 11:20:03 +00:00
Jim Ingham a04ef756d4 If you are disabling a hardware breakpoint, use z1 not z0.
<rdar://problem/16256532>

llvm-svn: 203232
2014-03-07 11:18:02 +00:00
Jim Ingham 0ff099f10c The ThreadPlanCallFunction needs to pass its "StopOthers" to its run to address subplan.
llvm-svn: 203231
2014-03-07 11:16:37 +00:00
Ben Langmuir 9f0bac5cd1 Update for clang r203213
llvm-svn: 203217
2014-03-07 08:31:36 +00:00
Jason Molenda e4ea6f5901 Todd points out that my change to ProcessElfCore is probably
not going to key off of the ELF object file like I'd intended.
Revert my change in r203205; also revert Greg's change in
r203107 which builds ProcessElfCore on non-Linux/FreeBSD systems
for the moment until we can straighten this out.

llvm-svn: 203207
2014-03-07 06:28:29 +00:00
Jason Molenda 75fb3d70e2 Only enable ProcessElfCore if this is an ELF file. Right now this plugin is winning over
ProcessMachCore because it doesn't check the format of the file up front.  (this is only now
happening because of Greg's change in r203178 to build ProcessElfCore for non-Linux/FreeBSD
hosts).
<rdar://problem/16257533> 

llvm-svn: 203205
2014-03-07 06:15:24 +00:00
Ahmed Charles 8f926ad0d9 Replace uses of OwningPtr<T> with std::unique_ptr<T>.
llvm-svn: 203200
2014-03-07 04:45:22 +00:00
Greg Clayton f6913cd7af Allow line numbers to be shown in multi-line expressions.
llvm-svn: 203185
2014-03-07 00:53:24 +00:00
Greg Clayton 0e4b605e47 Re-enable the JITLoaderGDB and ProcessElfCore that were disabled by:
Author: ace2001ac
Date: Thu Mar  6 05:30:34 2014
New Revision: 203107

URL: http://llvm.org/viewvc/llvm-project?rev=203107&view=rev
Log:
Fix Windows build break introduced in r203035.

Add '#if defined(__linux__) || defined(__FreeBSD__)' around JITLoaderGDB
and ProcessElfCore, which are only built on Linux and FreeBSD.

Modified:
   lldb/trunk/source/lldb.cpp

Windows will need to start building all files necessary so that JITLoaderGDB and ProcessElfCore can build since they should work on all platforms.

llvm-svn: 203178
2014-03-06 23:29:58 +00:00
Ahmed Charles 943d4a6896 Fix Windows build break introduced in r203035.
Add '#if defined(__linux__) || defined(__FreeBSD__)' around JITLoaderGDB
and ProcessElfCore, which are only built on Linux and FreeBSD.

llvm-svn: 203107
2014-03-06 11:30:34 +00:00
Jason Molenda a8ff543c28 When a client asks for a queue pending item's extended backtrace,
hold a strong pointer to that extended backtrace thread in the Process
just like we do for asking a thread's extended backtrace.
Also, give extended backtrace threads an invalid ThreadIndexID number.
We'll still give them valid thread_id's.  Clients who want to know the
original thread's IndexID can call GetExtendedBacktraceOriginatingIndexID().
<rdar://problem/16126034> 

llvm-svn: 203088
2014-03-06 06:31:18 +00:00
Jim Ingham 82536bdbbf Temporarily disable the JIT loading detector till we figure out why it crashes when lldb follows through exec's...
llvm-svn: 203068
2014-03-06 03:47:34 +00:00
Greg Clayton 4b047f2378 Moved JITLoader.cpp and JITLoaderList.cpp over into "source/Target" since the header files were in "include/lldb/Target".
Also enabled the ELF Core file support in all builds since the header files have been properly separated from ProcessMonitor.

llvm-svn: 203035
2014-03-06 00:14:12 +00:00
Jason Molenda b509a414f0 Add the new JITLoader plugin files to the lldb xcode project file.
Add a cast for a size_t / PRIu64 printf formatter.

llvm-svn: 203030
2014-03-05 23:48:15 +00:00
Ed Maste 32aa12b86c Build JITLoader on FreeBSD also
llvm-svn: 202980
2014-03-05 13:57:24 +00:00
Ed Maste 29150c1731 Put "jit" in alpha order in log category list
llvm-svn: 202976
2014-03-05 13:43:23 +00:00
Andrew MacPherson 17220c1886 Add support for JIT debugging on Linux using the GDB JIT interface. Patch written with Keno Fischer.
llvm-svn: 202956
2014-03-05 10:12:43 +00:00
Jason Molenda 0ddfe7f8dc Small fix to DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule needed
with Greg's change to how we load modules in r202890.

llvm-svn: 202933
2014-03-05 03:33:01 +00:00
Steve Pucci 03904accc0 Add ProcessGDBRemote::GetAuxvData() and fix multiple-packet concatenation for binary data.
ProcessGDBRemote::GetAuxvData obtains the auxv from a remote gdbserver (via a binary-data packet), and returns the data as a DataBufferSP.

The patch includes a small fix to GDBRemoteCommunicationClient::SendPacketsAndConcatenateResponses() to support binary file format packet returns (by not assuming each binary packet is a null-terminated string when concatenating them).

llvm-svn: 202907
2014-03-04 23:18:46 +00:00
Sean Callanan 9bbf3cd3d7 Hardened against reads in the IRMemoryMap that
exceed the bounds of the backing memory.

<rdar://problem/16088322>

llvm-svn: 202899
2014-03-04 21:56:11 +00:00
Greg Clayton 34f1159bbd Fixed SBDebugger.CreateTarget("filename") and also make sure remote targets don't pickup bogus locally cached files.
<rdar://problem/16217254>
<rdar://problem/16078651>

llvm-svn: 202890
2014-03-04 21:20:23 +00:00
Todd Fiala 1251053e04 Get Linux i386 running.
This change uses a fixed known offset for the Linux i386 DR0 register.
This change also undoes the 32-bit wordsize change from r169645 that
revolved around being 32-bit/64-bit friendly in
WriteRegOperation::Execute within the Linux ProcessMonitor.cpp. I ran
all the tests on x86_64 Linux with no failures. I also ran some simple
tests with 32-bit Linux exe on x86_64 host and 32-bit linux exe on
i686 32-bit host and these worked fine.

Note (from Todd): the UserData struct in the Linux i386 register
context (only used by Linux i386 host running Linux 32-bit inferior)
is out of sync with what shows up in the sys/user.h for an 32-bit
Linux build (per an earlier change of mine to make it look more like
x86_64 host running x86 exe). I think we should (1) make i386 Linux
targets run using the same register context (and correct ones) on i386
and x86_64 linux hosts if that is possible, and (2) we could use some
tests around the register handling, particularly to verify things like
DR0 registers are in the right spots on host/target combos that we can
verify vs. known correct values.

Change by Matthew Gardiner.

llvm-svn: 202887
2014-03-04 20:46:32 +00:00
Jim Ingham 8f63266569 Fix a couple of typo's in breakpoint descriptions.
llvm-svn: 202782
2014-03-04 03:09:00 +00:00
Jason Molenda 8d08a78c30 Temporarily revert part of Greg's changes in r202738 which are causing problems with the testsuite and SBDebugger::CreateTarget().
llvm-svn: 202776
2014-03-04 02:07:24 +00:00
Greg Clayton e556a4230c Stop messages from being emitted out of order when detaching.
llvm-svn: 202756
2014-03-03 20:29:02 +00:00
Jim Ingham 8225d59b3f Only require thread scope when we're about to run the function on a thread.
llvm-svn: 202740
2014-03-03 19:16:45 +00:00
Greg Clayton 6fea17e874 "size_t" isn't always 64 bit, it is 32 bit on 32 bit systems. All printf style statements that were assuming size_t were 64 bit were changed, and they were also changed to display them as unsigned values as "size_t" isn't signed.
If you print anything with 'size_t', please cast it to "uint64_t" in the printf and use PRIu64 or PRIx64.

llvm-svn: 202738
2014-03-03 19:15:20 +00:00
Deepak Panickal 6419e98ee1 Check if the terminal is interactive and set the flags accordingly
llvm-svn: 202726
2014-03-03 15:53:37 +00:00
Deepak Panickal d582f69469 Move Windows getopt for building the DLL
llvm-svn: 202725
2014-03-03 15:52:27 +00:00
Deepak Panickal 627f4ae811 Build liblldb.dll in Windows
llvm-svn: 202724
2014-03-03 15:50:36 +00:00
Deepak Panickal 99fbc07600 Fix Windows build using portable types for formatting the log outputs
llvm-svn: 202723
2014-03-03 15:39:47 +00:00
Ed Maste 6fa32b6f54 Don't require a valid thread if expr can be evaluated statically
This seems reasonable and the BackticksWithNoTargetTestCase suggests it
should be this way.

llvm-svn: 202722
2014-03-03 15:37:30 +00:00
Jim Ingham 36a02e0655 Make sure the exe_ctx passed to ClangUserExpression::Execute has a valid thread.
<rdar://problem/15949113>

llvm-svn: 202561
2014-03-01 00:17:06 +00:00
Sean Callanan 866e91c9d4 Better error reporting when a variable can't be
read during materialization.  First of all, report
if we can't read the data for some reason.  Second,
consult the ValueObject's error and report that if
there's some problem.

<rdar://problem/16074201>

llvm-svn: 202552
2014-02-28 22:27:53 +00:00
Ed Maste 111387c47b Simplify POSIXThread register context handling
This seems a little more straightforward and is equivalent to r201457
for ELF core files.  A case for FreeBSD i386 is also added (it was
incorrectly using the 64-bit register context and corrupting mememory).

Better (user-facing) error handling is still needed.

Review: http://llvm-reviews.chandlerc.com/D2765
llvm-svn: 202549
2014-02-28 22:15:58 +00:00
Todd Fiala 620ea83926 Fixed configure-based build on OS X.
This change adds a missing include path to the
ObjC LanguageRuntime path to the MacOSX SystemRuntime
plugin's Makefile.

It also adds the panel and curses library to the liblldb
shared library linkage step.

Changes by Jevin Sweval with a minor tweak.

llvm-svn: 202547
2014-02-28 21:55:46 +00:00
Greg Clayton 3121fde41a Be sure to propagate the error back out SBTarget::Attach() when we fail to launch debugserver as root.
<rdar://problem/15669788>

llvm-svn: 202536
2014-02-28 20:47:08 +00:00
Greg Clayton ec67ab1e0c Fixed "process launch --tty" on MacOSX.
llvm-svn: 202535
2014-02-28 20:25:41 +00:00
Greg Clayton b4874f1a70 Fixed all overlapping prompt issues.
I carefully reviewed exactly how the IOHandlers interact and found places where we weren't properly controlling things. There should be no overlapping prompts and all output should now come out in a controlled fashion.

<rdar://problem/16111293>

llvm-svn: 202525
2014-02-28 18:22:24 +00:00
Ed Maste c71f60f4a1 Restore signal delivery to the inferior on FreeBSD
This was broken in the threaded inferior implementation for FreeBSD
(r196787) and caused FreeBSD to resume always with no signal.

llvm-svn: 202513
2014-02-28 17:13:39 +00:00
Ed Maste 2c2f83ef07 Fix types to eliminate compiler warnings in FreeBSD host class
llvm-svn: 202498
2014-02-28 13:46:51 +00:00
Jim Ingham 286fb1ef32 Plumb the EvaluateExpressionOptions::{Set,Get}StopOthers through the SB API, and make it work in RunThreadPlan.
Also remove SetStopOthers from the ThreadPlanCallFunction, because if the value you have doesn't match what is
in the EvaluateExpressionOptions the plan was passed when created it won't work correctly.

llvm-svn: 202464
2014-02-28 02:52:06 +00:00
Sylvestre Ledru 451ca2924c remove useless declarations found thanks to scan-build
llvm-svn: 202440
2014-02-27 22:46:23 +00:00
Todd Fiala 4507f06aaa Fix linux x86 debugging on a linux x86 host (32-bit on 32-bit).
This change fixes up issues with specifying the size of the i386
register infos for FPU registers.  The bug was that for the i386
register context, the size of the FPU registers were still being
computed based on the x86_64 FXSAVE structure.

This change permits the FPR_SIZE macro to optionally be defined
outside of RegisterInfos_i386.h, which RegisterContextLinux_i386.cpp
does properly. It redefines the FPR_i386 structure with all the
accessible parts that RegisterInfos_i386.h wants to see, which we had
not done before when we made the overall size of the structure
properly sized a recently.

This change also modifies POSIXThread to create a
RegisterContextLinux_i386 only when the host is 32-bit; otherwise, it
uses the RegisterContextLinux_x86_64, which works properly for 32-bit
and 64-bit inferiors on a 64-bit host.

I tested this debugging a Linux x86 exe on an x86 host (Ubuntu 13.10
x86), and debugging a Linux x86 exe and a Linux x86-64 exe on an
x86-64 host (Ubuntu 12.04 LTS).  Those cases all worked.

Thanks to Matthew Gardiner who discoverd may key insights into
tracking down the issue. The motivation for this change and some of
the code originates from him via this thread:

http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140224/010554.html

llvm-svn: 202428
2014-02-27 20:46:12 +00:00
Jim Ingham d6efa2a977 Check call to fgetc for EINTR.
<rdar://problem/16140277>

llvm-svn: 202426
2014-02-27 19:48:13 +00:00
Greg Clayton 1681092f96 Remove an assertion that was being hit due to slow DNS name lookups on MacOSX for "localhost".
Changed all "localhost" to "127.0.0.1" to prevent potentially long name lookups.

<rdar://problem/16154630>

llvm-svn: 202424
2014-02-27 19:38:18 +00:00
Greg Clayton fdbad6d5d8 Improve logging a bit by printing the exception or signal type description.
llvm-svn: 202423
2014-02-27 19:35:12 +00:00