summaryrefslogtreecommitdiffstats
path: root/lldb/source/lldb.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Patch to add PlatformWindows, based on Carlo Kok's version from the Windows ↵Deepak Panickal2013-10-151-4/+6
| | | | | | branch. llvm-svn: 192693
* Revert my commit 191617. It added a clang warning (Thanks to Ed Maste). Add ↵Sylvestre Ledru2013-10-141-0/+2
| | | | | | a comment llvm-svn: 192595
* Remove useless declaration. If match_type == eNameMatchIgnore, we already ↵Sylvestre Ledru2013-09-281-2/+0
| | | | | | left this function at the beginning of the method. Found by coverity. Fixes CID 1094188 llvm-svn: 191617
* merge lldb-platform-work branch (and assorted fixes) into trunkDaniel Malea2013-08-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Re-introduces ELF core file support for Linux x86-64Ashok Thirumurthi2013-07-171-1/+12
| | | | | | | | | | Usage: 'lldb a.out -c core'. TODO: FreeBSD support. TODO: Support for AVX registers. TODO: Refactor so that RegisterContextCore* don't inherit from classes that use ProcessMonitor to fix the build on OS/X. llvm-svn: 186516
* Revert the ELF core file support until a few things can be worked out:Greg Clayton2013-07-121-4/+1
| | | | | | | | | | | | | | | | | | | | | | | RegisterContextCoreLinux_x86_64 inherits from RegisterContextLinux_x86_64 which inherits from RegisterContext_x86_64 which uses has: ProcessMonitor &GetMonitor(); This register context used by the core file can't use this since the process plug-in will be ProcessElfCore and the implementation of GetMonitor() does: ProcessMonitor & RegisterContext_x86_64::GetMonitor() { ProcessSP base = CalculateProcess(); ProcessPOSIX *process = static_cast<ProcessPOSIX*>(base.get()); return process->GetMonitor(); } ProcessELFCore doesn't, nor should it inherit from ProcessPOSIX and any call to GetMonitor() will fail for ELF core files. Suggested cleanups: - Make a register context class that is a base class that doesn't have any reading smarts, then make one that uses ProcessPOSIX and the has the GetMonitor() call, and one that gets its data straight from the core file. llvm-svn: 186223
* Introduces core file support for Linux x86-64 using 'lldb a.out -c core'.Ashok Thirumurthi2013-07-121-1/+4
| | | | | | | | TODO: Support for RegisterContext_x86_64::ReadFPR. Patch by Samuel Jacob! llvm-svn: 186207
* Split symbol support for ELF and Linux.Michael Sartain2013-07-011-0/+7
| | | | llvm-svn: 185366
* Remove the initialization/termination of the now-removed ↵Jason Molenda2013-05-031-3/+0
| | | | | | OperatingSystemDarwinKernel. llvm-svn: 180994
* Add a new PlatformDarwinKernel for kernel debugging. This PlatformJason Molenda2013-04-051-0/+3
| | | | | | | | | | | | | | | | | | | | | plugin will index the kext bundles on the local filesystem when created. During a kernel debug session, when the DynamicLoader plugin needs to locate a kext by name like "com.apple.com.apple.filesystems.autofs", the Platform can quickly look for a UUID match in those kernel debug kit directories it previously indexed. I'm still working on profiling the performance impact of the inital kext bundle scan; there will likely need to be a switch to enable or disable this plugin's scan. This only affects Mac kernel debugging and the code is only built on Apple systems because of some use of low-level CoreFoundation to parse plists. <rdar://problem/13503583> llvm-svn: 178827
* Updated Apple LLDB version to lldb-300.99.0. AlsoSean Callanan2013-03-071-3/+18
| | | | | | | updated the build system to support the new Apple LLDB versioning scheme. llvm-svn: 176662
* Made lldb.cpp build with clang 5.0. Greg Clayton2013-02-281-45/+57
| | | | | | | | | | | | | | Also removed the use of llvm::raw_string_ostream as it wasn't needed. Also fixed a crasher that could occur when the following line returned a C string tied to a local variable: return OS.str().c_str(); I am guessing "static std::string buf;" was supposed to get assigned to "OS.str()" and then have "buf.c_str()" returned. Modified the non-apple version code to cache its value and not recompute the version every time. llvm-svn: 176274
* Remove LLDB dependency on xcodeworkspace (on Linux) for version numberDaniel Malea2013-02-281-0/+55
| | | | | | | | | | | | | | | | | | | | - make LLDB version number match Clang (and the Debian package) - use the same revision detection magic that Clang uses to report SVN/Git revisions - update test case as per above Example output: $ lldb -v lldb version 3.3 (https://dmalea@llvm.org/svn/llvm-project/lldb/trunk revision 176211 clang revision 176208 llvm revision 176208) ss This line, and those below, will be ignored-- M source/lldb.cpp M test/help/TestHelp.py M source/Makefile llvm-svn: 176268
* Enable ProcessGDBRemote plugin on LinuxDaniel Malea2013-01-081-6/+3
| | | | | | - Fixes test case TestConnectRemote llvm-svn: 171855
* Enabling ItaniumABILanguageRuntime and SymbolFileDWARFDebugMap plugins on ↵Andrew Kaylor2012-12-141-5/+5
| | | | | | non-Apple platforms. llvm-svn: 170241
* Rmoved the old LLVM disassembler based on libedis.Sean Callanan2012-12-141-3/+0
| | | | llvm-svn: 170171
* More Linux warnings fixes (remove default labels as needed):Daniel Malea2012-12-071-5/+0
| | | | | | | | - 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
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-051-0/+2
| | | | | | | | | - 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
* Added a hollowed out version of an OperatingSystem plugin that will use a ↵Greg Clayton2012-08-231-0/+11
| | | | | | class in python to get thread information for threads stored in memory. llvm-svn: 162472
* Register the ProcessGDBRemote plugin ahead of the ProcessKDP pluginJason Molenda2012-06-011-2/+2
| | | | | | | so a process connect without any plugin specified picks up the gdb-remote plugin by default. llvm-svn: 157792
* Patch from Viktor Kutuzov <vkutuzov@accesssoftek.com>:Johnny Chen2012-04-141-0/+3
| | | | | | | | | | | Hello everyone, please find the attached patch for TOT and lldb-platform-work branch, which provides the following changes: - fixed a crash in the ProcessPOSIX constructor when an executable module object is not yet created. - added support for the multi instanciated FreeBSD platform objects (the local host and remote as example). - enabled the remote gdb plugin on FreeBSD. llvm-svn: 154724
* Revert r154086. It may be needed for Darwin. But the symbols are still ↵Bill Wendling2012-04-051-4/+2
| | | | | | missing in the dylib. llvm-svn: 154108
* The DynamicLoaderPOSIXDYLD calls aren't available on Apple systems.Bill Wendling2012-04-051-2/+4
| | | | llvm-svn: 154086
* Since we are having issues with the new LLVM MC disassembler, we can haveGreg Clayton2012-03-221-8/+0
| | | | | | | | | | | | | | | | | them both installed with the LLVM MC version being the default. I renamed the name of the LLVM MC disassembler plug-in to "llvm-mc" and the LLVM enhanced disassembly plug-in to "llvm-edis" and they can both be installed for now. To use the "llvm-edis" disassembler, you can just specify it while disassembling: (lldb) disassemble --plugin llvm-edis --name main (lldb) disassemble --plugin llvm-mc --name main This will allow us to compare the output of the two disassembler and eventually deprecate the old one when the new one is ready. But it does use the new disassembler by default so we continue to test it on a daily basis. llvm-svn: 153231
* Platforms can now auto-select themselves if you specify a full target triple ↵Greg Clayton2012-03-201-1/+1
| | | | | | | | when doing a "target create" command. Each platform now knows if it can handle an architecture and a platform can be found using an architecture. Each platform can look at the arch, vendor and OS and know if it should be used or not. llvm-svn: 153104
* Enabled the PlatformLinux and PlatforFreeBSD on MacOSX so they can be usedGreg Clayton2012-02-271-13/+6
| | | | | | | | | | | | and also so we don't break them with our code changes. The _only_ plug-ins that should be #ifdef'ed out and not compiled in LLDB are those that only work when running natively on the host system. This fixed bot the PlatformLinux and PlatformFreeBSD build breakages that were due to ModuleSpec changes. llvm-svn: 151539
* Added the POSIX-DYLD as a plug-in in the darwin build in the Xcode projectGreg Clayton2012-02-271-0/+3
| | | | | | | | | so that we don't break it with code changes. After doing this I was able to fix the POSIX-DYLD plug-in so that it builds after recent ModuleSpec changes. llvm-svn: 151536
* <rdar://problem/9886712>Greg Clayton2012-02-251-0/+3
| | | | | | | | Added a dedicated platform for the iOS simulator. This helps us to find the correct files for a simulator binary before running and helps us select the right arch (i386 only) for files when we load them. llvm-svn: 151436
* Updated LLVM to take some fixes that make theSean Callanan2012-02-231-1/+1
| | | | | | | | | | | Intel disassembler usable. Also flipped the switch: we are now exclusively using Disassembler.h instead of EnhancedDisassembly.h for all disassembly in LLDB. llvm-svn: 151306
* Added a new disassembler plugin, DisassemblerLLVMC,Sean Callanan2012-02-171-0/+10
| | | | | | | | | | | | | | | | | | | which uses the Disassembler.h interface to the LLVM disassemblers rather than the EnhancedDisassembly.h interface. Disassembler.h is a better-maintained API and will be stabler in the long term. Currently the output from Disassembler.h does not provide for symbolic disassembly in all the places that the old disassembler did, so I have gated (and disabled) the disassembler. It'll be easy to flip the switch later. In the meantime, to enable the new disassembler, uncomment "#define USE_NEW_DISASSEMBLER" in lldb.cpp. llvm-svn: 150772
* First pass at mach-o core file support is in. It currently works for x86_64 Greg Clayton2012-02-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | user space programs. The core file support is implemented by making a process plug-in that will dress up the threads and stack frames by using the core file memory. Added many default implementations for the lldb_private::Process functions so that plug-ins like the ProcessMachCore don't need to override many many functions only to have to return an error. Added new virtual functions to the ObjectFile class for extracting the frozen thread states that might be stored in object files. The default implementations return no thread information, but any platforms that support core files that contain frozen thread states (like mach-o) can make a module using the core file and then extract the information. The object files can enumerate the threads and also provide the register state for each thread. Since each object file knows how the thread registers are stored, they are responsible for creating a suitable register context that can be used by the core file threads. Changed the process CreateInstace callbacks to return a shared pointer and to also take an "const FileSpec *core_file" parameter to allow for core file support. This will also allow for lldb_private::Process subclasses to be made that could load crash logs. This should be possible on darwin where the crash logs contain all of the stack frames for all of the threads, yet the crash logs only contain the registers for the crashed thrad. It should also allow some variables to be viewed for the thread that crashed. llvm-svn: 150154
* This patch combines common code from Linux and FreeBSD intoJohnny Chen2012-01-051-5/+12
| | | | | | | | | | a new POSIX platform. It also contains fixes for 64bit FreeBSD. The patch is based on changes by Mark Peek <mp@FreeBSD.org> and "K. Macy" <kmacy@freebsd.org> in their github repo located at https://github.com/fbsd/lldb. llvm-svn: 147609
* Added support for the new ".apple_objc" accelerator tables. These tables areGreg Clayton2011-10-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the same hashed format as the ".apple_names", but they map objective C class names to all of the methods and class functions. We need to do this because in the DWARF the methods for Objective C are never contained in the class definition, they are scattered about at the translation unit level and they don't even have attributes that say the are contained within the class itself. Added 3 new formats which can be used to display data: eFormatAddressInfo eFormatHexFloat eFormatInstruction eFormatAddressInfo describes an address such as function+offset and file+line, or symbol + offset, or constant data (c string, 2, 4, 8, or 16 byte constants). The format character for this is "A", the long format is "address". eFormatHexFloat will print out the hex float format that compilers tend to use. The format character for this is "X", the long format is "hex float". eFormatInstruction will print out disassembly with bytes and it will use the current target's architecture. The format character for this is "i" (which used to be being used for the integer format, but the integer format also has "d", so we gave the "i" format to disassembly), the long format is "instruction". Mate the lldb::FormatterChoiceCriterion enumeration private as it should have been from the start. It is very specialized and doesn't belong in the public API. llvm-svn: 143114
* Patch from Dragos Tatulea to re-enable the PECOFF object file parser for allGreg Clayton2011-10-111-4/+0
| | | | | | builds on all systems. llvm-svn: 141677
* Patch from dawn@burble.org to build on linux!Johnny Chen2011-10-101-0/+4
| | | | llvm-svn: 141593
* Enable all the new accelerator tables if they are present and don't manuallyGreg Clayton2011-10-041-0/+1
| | | | | | | | | | index the DWARF. Also fixed an issue with memory accelerator tables with a size of 1 where we would loop infinitely. Added support for parsing the new .apple_namespaces section which gives us a memory hash table for looking up namespaces. llvm-svn: 141128
* Convert over to the latest and greatest on disc acceleratorGreg Clayton2011-09-281-2/+2
| | | | | | | hash tables. Renamed the DWARF sections to ".apple_names" and ".apple_types" until we get more buy in from other vendors. llvm-svn: 140702
* Added first pass at PE COFF file reading support. It parses the sectionsGreg Clayton2011-09-091-2/+3
| | | | | | | correctly, symbols are coming soon. It also needs to be 32/64 bit hardened with more testing. llvm-svn: 139401
* Added support for accessing and loading our new .debug_names and .debug_typesGreg Clayton2011-09-011-0/+2
| | | | | | | | | | | | | | | | | | DWARF accelerator table sections to the DWARF parser. These sections are similar to the .debug_pubnames and .debug_pubtypes, but they are designed to be hash tables that are saved to disc in a way that the sections can just be loaded into memory and used without any work on the debugger side. The .debug_pubnames and .debug_pubtypes sections are not ordered, contain a copy of the name in the section itself which makes these sections quite large, they only include publicly exported names (so no static functions, no types defined inside functions), many compilers put different information in them making them very unreliable so most debugger ignore these sections and parse the DWARF on their own. The tables must also be parsed and sorted in order to be used effectively. The new sections can be quickly loaded and very efficiently be used to do name to DIE lookups with very little up front work. The format of these new sections will be changing while we work out the bugs, but we hope to have really fast name to DIE lookups soon. llvm-svn: 138979
* Finishing the renaming from "MacOSX-Kernel" to "Darwin-Kernel".Greg Clayton2011-08-221-6/+6
| | | | llvm-svn: 138283
* Added a new plug-in type: lldb_private::OperatingSystem. The operating system Greg Clayton2011-08-221-0/+3
| | | | | | | | | | | | | | | | | | | | plug-ins are add on plug-ins for the lldb_private::Process class that can add thread contexts that are read from memory. It is common in kernels to have a lot of threads that are not currently executing on any cores (JTAG debugging also follows this sort of thing) and are context switched out whose state is stored in memory data structures. Clients can now subclass the OperatingSystem plug-ins and then make sure their Create functions correcltly only enable themselves when the right binary/target triple are being debugged. The operating system plug-ins get a chance to attach themselves to processes just after launching or attaching and are given a lldb_private::Process object pointer which can be inspected to see if the main executable, target triple, or any shared libraries match a case where the OS plug-in should be used. Currently the OS plug-ins can create new threads, define the register contexts for these threads (which can all be different if desired), and populate and manage the thread info (stop reason, registers in the register context) as the debug session goes on. llvm-svn: 138228
* Patch by David Forsythe to build lldb on FreeBSD!Johnny Chen2011-08-021-0/+11
| | | | | | | | | | | | | | | | | | I did not take the patch for ClangExpressionParser.cpp since there was a recent change by Peter for the same line. Feel free to disagree. :-) Reference: ---------------------------------------------------------------------- r136580 | pcc | 2011-07-30 15:42:24 -0700 (Sat, 30 Jul 2011) | 3 lines Add reloc arg to standard JIT createJIT() Fixes non-__APPLE__ build. Patch by Matt Johnson! ---------------------------------------------------------------------- Also, I ignore the part of the patch to remove the RegisterContextDarwin*.h/.cpp. llvm-svn: 136720
* Remove the deprecated MacOSX native plug-in.Greg Clayton2011-08-011-3/+0
| | | | llvm-svn: 136626
* Added a boolean to the pure virtual lldb_private::Process::CanDebug(...)Greg Clayton2011-07-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | method so process plug-ins that are requested by name can answer yes when asked if they can debug a target that might not have any file in the target. Modified the ConnectionFileDescriptor to have both a read and a write file descriptor. This allows us to support UDP, and eventually will allow us to support pipes. The ConnectionFileDescriptor class also has a file descriptor type for each of the read and write file decriptors so we can use the correct read/recv/recvfrom call when reading, or write/send/sendto for writing. Finished up an initial implementation of UDP where you can use the "udp://" URL to specify a host and port to connect to: (lldb) process connect --plugin kdp-remote udp://host:41139 This will cause a ConnectionFileDescriptor to be created that can send UDP packets to "host:41139", and it will also bind to a localhost port that can be given out to receive the connectionless UDP reply. Added the ability to get to the IPv4/IPv6 socket port number from a ConnectionFileDescriptor instance if either file descriptor is a socket. The ProcessKDP can now successfully connect to a remote kernel and detach using the above "processs connect" command!!! So far we have the following packets working: KDP_CONNECT KDP_DISCONNECT KDP_HOSTINFO KDP_VERSION KDP_REATTACH Now that the packets are working, adding new packets will go very quickly. llvm-svn: 135363
* LLDB now has a Kernel dynamic linker that can detect where kexts areGreg Clayton2011-07-081-0/+3
| | | | | | | | | | | | | | | | | | loaded. It locks onto *-apple-darwin binaries where the binary has a "__KLD" segment. Soon I will modify the lldb_private::ObjectFile class to return an executable type which will be an enum with values something like: eObjectFileTypeUserExectable, eObjectFileTypeUserSharedLibrary, eObjectFileTypeKernelExectable, eObjectFileTypeKernelSharedLibrary, eObjectFileTypeObjectFile, eObjectFileTypeCoreFile But for now we look at the section since a user and kernel mach-o executable have the same mach-o file type. llvm-svn: 134682
* Build and initialise the Darwin ABI plugins on all platformsPeter Collingbourne2011-05-191-6/+6
| | | | llvm-svn: 131661
* Initialise the Darwin ABI plugins only on DarwinPeter Collingbourne2011-05-191-7/+7
| | | | llvm-svn: 131645
* Moved all code from ArchDefaultUnwindPlan and ArchVolatileRegs into theirGreg Clayton2011-05-111-10/+7
| | | | | | | | | | | | | | | respective ABI plugins as they were plug-ins that supplied ABI specfic info. Also hookep up the UnwindAssemblyInstEmulation so that it can generate the unwind plans for ARM. Changed the way ABI plug-ins are handed out when you get an instance from the plug-in manager. They used to return pointers that would be mananged individually by each client that requested them, but now they are handed out as shared pointers since there is no state in the ABI objects, they can be shared. llvm-svn: 131193
* Changed the emulate instruction function to take emulate options whichGreg Clayton2011-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | are defined as enumerations. Current bits include: eEmulateInstructionOptionAutoAdvancePC eEmulateInstructionOptionIgnoreConditions Modified the EmulateInstruction class to have a few more pure virtuals that can help clients understand how many instructions the emulator can handle: virtual bool SupportsEmulatingIntructionsOfType (InstructionType inst_type) = 0; Where instruction types are defined as: //------------------------------------------------------------------ /// Instruction types //------------------------------------------------------------------ typedef enum InstructionType { eInstructionTypeAny, // Support for any instructions at all (at least one) eInstructionTypePrologueEpilogue, // All prologue and epilogue instructons that push and pop register values and modify sp/fp eInstructionTypePCModifying, // Any instruction that modifies the program counter/instruction pointer eInstructionTypeAll // All instructions of any kind } InstructionType; This allows use to tell what an emulator can do and also allows us to request these abilities when we are finding the plug-in interface. Added the ability for an EmulateInstruction class to get the register names for any registers that are part of the emulation. This helps with being able to dump and log effectively. The UnwindAssembly class now stores the architecture it was created with in case it is needed later in the unwinding process. Added a function that can tell us DWARF register names for ARM that goes along with the source/Utility/ARM_DWARF_Registers.h file: source/Utility/ARM_DWARF_Registers.c Took some of plug-ins out of the lldb_private namespace. llvm-svn: 130189
* Even more renaming.Greg Clayton2011-04-251-1/+1
| | | | llvm-svn: 130155
OpenPOWER on IntegriCloud