summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
Commit message (Collapse)AuthorAgeFilesLines
* Fix TestGetVariables.py so it works correctly. We had duplicate static ↵Greg Clayton2016-04-291-1/+9
| | | | | | values showing up as we would find static variables in the Block and also in the compile unit. We now make sure a variable hasn't been added to the list before we add it. llvm-svn: 268101
* Add the ability to limit "source regexp" breakpoints to a particular functionJim Ingham2016-04-282-29/+40
| | | | | | | | | | | | within a source file. This isn't done, I need to make the name match smarter (right now it requires an exact match which is annoying for methods of a class in a namespace. Also, though we use it in tests all over the place, it doesn't look like we have a test for Source Regexp breakpoints by themselves, I'll add that in a follow-on patch. llvm-svn: 267834
* Source: fix another -Wunused-variable warningSaleem Abdulrasool2016-04-221-0/+2
| | | | | | | Conditionalise a variable definition which may be unused in certain compilations due to the preprocessor. Protect the variable accordingly. NFC. llvm-svn: 267247
* API: fix a -Wunused-variable warningSaleem Abdulrasool2016-04-211-0/+2
| | | | | | | expr_log is only conditionally used via preprocessing. Ensure that we guard the definition accordingly. NFC. llvm-svn: 267001
* Attempt to fix darwin build after header refactor in llvm (r266595)Pavel Labath2016-04-181-1/+1
| | | | llvm-svn: 266605
* Support Linux on SystemZ as platformUlrich Weigand2016-04-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Linux on SystemZ: - A new ArchSpec value of eCore_s390x_generic - A new directory Plugins/ABI/SysV-s390x providing an ABI implementation - Register context support - Native Linux support including watchpoint support - ELF core file support - Misc. support throughout the code base (e.g. breakpoint opcodes) - Test case updates to support the platform This should provide complete support for debugging the SystemZ platform. Not yet supported are optional features like transaction support (zEC12) or SIMD vector support (z13). There is no instruction emulation, since our ABI requires that all code provide correct DWARF CFI at all PC locations in .eh_frame to support unwinding (i.e. -fasynchronous-unwind-tables is on by default). The implementation follows existing platforms in a mostly straightforward manner. A couple of things that are different: - We do not use PTRACE_PEEKUSER / PTRACE_POKEUSER to access single registers, since some registers (access register) reside at offsets in the user area that are multiples of 4, but the PTRACE_PEEKUSER interface only allows accessing aligned 8-byte blocks in the user area. Instead, we use a s390 specific ptrace interface PTRACE_PEEKUSR_AREA / PTRACE_POKEUSR_AREA that allows accessing a whole block of the user area in one go, so in effect allowing to treat parts of the user area as register sets. - SystemZ hardware does not provide any means to implement read watchpoints, only write watchpoints. In fact, we can only support a *single* write watchpoint (but this can span a range of arbitrary size). In LLDB this means we support only a single watchpoint. I've set all test cases that require read watchpoints (or multiple watchpoints) to expected failure on the platform. [ Note that there were two test cases that install a read/write watchpoint even though they nowhere rely on the "read" property. I've changed those to simply use plain write watchpoints. ] Differential Revision: http://reviews.llvm.org/D18978 llvm-svn: 266308
* Provide more information in ThreadSanitizer's JSON data. Move remaining ↵Kuba Brecka2016-04-101-40/+3
| | | | | | TSan logic from SBThread to InstrumentationRuntime plugin. llvm-svn: 265905
* Fix the ThreadSanitizer support to avoid creating empty SBThreads and to not ↵Kuba Brecka2016-03-301-1/+5
| | | | | | crash when thread_id is unavailable. Plus a whitespace fix. llvm-svn: 264854
* Move DynamicLoader plugins to SystemInitializerFullPavel Labath2016-03-291-0/+12
| | | | | | | | | | | | Summary: These are not needed by lldb-server. Removing them shrinks the server by about 0.5%. Reviewers: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D18206 llvm-svn: 264735
* Expose top-level Clang expressions via the command line and the API.Sean Callanan2016-03-281-0/+12
| | | | | | | | | | | | | | | | | | Top-level Clang expressions are expressions that act as new translation units, and define their own symbols. They do not have function wrappers like regular expressions do, and declarations are persistent regardless of use of the dollar sign in identifiers. Names defined by these are given priority over all other symbol lookups. This patch adds a new expression option, '-p' or '--top-level,' which controls whether the expression is treated this way. It also adds a flag controlling this to SBExpressionOptions so that this API is usable externally. It also adds a test that validates that this works. (The test requires a fix to the Clang AST importer which I will be committing shortly.) <rdar://problem/22864976> llvm-svn: 264662
* Fix FILE * leak in Python APIStephane Sezer2016-03-251-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes a leak introduced by some of these changes: r257644 r250530 r250525 The changes made in these patches result in leaking the FILE* passed to SetImmediateOutputFile. GetStream() will dup() the fd held by the python caller and create a new FILE*. It will then pass this FILE* to SetImmediateOutputFile, which always uses the flag transfer_ownership=false when it creates a File from the FILE*. Since transfer_ownership is false, the lldb File destructor will not close the underlying FILE*. Because this FILE* came from a dup-ed fd, it will also not be closed when the python caller closes its file. Leaking the FILE* causes issues if the same file is used multiple times by different python callers during the same lldb run, even if these callers open and close the python file properly, as you can end up with issues due to multiple buffered writes to the same file. Reviewers: granata.enrico, zturner, clayborg Subscribers: zturner, lldb-commits, sas Differential Revision: http://reviews.llvm.org/D18459 Change by Francis Ricci <fjricci@fb.com> llvm-svn: 264476
* Use Clang's FixItHints to correct expressions with "trivial" mistakes (e.g. ↵Jim Ingham2016-03-251-0/+12
| | | | | | | | | | | | | | | "." for "->".) This feature is controlled by an expression command option, a target property and the SBExpressionOptions setting. FixIt's are only applied to UserExpressions, not UtilityFunctions, those you have to get right when you make them. This is just a first stage. At present the fixits are applied silently. The next step is to tell the user about the applied fixit. <rdar://problem/25351938> llvm-svn: 264379
* Add ThreadSanitizer debugging support.Kuba Brecka2016-03-232-1/+61
| | | | | | | | | | | | This patch adds ThreadSanitizer support into LLDB: - Adding a new InstrumentationRuntime plugin, ThreadSanitizerRuntime, in the same way ASan is implemented. - A breakpoint stops in `__tsan_on_report`, then we extract all sorts of information by evaluating an expression. We then populate this into StopReasonExtendedInfo. - SBThread gets a new API, SBThread::GetStopReasonExtendedBacktraces(), which returns TSan’s backtraces in the form of regular SBThreads. Non-TSan stop reasons return an empty collection. - Added some test cases. Reviewed by Greg Clayton. llvm-svn: 264162
* Move OperatingSystem plugins to SystemInitializerFullPavel Labath2016-03-161-0/+12
| | | | | | | | | | | | Summary: These are not needed in lldb-server. Removing them shrinks the server size by about 1.5%. Reviewers: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D18188 llvm-svn: 263625
* Add an "offset" option to "break set -n" and "break set -f -l". Jim Ingham2016-03-091-4/+35
| | | | | | | | | | | | That way you can set offset breakpoints that will move as the function they are contained in moves (which address breakpoints can't do...) I don't align the new address to instruction boundaries yet, so you have to get this right yourself for now. <rdar://problem/13365575> llvm-svn: 263049
* Change over the broadcaster/listener process to hold shared or weak pointersJim Ingham2016-03-074-86/+57
| | | | | | | | | | | | | | to each other. This should remove some infrequent teardown crashes when the listener is not the debugger's listener. Processes now need to take a ListenerSP, not a Listener&. This required changing over the Process plugin class constructors to take a ListenerSP, instead of a Listener&. Other than that there should be no functional change. <rdar://problem/24580184> CrashTracer: [USER] Xcode at …ework: lldb_private::Listener::BroadcasterWillDestruct + 39 llvm-svn: 262863
* Add support for reading line tables from PDB files.Zachary Turner2016-03-021-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | PDB is Microsoft's debug information format, and although we cannot yet generate it, we still must be able to consume it. Reason for this is that debug information for system libraries (e.g. kernel32, C Runtime Library, etc) only have debug info in PDB format, so in order to be able to support debugging of system code, we must support it. Currently this code should compile on every platform, but on non-Windows platforms the PDB plugin will return 0 capabilities, meaning that for now PDB is only supported on Windows. This may change in the future, but the API is designed in such a way that this will require few (if any) changes on the LLDB side. In the future we can just flip a switch and everything will work. This patch only adds support for line tables. It does not return information about functions, types, global variables, or anything else. This functionality will be added in a followup patch. Differential Revision: http://reviews.llvm.org/D17363 Reviewed by: Greg Clayton llvm-svn: 262528
* Add a set of new plugins to handle Java debuggingTamas Berghammer2016-02-261-0/+9
| | | | | | | | | The purpose of these plugins is to make LLDB capable of debugging java code JIT-ed by the android runtime. Differential revision: http://reviews.llvm.org/D17616 llvm-svn: 262015
* Handle the case when a variable is only valid in part of the enclosing scopeTamas Berghammer2016-02-252-2/+8
| | | | | | | | | | | DWARF stores this information in the DW_AT_start_scope attribute. This CL add support for this attribute and also changes the functions displaying frame variables to only display the variables currently in scope. Differential revision: http://reviews.llvm.org/D17449 llvm-svn: 261858
* This patch stops lldb from loading a .lldbinit file from the currentJason Molenda2016-02-192-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | working directory by default -- a typical security problem that we need to be more conservative about. It adds a new target setting, target.load-cwd-lldbinit which may be true (always read $cwd/.lldbinit), false (never read $cwd/.lldbinit) or warn (warn if there is a $cwd/.lldbinit and don't read it). The default is set to warn. If this is met with unhappiness, we can look at changing the default to true (to match current behavior) on a different platform. This does not affect reading of ~/.lldbinit - that will still be read, as before. If you run lldb in your home directory, it will not warn about the presence of a .lldbinit file there. I had to add two SB API - SBHostOS::GetUserHomeDirectory and SBFileSpec::AppendPathComponent - for the lldb driver code to be able to get the home directory path in an OS neutral manner. The warning text is There is a .lldbinit file in the current directory which is not being read. To silence this warning without sourcing in the local .lldbinit, add the following to the lldbinit file in your home directory: settings set target.load-cwd-lldbinit false To allow lldb to source .lldbinit files in the current working directory, set the value of this variable to true. Only do so if you understand and accept the security risk. <rdar://problem/24199163> llvm-svn: 261280
* Fix OSX cmake buildEwan Crawford2016-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | Commit r260721(http://reviews.llvm.org/D17182) introduced the following error when building for OSX using cmake: Undefined symbols for architecture x86_64: "_PyInit__lldb", referenced from: -exported_symbol[s_list] command line option ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Adding '*' to the regex solves this problem, since it makes the symbol optional. Reviewers: sivachandra, zturner, labath Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D17384 llvm-svn: 261227
* Adding an SBThread::StepInto that takes an end-line, also moved the code ↵Jim Ingham2016-02-131-4/+19
| | | | | | | | that figures out the address range for the step to SymbolContext. llvm-svn: 260772
* Adjust for Python-3.Siva Chandra2016-02-121-0/+1
| | | | | | | | | | | | | | | Summary: This does not yet give us a clean testsuite run but it does help with: 1. Actually building on linux 2. Run the testsuite with over 70% tests passing on linux. Reviewers: tfiala, labath, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D17182 llvm-svn: 260721
* Now that SymbolFileDWARF supports having types in completely separate .pcm ↵Greg Clayton2016-02-102-1/+6
| | | | | | | | | | | | | | file with "-fmodules -gmodules", each SymbolFileDWARF can reference module DWARF info by looking in other DWARF files. Then if you have 1000 .o files that each reference one or more .pcm files in their debug info, a simple Module::FindTypes(...) call can end up searching the same .pcm file over and over and over. Now all internal FindTypes methods in classes (ModuleList, Module, SymbolFile) now take an extra argument: llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files Each time a SymbolFile::FindTypes() is called, it needs to check the searched_symbol_files list to make sure it hasn't already been asked to find the type and return immediately if it has been checked. This will stop circular dependencies from also crashing LLDB during type queries. This has proven to be an issue when debugging large applications on MacOSX that use DWARF in .o files. <rdar://problem/24581488> llvm-svn: 260434
* Log error message in SBTarget::LaunchPavel Labath2016-02-021-3/+2
| | | | llvm-svn: 259514
* Ignore breakpoints by default in SBFrame::EvaluateExpressionEugene Leviant2016-01-291-0/+3
| | | | llvm-svn: 259185
* Remove autoconf support from source directories.Eugene Zelenko2016-01-281-18/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPSBhushan D. Attarde2016-01-271-0/+8
| | | | | | | | | | | | | SUMMARY: Get the load address for the address given by symbol and function. Earlier, this was done for function only, this patch does it for symbol too. This patch also adds TestAvoidBreakpointInDelaySlot.py to test this change. Reviewers: clayborg Subscribers: labath, zturner, mohit.bhakkad, sagar, jaydeep, lldb-commits Differential Revision: http://reviews.llvm.org/D16049 llvm-svn: 258919
* Fix -Wformat-pedantic warningHans Wennborg2016-01-131-1/+2
| | | | | | | | | | /work/llvm-3.8/llvm.src/tools/lldb/source/API/SBProcess.cpp:1003:73: error: format specifies type 'void *' but the argument has type 'lldb_private::Event *' [-Werror,-Wformat-pedantic] log->Printf ("SBProcess::%s (event.sp=%p) => %d", __FUNCTION__, event.get(), ret_val); ~~ ^~~~~~~~~~~ 1 error generated. llvm-svn: 257692
* Add logging to SBProcess::GetRestartedFromEventPavel Labath2016-01-051-1/+8
| | | | llvm-svn: 256853
* Strip trailing whitespaceEd Maste2016-01-041-3/+3
| | | | | | | | (There are changes in the copies of these four files in the FreeBSD base system, and I've changed these ones to reduce gratuitous diffs in future imports.) llvm-svn: 256723
* Add API to support retrieving the formatters category for a specific languageEnrico Granata2015-12-181-0/+10
| | | | llvm-svn: 256033
* First pass at LLDBRPC.frameworkGreg Clayton2015-12-151-0/+7
| | | | llvm-svn: 255697
* When constructing an address range to "step" or "next" through,Jason Molenda2015-12-151-2/+2
| | | | | | | | | | | | | | find the largest address range (possibly combining multiple LineEntry's for this line number) that is contiguous. This allows lldb's fast-step stepping algorithm to potentially run for a longer address range than if we have to stop at every LineEntry indicating a subexpression in the source line. http://reviews.llvm.org/D15407 <rdar://problem/23270882> llvm-svn: 255590
* Add Hexagon ABI to System InitializationTed Woodward2015-12-101-0/+3
| | | | | | | | | | | | Summary: When the Hexagon ABI was added, it was inadvertently left out of initialization/termination. This patch adds it. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15347 llvm-svn: 255268
* Add a new option to Platform::LoadImage to install the imageTamas Berghammer2015-12-081-2/+13
| | | | | | | | | | | | | | | | | | | | | This change introduce 3 different working mode for Platform::LoadImage depending on the file specs specified. * If only a remote file is specified then the remote file is loaded on the target (same behavior as before) * If only a local file is specified then the local file is installed to the current working directory and then loaded from there. * If both local and remote file is specified then the local file is installed to the specified location and then loaded from there. The same options are exposed on the SB API with a new method LoadImage method while the old signature presers its meaning. On the command line the installation of the shared library can be specified with the "--install" option of "process load". Differential revision: http://reviews.llvm.org/D15152 llvm-svn: 255014
* Fix "process load/unload" on androidTamas Berghammer2015-12-021-2/+4
| | | | | | | | | | | On android the symbols exposed by libdl (dlopen, dlclose, dlerror) prefixed by "__dl_". This change moves the handling of process load/unload to the platform object and override it for android to handle the special prefix. Differential revision: http://reviews.llvm.org/D11465 llvm-svn: 254504
* Enable saving of mini dumps with lldb process save-core.Adrian McCarthy2015-11-201-0/+25
| | | | | | | | Also adds SB API to save a core and tests that use it. Differential Revision: http://reviews.llvm.org/D14793 llvm-svn: 253734
* Revert "FOO"Adrian McCarthy2015-11-201-25/+0
| | | | | | | | Accidentally commited before I was done. This reverts commit 2ec2da4ee52780582d5e9c88b2e982a688fbdbe1. llvm-svn: 253685
* FOOAdrian McCarthy2015-11-201-0/+25
| | | | llvm-svn: 253684
* Reapply r253423 and r253424 (which cleanup the data formatters iteration ↵Enrico Granata2015-11-181-1/+1
| | | | | | model, as well as the type X list commands), along with a change by Zachary Turner to bypass a MSVC bug with SFINAE llvm-svn: 253493
* Revert 2 commits breaking the MSVC buildTamas Berghammer2015-11-181-1/+1
| | | | | | | | | | Revert "Remove a few vestigial typedefs from the old world" This reverts commit 05872cda2a00fbd988c4fc761b1f87fe9edce224. Revert "Cleanup the type X list commands to use the new ForEach goodness" This reverts commit 85b1d83819a22cdc9ef12f58fd4fa92b473a4f81. llvm-svn: 253455
* Cleanup the type X list commands to use the new ForEach goodnessEnrico Granata2015-11-181-1/+1
| | | | llvm-svn: 253423
* Add the ability (through the SB API & command line) to specify an addressJim Ingham2015-11-171-0/+35
| | | | | | | | breakpoint as "file address" so that the address breakpoint will track that module even if it gets loaded in a different place. Also fixed the Address breakpoint resolver so that it handles this tracking correctly. llvm-svn: 253308
* Fixed TypeMemberFunctionImpl to not use clang types directly but use the new ↵Greg Clayton2015-11-102-0/+44
| | | | | | | | | | CompilerDecl class to do the job in an abstract way. Fixed a crash that would happen if you tried to get the name of a constructor or destructor by calling "getDeclName()" instead of calling getName() (which would assert and crash). Added the ability to get function arguments names from SBFunction. llvm-svn: 252622
* Add SBType::IsAnonymousType() and relative plumbing in the debugger internalsEnrico Granata2015-11-071-0/+8
| | | | | | | | For language that support such a thing, this API allows to ask whether a type is anonymous (i.e. has been given no name) Comes with test case llvm-svn: 252390
* Make the language specifier to "break set" actually filter the names by ↵Jim Ingham2015-11-061-41/+48
| | | | | | | | | | | | | their language. So for instance: break set -l c++ -r Name will only break on C++ symbols that match Name, not ObjC or plain C symbols. This also works for "break set -n" and there are SB API's to pass this as well. llvm-svn: 252356
* Add PlatformRemoteAppleWatch (apple watch), PlatformRemoteAppleTV (apple tv),Jason Molenda2015-11-061-0/+12
| | | | | | | PlatformAppleWatchSimulator (apple watch simulator), PlatformAppleTVSimulator (apple tv simulator). llvm-svn: 252251
* Add go data formatters.Ryan Brown2015-11-051-0/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D13878 llvm-svn: 252109
* Create an expression parser for Go.Ryan Brown2015-11-021-0/+18
| | | | | | | | | | | The Go interpreter doesn't JIT or use LLVM, so this also moves all the JIT related code from UserExpression to a new class LLVMUserExpression. Differential Revision: http://reviews.llvm.org/D13073 Fix merge llvm-svn: 251820
OpenPOWER on IntegriCloud