Commit Graph

260 Commits

Author SHA1 Message Date
Deepak Panickal b36da43dc3 Fixed the Visual Studio Windows build
llvm-svn: 199111
2014-01-13 14:55:15 +00:00
Sylvestre Ledru a4cc7dec70 Fixes an issue where a signum => name mapping function has multiple case statements that define to the same integral value on my Linux (Ubuntu 12.04, x86_64). It's for SIGIO and SIGPOLL.
In the case that they are both defined the same.
Patch by Todd Fiala (but typos are mine)

llvm-svn: 197221
2013-12-13 09:51:39 +00:00
Jean-Daniel Dupas 13698b2714 Don't try to guess sys header conditions, and simply check if each signal is defined.
CC: lldb-commits

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

llvm-svn: 197173
2013-12-12 18:12:16 +00:00
Ed Maste 10565b61d5 FreeBSD and NetBSD have sa_len in struct sockaddr
llvm-svn: 196790
2013-12-09 16:07:11 +00:00
Ed Maste 991fe6c701 Fix Debian GNU/kFreeBSD build
Use the same LaunchProcessPosixSpawn as on FreeBSD and Linux.

llvm-svn: 196742
2013-12-09 01:35:42 +00:00
Greg Clayton d629980ab3 Replace all in_port_t with uint16_t to avoid compilation issues on different systems.
llvm-svn: 196586
2013-12-06 17:46:35 +00:00
Jean-Daniel Dupas 3cfa8e217e Typo in comments
llvm-svn: 196577
2013-12-06 09:35:53 +00:00
Greg Clayton 00fe87b488 Modified local spawning in debugserver processes to use a new --reverse-connect option so that debugserver actually connects back to LLDB instead of LLDB connecting to debugserver.
This gets rid of our hacky "get_random_port()" which would grab a random port and tell debugserver to open that port. Now LLDB creates, binds, listens and accepts a connection by binding to port zero and sending the correctly bound port down as the host:port to connect back to.

Fixed the "ConnectionFileDescriptor" to be able to correctly listen for connections from a specified host, localhost, or any host. Prior to this fix "listen://" only accepted the following format:

listen://<port>

But now it can accept:

listen://<port>         // Listen for connection from localhost on port <port>
listen://<host>:<port>  // Listen for connection from <host> and <port>    
listen://*:<port>       // Listen for connection from any host on port <port>

llvm-svn: 196547
2013-12-05 22:58:22 +00:00
Greg Clayton c6931fcf49 Added a new directory type for the "bool Host::GetLLDBPath (PathType path_type, FileSpec &file_spec)" function: ePathTypeLLDBTempSystemDir
This will get the temporary directory on the current system.

Removed a call to tmpnam() and replaced it with a call to mktemp() using a template that will be in the temp directory.

llvm-svn: 196397
2013-12-04 18:53:50 +00:00
Colin Riley 909bb7a3f4 Fix MSVC build
Added _WIN32 guards to new platform features. Using correct SetErrorStringWithFormat within Host when LLDB_DISABLE_POSIX is defined. Also fixed an if defined block.

llvm-svn: 195766
2013-11-26 15:10:46 +00:00
Ed Maste ac7270b56b Correct a standalone debug file path
For a file /bin/ls with a .gnu_debuglink entry of "ls.debug" the path
should be /usr/lib/debug/bin/ls.debug, not /usr/lib/debug/bin/ls.

ref: https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html

llvm.org/pr17903
http://llvm-reviews.chandlerc.com/D2169

llvm-svn: 195681
2013-11-25 20:33:56 +00:00
Greg Clayton 5c6eab21eb Removed printf and puts calls that were left in accidentally.
llvm-svn: 195542
2013-11-23 02:01:06 +00:00
Greg Clayton fb90931b60 Improved platform support.
Improved the detection of a valid GDB server where we actually can connect to a socket, but then it doesn't read or write anything (which happens with some USB mux software).

Host::MakeDirectory() now can make as many intermediate directories as needed.

The testsuite now has very initial support for remote test suite running. When running on a remote platform, the setUp function for the test will make a new directory and select it as the working directory on the remote host. 

Added a common function that can be used to create the short option string for getopt_long calls.

llvm-svn: 195541
2013-11-23 01:58:15 +00:00
Greg Clayton 3bd19fb07d Fix ePathTypeSupportExecutableDir for shallow bundle Darwin targets and add "host" logging for the different paths.
llvm-svn: 195484
2013-11-22 18:48:24 +00:00
Greg Clayton c029382690 Fix File::GetPermissions() to only return the permission bits.
llvm-svn: 195482
2013-11-22 18:46:55 +00:00
Greg Clayton 6d4130e7d9 Fix indentation.
llvm-svn: 195481
2013-11-22 18:46:16 +00:00
Jim Ingham 1a7ee7044a #include <AvailabilityMacros.h> if you want to use them. This was causing us to skip
the code that should have set thread names on Mac OS X.

<rdar://problem/15517264>

llvm-svn: 195403
2013-11-22 00:51:36 +00:00
Jason Molenda 4a4b5dcb7d sys/stat.h needed for mkdir, chmod, stat.
llvm-svn: 195305
2013-11-21 02:45:55 +00:00
Greg Clayton fbb7634934 Expose SBPlatform through the public API.
Example code:

remote_platform = lldb.SBPlatform("remote-macosx"); 
remote_platform.SetWorkingDirectory("/private/tmp")
debugger.SetSelectedPlatform(remote_platform)

connect_options = lldb.SBPlatformConnectOptions("connect://localhost:1111"); 
err = remote_platform.ConnectRemote(connect_options)
if err.Success():
    print >> result, 'Connected to remote platform:'
    print >> result, 'hostname: %s' % (remote_platform.GetHostname())
    src = lldb.SBFileSpec("/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework", False)
    dst = lldb.SBFileSpec()
    # copy src to platform working directory since "dst" is empty
    err = remote_platform.Install(src, dst);
    if err.Success():
        print >> result, '%s installed successfully' % (src)
    else:
        print >> result, 'error: failed to install "%s": %s' % (src, err)


Implemented many calls needed in lldb-platform to be able to install a directory that contains symlinks, file and directories.

The remote lldb-platform can now launch GDB servers on the remote system so that remote debugging can be spawned through the remote platform when connected to a remote platform.

The API in SBPlatform is subject to change and will be getting many new functions.

llvm-svn: 195273
2013-11-20 21:07:01 +00:00
Deepak Panickal d66b50c96c Fixes to get LLDB building on Windows again.
llvm-svn: 193159
2013-10-22 12:27:43 +00:00
Sean Callanan ddd7a2a65b Changed the bool conversion operator on ConstString
to be explicit, to prevent horrid things like

std::string a = ConstString("foo")

from taking the path ConstString -> bool -> char
-> std::string.

This fixes, among other things, ClangFunction.

<rdar://problem/15137989>

llvm-svn: 191934
2013-10-03 22:27:29 +00:00
Sylvestre Ledru 6c9530b808 Fix a memory leak. Found by both scan-build and coverity. Close CID 1096442
llvm-svn: 191619
2013-09-28 15:50:23 +00:00
Joerg Sonnenberger 1e0621cea2 arpa/inet.h is the canonical source of htons and friends.
At least on NetBSD, none of the already included headers pulls it in.

llvm-svn: 191386
2013-09-25 17:53:34 +00:00
Joerg Sonnenberger c75987637b Handle ePathTypePythonDir even in the case of LLDB_DISABLE_PYTHON,
otherwise -Werror builds may fail.

llvm-svn: 191385
2013-09-25 17:52:18 +00:00
Joerg Sonnenberger 340a17595e Convert to UNIX line endings.
llvm-svn: 191367
2013-09-25 10:37:32 +00:00
Virgile Bello 6957195ae5 Various small changes for build of LLDB on Visual Studio 2013 RC (MSVC12)
llvm-svn: 191116
2013-09-20 22:35:22 +00:00
Virgile Bello 1fd7ec75fc Add backslash as path separator for Win32.
llvm-svn: 191115
2013-09-20 22:31:10 +00:00
Jim Ingham df0ae22f92 Changing the default shell to /bin/sh brought up a long-standing bug on OS X,
that /bin/sh re-exec's itself to /bin/bash, so it needs one more resume when you
are using it as the shell than /bin/bash did or you will stop at the start of your
program, rather than running it.

So I added a Platform API to get the number of resumes needed when launching with
a particular shell, and set the right values for Mac OS X.

<rdar://problem/14935282>

llvm-svn: 190381
2013-09-10 02:09:47 +00:00
Virgile Bello d87fc157d2 Added some MSVC required functions in Windows.cpp. Moved MSVC specific getopt code inside its own folder.
llvm-svn: 190238
2013-09-07 05:05:49 +00:00
Virgile Bello e2607b50ea Add OptionParser.h
llvm-svn: 190063
2013-09-05 16:42:23 +00:00
Sylvestre Ledru 785ee472a3 sysctl.h does not exist under GNU/HURD (like windows)
llvm-svn: 190057
2013-09-05 15:39:09 +00:00
Andrew Kaylor 7d2abdf017 Fixing a problem with inferior exit caused by signal
llvm-svn: 189953
2013-09-04 16:06:04 +00:00
Virgile Bello 0a3b151fdf Remove <windows.h> from lldb-types.h.
llvm-svn: 189934
2013-09-04 13:56:11 +00:00
Ed Maste 47e575e267 Disable stub Host::FindProcesses on FreeBSD
A FreeBSD implementation was added in r189295.

llvm-svn: 189598
2013-08-29 18:44:27 +00:00
Virgile Bello bdae3787ef Cleanup/rearrange includes:
- factorize unistd.h and stdbool.h in lldb-types.h.
- Add <functional> and <string> where required.

llvm-svn: 189477
2013-08-28 12:14:27 +00:00
Daniel Malea 4244cbd9be Enable Host::LaunchProcess on Linux
- move LaunchProcessPosixSpawn() and Host::LaunchProcess() from freebsd host plugin to common (linux/freebsd section)
- modify MonitorChildProcessThreadFunction to use pid_t from sys/types.h to avoid Linux/FreeBSD/Mac warnings when calling waitpid()

llvm-svn: 189404
2013-08-27 20:58:59 +00:00
Daniel Malea 60caaae9a7 Fix warnings about redefined macros at the end of File.cpp
- removed needless defines that snuck in as part of the lldb-platform-work merge

llvm-svn: 189392
2013-08-27 18:56:27 +00:00
Virgile Bello ae12a3640d Fix MinGW build after lldb-platform-work merge:
- mode_t is defined in <sys/types.h>
- reorganized S_* user rights into win32.h
- Use Host::Kill instead of kill
- Currently #ifdef functions using pread/pwrite.

llvm-svn: 189364
2013-08-27 16:21:49 +00:00
Charles Davis 510938e528 Fix some names in the wake of my Mach-O changes to LLVM.
llvm-svn: 189317
2013-08-27 05:04:57 +00:00
Daniel Malea e0f8f574c7 merge lldb-platform-work branch (and assorted fixes) into trunk
Summary:
    This merge brings in the improved 'platform' command that knows how to
    interface with remote machines; that is, query OS/kernel information, push
    and pull files, run shell commands, etc... and implementation for the new
    communication packets that back that interface, at least on Darwin based
    operating systems via the POSIXPlatform class. Linux support is coming soon.

    Verified the test suite runs cleanly on Linux (x86_64), build OK on Mac OS
    X Mountain Lion.

    Additional improvements (not in the source SVN branch 'lldb-platform-work'):
    - cmake build scripts for lldb-platform
    - cleanup test suite
    - documentation stub for qPlatform_RunCommand
    - use log class instead of printf() directly
    - reverted work-in-progress-looking changes from test/types/TestAbstract.py that work towards running the test suite remotely.
    - add new logging category 'platform'

    Reviewers: Matt Kopec, Greg Clayton

    Review: http://llvm-reviews.chandlerc.com/D1493

llvm-svn: 189295
2013-08-26 23:57:52 +00:00
Virgile Bello b2f1fb2943 MingW compilation (windows). Includes various refactoring to improve portability.
llvm-svn: 189107
2013-08-23 12:44:05 +00:00
Daniel Malea fa7425d1af Fix bug in Host::getLLDBPath() due to misusing Twine
- use SmallString instead
- original implementation resulted in incorrect behaviour of lldb -P

Fix by Kal Conley!

llvm-svn: 187818
2013-08-06 21:40:08 +00:00
Michael Sartain c205243e8b Fix Linux Host::GetCurrentThreadID() to return real tid (not pthread_t).
This fixes threadname logging (--thread-name)
Add "-t" to TestLogging.py script to enable threadsafe and disable threadname logging

llvm-svn: 187599
2013-08-01 18:51:08 +00:00
Ed Maste 02983be252 Set thread names on FreeBSD
Also move the logic to shorten thread names from linux/Host.cpp to a new
SetShortThreadName as both FreeBSD and Linux need the functionality.

llvm-svn: 187149
2013-07-25 19:10:32 +00:00
Michael Sartain 3cf443ddd6 simple plugin now works with Linux fix assert in SetPluginInfo implement Linux ePathTypeLLDBSystemPlugins and ePathTypeLLDBUserPlugins implement Linux Host::Backtrace and Host::GetEnvironment add .gnu_debugdata comment
Differential Revision: http://llvm-reviews.chandlerc.com/D1159

llvm-svn: 186475
2013-07-17 00:26:30 +00:00
Greg Clayton 090b591d82 Missed a checking that should have been checked in with 186211.
llvm-svn: 186221
2013-07-12 22:40:04 +00:00
Matt Kopec fb6ab54000 Add support for listing inferior thread names on Linux.
llvm-svn: 186033
2013-07-10 20:53:11 +00:00
Ed Maste a85d364bad Fix build with LLVM_DISABLE_PYTHON
llvm-svn: 185466
2013-07-02 19:30:52 +00:00
Ed Maste d3561c6abe Build standalone debug symbol file support on FreeBSD too
llvm-svn: 185425
2013-07-02 13:52:38 +00:00
Michael Sartain a7499c9830 Split symbol support for ELF and Linux.
llvm-svn: 185366
2013-07-01 19:45:50 +00:00
Sylvestre Ledru 594058394e Following the modification introduced in llvm by commit 185311
The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD.
This kind of simplification is sometimes useful, but in general it's not correct. 

As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the
build definitions used for FreeBSD, whereas for userland-related issues we want to
match the definitions used for other systems with Glibc.

The current modification adjusts the build system so that they can be distinguished,
and explicitly adds GNU/kFreeBSD to the build checks in which it belongs.

Fixes bug #16446.

Patch by Robert Millan in the context of Debian.

llvm-svn: 185313
2013-07-01 08:21:36 +00:00
Ed Maste f2b0162731 Move sys/sysctl.h include after its dependency sys/types.h
llvm-svn: 185147
2013-06-28 12:35:08 +00:00
Ed Maste 8b006c69c0 Correct use of __FreeBSD_kernel__
It is defined on recent FreeBSD versions, so must not be mutually
exclusive with an #elif FreeBSD block.

Patch submitted by Robert Millan.

Fixes PR#16447.

llvm-svn: 184867
2013-06-25 18:58:11 +00:00
Rafael Espindola 09079162ee Don't depend on set being transitively included.
llvm-svn: 183936
2013-06-13 20:10:23 +00:00
Rafael Espindola ff89ff297f Update for llvm change.
llvm-svn: 183929
2013-06-13 19:25:41 +00:00
Rafael Espindola 6ba87f65e6 Use the global functions instead of the Program methods.
llvm-svn: 183862
2013-06-12 20:47:14 +00:00
Matt Kopec ef14371d3f Fix various build warnings.
llvm-svn: 183140
2013-06-03 18:00:07 +00:00
Matt Kopec 085d6cec1a Add ability to attach/detach to multi-threaded inferiors on Linux.
All running threads will be detected and stopped on attach and all threads get resumed on detach.

llvm-svn: 183049
2013-05-31 22:00:07 +00:00
Andrew Kaylor 93132f504f Adding support for stopping all threads of multithreaded inferiors on Linux. Also adding multithreaded test cases.
llvm-svn: 182809
2013-05-28 23:04:25 +00:00
Greg Clayton 43d8279ffd Cleaned up the File API a bit.
llvm-svn: 182538
2013-05-22 23:30:09 +00:00
Jim Ingham 5c42d8a87c Fixed a few obvious errors pointed out by the static analyzer.
llvm-svn: 181911
2013-05-15 18:27:08 +00:00
Daniel Malea 25d7eb0d9a Implement "platform process list" on Linux
- read process information from /proc
- resolves llvm.org/pr14541 :)

Patch by Mike Sartain!

llvm-svn: 181904
2013-05-15 17:54:07 +00:00
Sylvestre Ledru 99446cfb1a Include also sys/wait.h in the case of a FreeBSD kernel with a glibc (Debian KFreeBSD for example)
llvm-svn: 181885
2013-05-15 13:56:44 +00:00
Matt Kopec 62502c6897 Add setting of lldb thread names on Linux.
Patch by Mike Sartain.

llvm-svn: 181722
2013-05-13 19:33:58 +00:00
Andrew Kaylor bf9b4c171a Adding support for process attach by pid on Linux.
llvm-svn: 181374
2013-05-07 22:46:38 +00:00
Jason Molenda db7d11c7a2 A few small fixes to make things like image list not
print "//mach_kernel" if you are debugging an executable
in the top level directory.

llvm-svn: 181190
2013-05-06 10:21:11 +00:00
Jason Molenda fe806906d4 fix a couple of clang static analyzer warnings.
Most important was a new[] + delete mismatch in ScanFormatDescriptor()
and a couple of possible memory leaks in FileSpec::EnumerateDirectory().

llvm-svn: 181080
2013-05-04 00:39:52 +00:00
Ashok Thirumurthi 0f3b9b819a Build fixes for FreeBSD 9.1.
- TODO: Support extended register sets on FreeBSD.

Patch by Samuel Jacob.

llvm-svn: 180879
2013-05-01 20:38:19 +00:00
Greg Clayton a44c1e6b63 Don't return a reference to a local variable, and removed a redundant API.
llvm-svn: 180713
2013-04-29 16:36:27 +00:00
Jason Molenda a7ae4673c7 Add a few new methods to FileSpec to make it a little easier to work
with directories, without increasing the size of the FileSpec object.
GetPath() returns a std::string of the full pathname of the file.
IsDirectory(), IsPipe(), IsRegularFile(), IsSocket(), and IsSymbolicLink()
can be used instead of getting the FileType() and comparing it to an enum.

Update PlatformDarwinKernel to use these new methods.

llvm-svn: 180704
2013-04-29 09:46:43 +00:00
Enrico Granata e743c78299 <rdar://problem/13209140>
“plugin load” tries to be more helpful when it fails to load a plugin

llvm-svn: 180218
2013-04-24 21:29:08 +00:00
Greg Clayton d398a1c5b7 Fixed being able to mmap an entire file by letting the default args "do the right thing".
llvm-svn: 179909
2013-04-20 00:23:26 +00:00
Greg Clayton 03da4cc294 Fixed some linux buildbot warnings.
llvm-svn: 179892
2013-04-19 21:31:16 +00:00
Greg Clayton 7b0992d9cd After discussing with Chris Lattner, we require C++11, so lets get rid of the macros and just use C++11.
llvm-svn: 179805
2013-04-18 22:45:39 +00:00
Greg Clayton e01e07b6e7 Since we use C++11, we should switch over to using std::unique_ptr when C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++.
Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro.

llvm-svn: 179779
2013-04-18 18:10:51 +00:00
Jason Molenda 14aef12e24 Change EnumerateDirectory from using readdir() to using readdir_r()
so it can be re-entered while iterating over a directory safely.

llvm-svn: 178738
2013-04-04 03:19:27 +00:00
Greg Clayton 5160ce5c72 <rdar://problem/13521159>
LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down.

All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down.

llvm-svn: 178191
2013-03-27 23:08:40 +00:00
Greg Clayton 8571963a7c Fixed a case where the result of std::string's c_str() method was being called on a local variable and returned as a const char * incorrectly. We used to cache the thread names for threads in the current host process, but we shoudn't be caching that as the names can change over time, so now a std::string is returned from Host::GetThreadName().
llvm-svn: 176217
2013-02-27 22:51:58 +00:00
Daniel Malea 23720cc66c Adding CMake build system to LLDB. Some known issues remain:
- generate-vers.pl has to be called by cmake to generate the version number
- parallel builds not yet supported; dependency on clang must be explicitly specified

Tested on Linux.
- Building on Mac will require code-signing logic to be implemented.
- Building on Windows will require OS-detection logic and some selective directory inclusion

Thanks to Carlo Kok (who originally prepared these CMakefiles for Windows) and Ben Langmuir
who ported them to Linux!

llvm-svn: 175795
2013-02-21 20:58:22 +00:00
Greg Clayton e3e3feea3c Added a host call to get the number of CPUs. It should work on all POSIX unixes, linux and Windows.
llvm-svn: 175405
2013-02-17 20:46:30 +00:00
Greg Clayton c7bece56fa <rdar://problem/13069948>
Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary.

So I defined a new "lldb::offset_t" which should be used for all file offsets.

After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed.

Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections.

llvm-svn: 173463
2013-01-25 18:06:21 +00:00
Matt Kopec 650648fa57 Add initial support to trace spawned threads in a process on Linux.
llvm-svn: 171864
2013-01-08 16:30:18 +00:00
Daniel Malea 53430eb877 Fix lldb -P on Linux
- now prints the correct PYTHONPATH
- update dotest.py to use lldb -P result correctly
- resolves TestPublicAPIHeaders test failure (on Linux)

llvm-svn: 171558
2013-01-04 23:35:13 +00:00
Enrico Granata 557fd00a6f <rdar://problem/12446222>
Implement the ability for Python commands to be interrupted by pressing CTRL+C
Also add a new Mutex subclass that attempts to be helpful for debugging by logging actions performed on it

FYI of all interested - there is a separate deadlocking issue related to how LLDB dispatches CTRL+C that might cause LLDB to deadlock upon pressing CTRL+C while in a Python command.
This is not a regression, and was just previously masked by us not even trying to bail out of Python commands, so that it would not be clear from a user perspective whether we were
deadlocked or stuck in an inconsistent state within the Python interpreter.

llvm-svn: 170612
2012-12-19 23:42:07 +00:00
Daniel Malea 89660bf795 More Linux warnings fixes (remove default labels as needed):
- as per http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations

Patch by Matt Kopec!

llvm-svn: 169633
2012-12-07 20:51:09 +00:00
Daniel Malea 93a64300f8 Fix Linux build warnings due to redefinition of macros:
- add new header lldb-python.h to be included before other system headers
- short term fix (eventually python dependencies must be cleaned up)

Patch by Matt Kopec!

llvm-svn: 169341
2012-12-05 00:20:57 +00:00
Jim Ingham c5917d9a38 Save and restore terminal state when lldb is suspended with SIGTSTP and resumed with SIGCONT.
Readline & gdb have a bunch of code to handle older UNIX'es with other job control mechanisms.
I didn't try to replicate that.

llvm-svn: 169032
2012-11-30 20:23:19 +00:00
Daniel Malea d01b2953fa Resolve printf formatting warnings on Linux:
- use macros from inttypes.h for format strings instead of OS-specific types

Patch from Matt Kopec!

llvm-svn: 168945
2012-11-29 21:49:15 +00:00
Daniel Malea 95ab3612f9 Linux fix: remove reference to cellspu (backend removed in llvm r167984)
llvm-svn: 168322
2012-11-19 19:46:04 +00:00
Jim Ingham a537f6ce37 Fix a little think-o. In FileSpec::operator== we were trying to figure out whether the rhs file was resolved or not by comparing
the resolved version of the rhs FileSpec's directory name with the lhs FileSpec's directory name.  We really meant to compare it
with the rhs FileSpec's directory name...

<rdar://problem/12438838>

llvm-svn: 167349
2012-11-03 02:12:46 +00:00
Enrico Granata 80fcdd429f Caught two cases where we were passing a Stream* without checking for NULL
llvm-svn: 167342
2012-11-03 00:09:46 +00:00
Greg Clayton 21a78c9ac2 Fixed File::SeekFromEnd() to use SEEK_END insted of SEEK_CUR.
llvm-svn: 167025
2012-10-30 17:04:45 +00:00
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
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 b29e6c6e84 Patch from Andrew Kaylor that fixes Linux default host triple values.
llvm-svn: 165728
2012-10-11 17:38:58 +00:00
Jason Molenda 0a72520f22 Patch from Dan Malea to fix a build break I introduced yesterday.
Thanks again Dan!

llvm-svn: 165519
2012-10-09 18:40:44 +00:00
Enrico Granata 21dfcd9d41 Implementing plugins that provide commands.
This checkin adds the capability for LLDB to load plugins from external dylibs that can provide new commands
It exports an SBCommand class from the public API layer, and a new SBCommandPluginInterface

There is a minimal load-only plugin manager built into the debugger, which can be accessed via Debugger::LoadPlugin.

Plugins are loaded from two locations at debugger startup (LLDB.framework/Resources/PlugIns and ~/Library/Application Support/LLDB/PlugIns) and more can be (re)loaded via the "plugin load" command

For an example of how to make a plugin, refer to the fooplugin.cpp file in examples/plugins/commands

Caveats:
	Currently, the new API objects and features are not exposed via Python.
	The new commands can only be "parsed" (i.e. not raw) and get their command line via a char** parameter (we do not expose our internal Args object)
	There is no unloading feature, which can potentially lead to leaks if you overwrite the commands by reloading the same or different plugins
	There is no API exposed for option parsing, which means you may need to use getopt or roll-your-own

llvm-svn: 164865
2012-09-28 23:57:51 +00:00
Greg Clayton c8f814d1df Added the ability to download a symboled executable and symbol file given a UUID.
llvm-svn: 164753
2012-09-27 03:13:55 +00:00
Greg Clayton 813ddfcdd0 <rdar://problem/12219840>
Don't leak mach ports when calling "mach_thread_self()".

llvm-svn: 164152
2012-09-18 18:19:49 +00:00