Commit Graph

5558 Commits

Author SHA1 Message Date
Todd Fiala 9734280f33 Fix broken tests due to new error output.
This reverses out the options validators changes.  We'll get these
back in once the changes to the output can be resolved.

Restores broken tests on FreeBSD, Linux, MacOSX.

Changes reverted: r212500, r212317, r212290.

llvm-svn: 212543
2014-07-08 15:55:32 +00:00
Zachary Turner 310035a4f9 Implment "platform process list" for Windows.
This patch implements basic functionality of the "platform process
list" command for Windows.  Currently this has the following
limitations.

* Certain types of filtering are not enabled (e.g. filtering by
  architecture with -a), although most filters work.
* The username of the process is not yet obtained.
* Using -v to list verbose information generates an error.
* The architecture column displays the entire triple, leading to
  misaligned formatting of the printed table.

Reviewed by: Greg Clayton
Differential Revision: http://reviews.llvm.org/D4413

llvm-svn: 212510
2014-07-08 04:52:15 +00:00
Zachary Turner 24f3dee6ca Fix a compilation failure caused by a non-const reference.
llvm-svn: 212509
2014-07-08 04:28:07 +00:00
Jim Ingham 30fadafefe If a hand-called function is interrupted by hitting a breakpoint, then
when you continue to finish off the function call, the expression result
will be included as part of the thread stop info.

llvm-svn: 212506
2014-07-08 01:07:32 +00:00
Zachary Turner 28638911cd Invalidate process UID/GID-related command options on Windows.
Windows uses a different process security model and does not have
a concept of process UID or GID.  This patch makes these options
invalid on Windows.  Attempting to specify these options when the
current platform is Windows will generate an error.

Reviewed by: Jim Ingham
Differential Revision: http://reviews.llvm.org/D4373

llvm-svn: 212500
2014-07-07 23:54:51 +00:00
Todd Fiala 6d1fbc9c56 Allow specification of no source display on stop.
See http://llvm.org/bugs/show_bug.cgi?id=20149 for details.

Change by Randy Smith.

llvm-svn: 212485
2014-07-07 20:47:24 +00:00
Sylvestre Ledru ceab3ac375 remove trailing whitespace + remove some useless comments
llvm-svn: 212411
2014-07-06 17:54:58 +00:00
Sylvestre Ledru 3cc9d63031 Update lldb code to match the change in clang r212386
llvm-svn: 212410
2014-07-06 17:50:36 +00:00
Alp Toker 5f83864b7c Track changes from clang r212388
llvm-svn: 212391
2014-07-06 05:36:57 +00:00
Alp Toker edc902f3bb Track IntrusiveRefCntPtr::get() changes from LLVM r212366
llvm-svn: 212368
2014-07-05 03:06:05 +00:00
Todd Fiala 1b67c66c9c Windows build fixes and removal of endlessly recursive termination function.
This change removes the ScriptInterpreter::TerminateInterpreter() call which
ended up endlessly calling itself as things currently stand.  It also cleans
up some other Windows-related cmake changes.

See http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140630/011544.html
for more details.

Change by Zachary Turner

llvm-svn: 212320
2014-07-04 06:58:01 +00:00
Todd Fiala 859aff501b Fix OptionDefinition break from r212290.
Fixes some structure definitions in CommandObjectType
that needed to be adjusted for a new OptionDefinition
field.

llvm-svn: 212317
2014-07-04 06:09:04 +00:00
Zachary Turner 35974065fe Fix -Wnull-conversion warning.
llvm-svn: 212304
2014-07-03 23:44:14 +00:00
Zachary Turner de963e9a09 Adds the notion of an OptionValidator.
The purpose of the OptionValidator is to determine, based on some
arbitrary set of conditions, whether or not a command option is
valid for a given debugger state.  An example of this might be
to selectively disable or enable certain command options that
don't apply to a particular platform.

This patch contains no functional change, and does not actually
make use of an OptionValidator for any purpose yet.  A follow-up
patch will begin to add the logic and users of OptionValidator.

Reviewed by: Greg Clayton, Jim Ingham

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

llvm-svn: 212290
2014-07-03 20:34:18 +00:00
Zachary Turner 78b84f5454 Fix compilation errors introduced by host Pipe abstraction
on Windows.

llvm-svn: 212255
2014-07-03 05:20:28 +00:00
Bruce Mitchener 1d0089fa5c Add enumerations for additional languages from DWARF spec updates.
llvm-svn: 212246
2014-07-03 00:49:08 +00:00
Todd Fiala dda6194399 lldb - problem with some PTRACE_* constants in NativeProcessLinux.cpp file
See http://reviews.llvm.org/D4366 for details.

Change by Paul Paul Osmialowski

Today this is the only problem that I'm facing trying to cross-compile lldb for AArch64 using Linaro's toolchain.

PTRACE_GETREGS, PTRACE_SETREGS, PTRACE_GETFPREGS, PTRACE_SETFPREGS are not defined for AArch64
These things can be defined different ways for other architectures, e.g. for x86_64 Linux, asm/ptrace-abi.h defines them as preprocessor constants while sys/ptrace.h defines them in enum along with corresponding PT_* preprocessor constants
NativeProcessLinux.cpp includes sys/ptrace.h
To avoid accidental redefinition of enums with preprocessor constants, I'm proposing this patch which first checks for PT_* preprocessor constants then checks for PTRACE_* constants then when it still can not find them, it defines preprocessor constants.
Similar approach was already used for PTRACE_GETREGSET and PTRACE_SETREGSET constants; in this case however it was easier, since enum values in sys/ptrace.h and preprocessor constants shared all exactly the same names (e.g. there's no additional PT_GETREGSET name defined).

llvm-svn: 212225
2014-07-02 21:34:04 +00:00
Greg Clayton 100eb93f89 Add host layer support for pipes.
Windows does support pipes, but they do so in a slightly different way. Added a Host layer which abstracts the use of pipes into a new Pipe class that everyone can use.

Windows benefits include:
- Being able to interrupt running processes when IO is directly hooked up 
- being able to interrupt long running python scripts
- being able to interrupt anything based on ConnectionFileDescriptor

llvm-svn: 212220
2014-07-02 21:10:39 +00:00
Jean-Daniel Dupas 2ab92cf8f0 Removing Carbon dependency by removing obsolete code.
The only part using Carbon is a function in Host.mm used to open a file in Xcode.
That code is broken and it is no longer useful as Xcode supports LLDB natively.

llvm-svn: 212208
2014-07-02 19:37:25 +00:00
Jim Ingham e029fa5781 If a breakpoint gets deleted, any SBBreakpoints representing that
breakpoint should return false from IsValid.

llvm-svn: 212206
2014-07-02 18:44:43 +00:00
Zachary Turner a746e8e58a Start converting usages of off_t to other types.
off_t is a type which is used for file offsets.  Even more
specifically, it is only used by a limited number of C APIs that
deal with files.  Any usage of off_t where the variable is not
intended to be used with one of these APIs is a bug, by definition.

This patch corrects some easy mis-uses of off_t, generally by
converting them to lldb::offset_t, but sometimes by using other
types such as size_t, when appropriate.

The use of off_t to represent these offsets has worked fine in
practice on linux-y platforms, since we used _FILE_OFFSET_64 to
guarantee that off_t was a uint64.  On Windows, however,
_FILE_OFFSET_64 is unrecognized, and off_t will always be 32-bit.
So the usage of off_t on Windows actually leads to legitimate bugs.

Reviewed by: Greg Clayton

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

llvm-svn: 212192
2014-07-02 17:24:07 +00:00
Jean-Daniel Dupas e7c7c3de93 Replace uint32_t by lldb::RegisterKing in register context API.
llvm-svn: 212172
2014-07-02 09:51:28 +00:00
Todd Fiala 14bbef5ac7 Add Kalimba support to ArchSpec.
See http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140630/011508.html
for more details.

Change by Matthew Gardiner.

llvm-svn: 212145
2014-07-01 23:33:32 +00:00
Bruce Mitchener d93c4a3339 Fix typos.
llvm-svn: 212132
2014-07-01 21:22:11 +00:00
Bruce Mitchener 4d1a26dcc2 Minumum -> Minimum.
llvm-svn: 212129
2014-07-01 21:18:35 +00:00
Deepak Panickal 9b35cf52d2 This creates a valid Python API for Windows, pending some issues. The changes included are -
- Ported the SWIG wrapper shell scripts to Python so that they would work on Windows too along with other platforms
 - Updated CMake handling to fix SWIG errors and manage sym-linking on Windows to liblldb.dll
 - More build fixes for Windows

The pending issues are that two Python modules, termios and pexpect are not available on Windows.
These are currently required for the Python command interpreter to be used from within LLDB.

llvm-svn: 212111
2014-07-01 17:57:19 +00:00
Todd Fiala 9be5049a01 Use native ::pid_t in Linux ProcessMonitor (local debugging).
There were a few places where we were not catching the possibility of negative
error codes in waitpid() calls.  This change fixes those remaining after
the llgs branch fixes to ProcessMonitor.

Change by Shawn Best.

llvm-svn: 212107
2014-07-01 16:30:53 +00:00
Zachary Turner 0ec7baa9f4 Fix Windows build after llgs upstream.
With _HAS_EXCEPTIONS=0, Windows' version of <thread> will fail to
compile because it calls __uncaught_exception(), which is compiled
out due to _HAS_EXCEPTIONS=0.  This just creates a stub version
of __uncaught_exception() which always fails.

llvm-svn: 212076
2014-07-01 00:18:46 +00:00
Todd Fiala 2850b1be2e Fixup Windows build breaks for the llgs upstream.
Also moves NativeRegisterContextLinux* files into the Linux directory.
These, like NativeProcessLinux, should only be built on Linux or a cross
compiler with proper headers.

llvm-svn: 212074
2014-06-30 23:51:35 +00:00
Todd Fiala af245d115b Add lldb-gdbserver support for Linux x86_64.
This change brings in lldb-gdbserver (llgs) specifically for Linux x86_64.
(More architectures coming soon).

Not every debugserver option is covered yet.  Currently
the lldb-gdbserver command line can start unattached,
start attached to a pid (process-name attach not supported yet),
or accept lldb attaching and launching a process or connecting
by process id.

The history of this large change can be found here:
https://github.com/tfiala/lldb/tree/dev-tfiala-native-protocol-linux-x86_64

Until mid/late April, I was not sharing the work and continued
to rebase it off of head (developed via id tfiala@google.com).  I switched over to
user todd.fiala@gmail.com in the middle, and once I went to github, I did
merges rather than rebasing so I could share with others.

llvm-svn: 212069
2014-06-30 21:05:18 +00:00
Todd Fiala 3dc2fb2fc0 Factored out Linux proc file reading into separate class.
Both NativeProcessLinux (in llgs branch) and Linux Host.cpp had similar code to handle /proc 
file reading.  I factored that out into a new Linux-specific ProcFileReader class and added a method
that the llgs branch will use for line-by-line parsing.

This change also adds numerous Linux-specific files to Xcode that were missing from the Xcode
project files.

Related to https://github.com/tfiala/lldb/issues/27

llvm-svn: 212015
2014-06-30 04:14:13 +00:00
Todd Fiala 6d6b55d153 Pull ProcessInfo and ProcessLaunchInfo out of Target/Process.
Elevate ProcessInfo and ProcessLaunchInfo into their own headers.
llgs will be using ProcessLaunchInfo but doesn't need to pull in
the rest of Process.h.

This also moves a bunch of implementation details from the header
declarations into ProcessInfo.cpp and ProcessLaunchInfo.cpp.

Tested on Ubuntu 14.04 Cmake and MacOSX Xcode.

Related to https://github.com/tfiala/lldb/issues/26.

llvm-svn: 212005
2014-06-30 00:30:53 +00:00
Zachary Turner a57596658a Don't truncate the target triple when initializing clang.
Reviewed by: Sean Callanan

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

llvm-svn: 211968
2014-06-27 23:19:42 +00:00
Todd Fiala b91de7861c Fix ObjectFileELF to determine architectures independent of host.
Previously ObjectFileELF was simplifying and assuming the object file it was
looking at was the same as the host architecture/triple.  This would break
attempts to run, say, lldb on MacOSX against lldb-gdbserver on Linux since
the MacOSX lldb would say that the linux elf file was really an Apple MacOSX
architecture.  Chaos would ensue.

This change allows the elf file to parse ELF notes for Linux, FreeBSD and
NetBSD, and determine the OS appropriately from them.  It also initializes
the OS type from the ELF header OSABI if it is set (which it is for FreeBSD
but not for Linux).

Added a test with freebsd and linux images that verify that 
'(lldb) image list -t -A' prints out the expected architecture for each.

llvm-svn: 211907
2014-06-27 16:52:49 +00:00
Saleem Abdulrasool 28606954bf lldb: remove adhoc implementation of array_sizeof
Replace adhoc inline implementation of llvm::array_lengthof in favour of the
implementation in LLVM.  This is simply a cleanup change, no functional change
intended.

llvm-svn: 211868
2014-06-27 05:17:41 +00:00
Bruce Mitchener 6a7f33387d Fix a few typos.
llvm-svn: 211851
2014-06-27 02:42:12 +00:00
Zachary Turner cfcd7914da Fix silly compilation error.
llvm-svn: 211728
2014-06-25 18:40:58 +00:00
Zachary Turner 1536244594 Fix a bug in the IRMemoryMap which generated bogus allocations.
Previously, only the starting locations of the candidate interval
and the existing interval were compared.  To correctly detect
range intersections, it is necessary to compare the entire range
of both intervals against each other.

Reviewed by: scallanan

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

llvm-svn: 211726
2014-06-25 18:37:19 +00:00
Zachary Turner 736d4d85db Replace GCC-specific intrinsic with portable alternative.
Not all supported compilers have GCC intrinsics, so this patch
uses the correct portable alternative.

Additionally, this patch fixes an off-by-one error.  __builtin_ffs
returns the 1-based index of the least-significant 1-bit, but the
function expects the base 2 logarithm of the number, which is
equivalent to the 0-based index of the least-significant 1-bit.

Reviewed by: Keno Fischer

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

llvm-svn: 211669
2014-06-25 05:42:32 +00:00
Jim Ingham 106d02866d Added an option to turn OFF the "detach on error" behavior that was added
to debugserver when launching processes.

<rdar://problem/16216199>

llvm-svn: 211658
2014-06-25 02:32:56 +00:00
Ed Maste 2bc7643d10 Remove extra newline from log Printf
Clean up this one specifically, as it has the effect of double-spacing
the list of thread stop reasons, and substantially bloats the log file
when opening a core with hundreds of threads.

There are other cases of extra newlines.  Some of them do increase
readability, so avoid a general sweep for now.

llvm-svn: 211655
2014-06-25 00:38:35 +00:00
Greg Clayton 48672afb66 Patch from Keno Fischer to enable JITLoaderGDB with mach-o file support.
The patch is as is with the functionality left disabled for apple vendors because of performance regressions. If this is enabled it ends up searching for symbols in all shared libraries that are loadeded.

llvm-svn: 211638
2014-06-24 22:22:43 +00:00
Jim Ingham 6008924508 Rework fix in r201744. You really DO need to waitpid twice to get the
process fully reaped.  The race & bad behavior was because we were letting
the reaping thread in LLDB to also set the Process exit status, so debugserver
would sometimes be shut down before it got a chance to report the exit status, 
and then we got confused.

<rdar://problem/16555850>

llvm-svn: 211636
2014-06-24 21:51:42 +00:00
Todd Fiala 5d1b9c7386 Fix up Windows build for the SBUnixSignals addition.
Change by Zachary Turner.

llvm-svn: 211635
2014-06-24 21:38:31 +00:00
Jason Molenda fa4286eab7 Fix error handling for the AppleGetQueues and AppleGetPendingItems
ClangFunctions if the clang function compilation fails for any reason.
<rdar://problem/16793965> 

llvm-svn: 211549
2014-06-23 22:45:54 +00:00
Jason Molenda d81c483928 Temporarily roll back the parts of r211241 where I fixed a
mistake in the lock acquistion in HistoryUnwind and HistoryThread.
We've got a deadlock with one use case of HistoryUnwind; I
need to figure out what lock ordering is causing this and fix
it for real.  
<rdar://problem/17411904> 

llvm-svn: 211541
2014-06-23 21:30:15 +00:00
Sean Callanan 60400ecbce Don't set the ABI to apcs-gnu for non-ARM iOS targets (i.e., the
simulator).
    
<rdar://problem/17399406>

llvm-svn: 211536
2014-06-23 21:00:25 +00:00
Todd Fiala 802dc40228 Add API control of the signal disposition.
See http://reviews.llvm.org/D4221 for details.

This commit allows you to control the signals that lldb will suppress, stop or forward using the Python and C++ APIs.

Change by Russell Harmon.

Xcode build system changes (and any mistakes) by Todd Fiala.  Tested on MacOSX 10.9.3 and Xcode 6 beta.  (Xcode 5 is hitting the dependency checker crasher on all my systems).

llvm-svn: 211526
2014-06-23 19:30:49 +00:00
Todd Fiala d35f2b902b lldb: deal with non-portable PTRACE-related constants
See http://reviews.llvm.org/D4091 for details.

Change by Paul Osmialowski.

llvm-svn: 211503
2014-06-23 15:59:04 +00:00
Sylvestre Ledru 579cf37189 Remove useless call
llvm-svn: 211454
2014-06-21 23:51:07 +00:00