aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Utility
AgeCommit message (Collapse)AuthorFilesLines
2015-03-10Add Utility/ModuleCache class and integrate it with PlatformGDBRemoteServer ↵Oleksiy Vyalov3-0/+205
- in order to allow modules caching from remote targets. http://reviews.llvm.org/D8037 llvm-svn: 231734
2015-03-06Remove Host::Backtrace in favor of llvm::sys::PrintStackTrace()Zachary Turner1-12/+10
This removes Host::Backtrace from the codebase, and changes all call sites to use llvm::sys::PrintStackTrace(). This makes the functionality available for all platforms, and even for platforms which currently had a supported implementation of Host::Backtrace, this patch should enable richer information in stack traces, such as file and line number information, as well as giving it the ability to unwind through inlined functions. llvm-svn: 231511
2015-03-04Appease the Windows botEnrico Granata1-0/+1
llvm-svn: 231315
2015-03-04Introduce lldbassert(x)Enrico Granata1-0/+38
We would like it if LLDB never crashed, especially if we never caused LLDB to crash On the other hand, having assertions can sometimes be useful lldbassert(x) is the best of both worlds: - in debug builds, it turns into a regular assert, which is fine because we don't mind debug LLDB to crash on development machines - in non-debug builds, it emits a message formatted just like assert(x) would, but then instead of crashing, it dumps a backtrace, suggests filing a bug, and keeps running llvm-svn: 231310
2015-02-25Add qModuleInfo request in order to get module information (uuid, triple,..) ↵Oleksiy Vyalov2-0/+2
by module path from remote platform. http://reviews.llvm.org/D7709 llvm-svn: 230556
2015-02-25Revert "Fix warnings found with clang-cl."Zachary Turner1-3/+3
SWIG doesn't like enum : unsigned. Revert this until I can fix this in a way that swig likes. llvm-svn: 230531
2015-02-25Fix warnings found with clang-cl.Zachary Turner1-3/+3
Earlier this week I was able to get clang-cl on Windows to be able to self host. This opened the door to being able to get a whole new slew of warnings for the Windows build. This patch fixes all of the warnings, many of which were real bugs. llvm-svn: 230522
2015-02-11Fix Mingw build.Hafiz Abid Qadeer1-0/+1
Following changes are done. Add missing headers. Replace _snprintf with snprintf. It is already changed to _snprintf for MSVC. Add a file in the build for autoconf. Call DynamicLoaderWindows::Terminate and DynamicLoaderWindows::Initialize only for MSVC build. Reviewed in http://reviews.llvm.org/D7536. llvm-svn: 228822
2015-02-10Add JSON.cpp to CMakeLists.txtChaoren Lin1-0/+1
llvm-svn: 228639
2015-02-10Add a JSON producer to LLDB - this is a set of classes that encapsulate JSON ↵Enrico Granata1-0/+217
objects and allow you to write them to a Stream for subsequent processing Using this JSON producer, write a little tool that expands its own command-line arguments and dumps them to stdout as a JSON array llvm-svn: 228636
2015-02-09Dont' use O_CLOEXEC on Windows, since it doesn't exist.Zachary Turner1-1/+5
llvm-svn: 228590
2015-02-09Fix descriptor leak in multi-target debuggingPavel Labath1-2/+3
Summary: When debugging two targets concurrently, the pseude terminal master fd from the first one would leak into the second. This fixes the problem by setting O_CLOEXEC on the master fd. Test included. Reviewers: clayborg, vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7466 llvm-svn: 228570
2015-02-06Add support for SBProcess::PutSTDIN to remote processesVince Harron2-0/+4
Processes running on a remote target can already send $O messages to send stdout but there is no way to send stdin to a remote inferior. This allows processes using the API to pump stdin into a remote inferior process. It fixes a hang in TestProcessIO.py when running against a remote target. llvm-svn: 228419
2015-01-15UriParser - fixed potential buffer overrunVince Harron2-7/+22
Switched from ::strtoul to StringConvert::ToUInt32 Changed port output parameter to be -1 if port is unspecified llvm-svn: 226204
2015-01-13Add an additional check to UnwindAssembly_x86::AugmentUnwindPlanFromCallSite Jason Molenda1-0/+6
which will verify if the eh_frame instructions include details about the prologue or not. Both clang and gcc include prologue instructions but there's no requirement for them to do so -- and I'm sure we'll have to interoperate with a compiler that doesn't generate prologue info at some point. I don't have any compilers that omit the prologue instructions so the testing was of the "makre sure augmented unwind info is still created". With an eh_frame without prologue, this code should reject the augmentation scheme altogether and we should fall back to using assembly instruction profiling. llvm-svn: 225771
2015-01-10Add RegisterNumber.cpp.Jason Molenda1-0/+1
llvm-svn: 225585
2015-01-10Hoist the RegisterNumber class out of RegisterContextLLDB and makeJason Molenda1-0/+151
it more generally available. Add checks to UnwindAssembly_x86::AugmentUnwindPlanFromCallSite() so that it won't try to augment an UnwindPlan that already describes the function epilogue. Add a test case for backtracing out of _sigtramp on Darwin systems. This could probably be adapted to test the same thing on linux/bsd but the function names of sigtramp and kill are probably platform specific and I'm not sure what they should be. llvm-svn: 225578
2015-01-06Adds UriParser::Parse and unit testsVince Harron3-0/+90
This can be used to parse URIs passed to 'platform connect' Differential Revision: http://reviews.llvm.org/D6858 llvm-svn: 225317
2014-12-01Added StringExtractor::DecodeHexU8 && GetHexBytesAvailVince Harron2-49/+63
DecodeHexU8 returns a decoded hex character pair, returns -1 if a valid hex pair is not available. GetHexBytesAvail decodes all available hex pairs. llvm-svn: 223081
2014-11-14Removed a couple of static helpers in the data formatters, replaced with new ↵Enrico Granata1-0/+42
general logic in StringLexer llvm-svn: 222058
2014-11-10Cleaned up the StringLexer a little bit. It turnsSean Callanan1-25/+11
out we only want to roll back text that was in the buffer to begin with, so it's not necessary to provide a pushback stack. I'm going to use this slightly cleaner API to perform lookahead for the Objective-C runtime type parser. llvm-svn: 221640
2014-11-08LLGS Android target support - for Andy Chien : http://reviews.llvm.org/D6166Shawn Best1-0/+2
llvm-svn: 221570
2014-10-27Stub out 'close' call on m_master_fd for Windows.Hafiz Abid Qadeer1-0/+4
PseudoTerminal.cpp uses a dummy implementation of posix_openpt for Windows. This implementation just returns 0. So m_master_fd is 0. But destructor calls 'close' on m_master_fd. This 'close' calls seems un-necessary as m_master_fd was never opened in first place and calling 'close' on 0 can have other un-intended consequences. I am committing it as obvious as it is only a one-liner. Long term, we may want to refactor this class. llvm-svn: 220705
2014-09-18Fix the ability of "lldb-platform" to upload files.Greg Clayton1-6/+7
The issue was GDBRemoteCommunication::CheckForPacket() already fixes up any prefixed bytes (0x7d followed by value that is XOR'ed with 0x20). If we do this again, we cause binary packets to lose bytes. This allows lldb-platform to be able to upload binaries and debug them remotely. llvm-svn: 218002
2014-08-29lldb - Register Context Linux ARM64Todd Fiala1-1/+1
Yet another step toward ARM64 support. With this commit, lldb-gdbserver started on ARM64 target can be accessed by lldb running on desktop PC and it can process simple commands (like 'continue'). Still ARM64 support lacks NativeRegisterContextLinux_arm64.* code which waits to be implemented. Based on similar files for Linux x86_64 and Darwin ARM64. Due to common code extraction from Darwin related files, lldb should be tested for any unexpected regression on Darwin ARM64 machines too. See the following for more details: http://reviews.llvm.org/D4580 http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140825/012670.html Change by Paul Osmialowski. llvm-svn: 216737
2014-08-23I forgot to include the header file for std::find, and that's breaking the ↵Enrico Granata1-0/+2
Linux build. Push a fix out. Patch suggested by Paul Osmialowski and Randy Smith llvm-svn: 216323
2014-08-23Fix a couple of potential issues in the lexer where we were ignoring the ↵Enrico Granata1-1/+7
putback data llvm-svn: 216304
2014-08-07StringLexer: Fix CMake buildDavid Majnemer1-0/+1
llvm-svn: 215144
2014-08-07Add a StringLexer utility class that can be used when you have string data ↵Enrico Granata1-0/+93
that needs to be parsed - I don't think such a general purpose facility is part of LLVM, and I am going to need this, so just add it to lldb_utility llvm-svn: 215133
2014-07-01Fix typos.Bruce Mitchener1-1/+1
llvm-svn: 212132
2014-07-01This creates a valid Python API for Windows, pending some issues. The ↵Deepak Panickal1-0/+1
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-06-30Add lldb-gdbserver support for Linux x86_64.Todd Fiala4-0/+23
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-27lldb: remove adhoc implementation of array_sizeofSaleem Abdulrasool1-1/+3
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-25Added an option to turn OFF the "detach on error" behavior that was addedJim Ingham2-0/+2
to debugserver when launching processes. <rdar://problem/16216199> llvm-svn: 211658
2014-04-20Switch NULL to C++11 nullptr in source/Symbol and source/UtilityEd Maste6-12/+12
Patch by Robert Matusewicz llvm-svn: 206713
2014-03-29Include string.h for memset() prototype. Thanks Dmitri.Jason Molenda1-0/+2
llvm-svn: 205115
2014-03-29lldb arm64 import.Jason Molenda4-0/+341
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-20cleanup unreferenced functionsSaleem Abdulrasool1-10/+0
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
2013-12-05Extends StringExtractorGDBRemote to support debugger packets.Jean-Daniel Dupas2-10/+196
CC: lldb-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2337 llvm-svn: 196525
2013-11-20Expose SBPlatform through the public API.Greg Clayton3-27/+34
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-10-18<rdar://problem/15182550>Enrico Granata1-2/+10
Removing Host/Atomic.h This header file was not being copied as part of our public API headers and this in turn was causing any plugin to link against LLDB.framework, since SharingPtr.h depends on it Out of several possible options to fix this issue, the cleanest one is to revert LLDB to use std::atomic<>, as we are a C++11 project and should take advantage of it The original rationale for going from std::atomic to Host/Atomic.h was that MSVC++ fails to link in CLR mode when std::atomic is used This is a very Visual Studio/.net specific issue, which hopefully will be fixed Until them, to allow Windows development to proceed, we are going with a targeted solution where we #ifdef include the Windows specific calls, and let everyone else use the proper atomic support, as should be If there is an unavoidable need for a LLDB-specific atomic header, the right way to go at it would be to make an API/lldb-atomic.h header and #ifdef the Windows dependency there The FormatManager should not need to conditionalize use of std::atomic<>, as other parts of the LLDB internals are successfully using atomic (Address and IRExecutionUnit), so this Win-specific hack is limited to SharingPtr llvm-svn: 192993
2013-09-25Convert to UNIX line endings.Joerg Sonnenberger1-12/+12
llvm-svn: 191367
2013-09-05Use <atomic> instead of "llvm/Support/Atomic.h". Removed unused RefCounter ↵Virgile Bello2-26/+0
class. llvm-svn: 190062
2013-08-26merge lldb-platform-work branch (and assorted fixes) into trunkDaniel Malea4-6/+149
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-23MingW compilation (windows). Includes various refactoring to improve ↵Virgile Bello1-0/+15
portability. llvm-svn: 189107
2013-06-17Add new files to CMakeLists.txt to fix cmake build error.Michael Sartain1-0/+1
llvm-svn: 184143
2013-06-17<rdar://problem/14134716>Enrico Granata1-0/+103
This is a rewrite of the command history facility of LLDB It takes the history management out of the CommandInterpreter into its own CommandHistory class It reimplements the command history command to allow more combinations of options to work correctly (e.g. com hist -c 1 -s 5) It adds a new --wipe (-w) option to command history to allow clearing the history on demand It extends the lldbtest runCmd: and expect: methods to allow adding commands to history if need be It adds a test case for the reimplemented facility llvm-svn: 184140
2013-05-21Added a test case that verifies that LLDB can debug across a process ↵Greg Clayton1-0/+6
exec'ing itself into a new program. This currently is only enabled for Darwin since we exec from 64 bit to 32 bit and vice versa for 'x86_64' targets. This can easily be adapted for linux and other platforms, but I didn't want to break any buildbots by assuming it will work. llvm-svn: 182428
2013-04-25More CMake fixes for OS X.Filipe Cabecinhas1-1/+0
llvm-svn: 180243
2013-04-18Make KQueue import the header in the correct path.Filipe Cabecinhas1-1/+1
llvm-svn: 179795