summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/interface
Commit message (Collapse)AuthorAgeFilesLines
...
* Adds tests for breakpoint names, and a FindBreakpointsByName.Jim Ingham2016-09-211-0/+3
| | | | | | | | Also if you set a breakpoint with an invalid name, we'll refuse to set the breakpoint rather than silently ignoring the name. llvm-svn: 282043
* Add some more tests for breakpoint serialization.Jim Ingham2016-09-202-0/+8
| | | | | | | | | | Serialize breakpoint names & the hardware_requested attributes. Also added a few missing affordances to SBBreakpoint whose absence writing the tests pointed out. <rdar://problem/12611863> llvm-svn: 282036
* First tests for serializing breakpoints.Jim Ingham2016-09-161-0/+6
| | | | | | Plus a few bug fixes I found along the way. llvm-svn: 281690
* Add SB API's for writing breakpoints to & creating the from a file.Jim Ingham2016-09-142-0/+35
| | | | | | | | | | | Moved the guts of the code from CommandObjectBreakpoint to Target (should have done it that way in the first place.) Added an SBBreakpointList class so there's a way to specify which breakpoints to serialize and to report the deserialized breakpoints. <rdar://problem/12611863> llvm-svn: 281520
* LLDB: API for iPermission of object file's sectionsAbhishek Aggarwal2016-09-081-0/+3
| | | | | | | | | | | | | | | | | | Summary: - Added an API to public interface that provides permissions (RWX) of individual sections of an object file - Earlier, there was no way to find out this information through SB APIs - A possible use case of this API is: when a user wants to know the sections that have executable machine instructions and want to write a tool on top of LLDB based on this information - Differential Revision: https://reviews.llvm.org/D24251 llvm-svn: 280924
* Add SBType::GetArrayType() such that - given a type - one can make an array ↵Enrico Granata2016-08-301-0/+3
| | | | | | | | (of a given size) of that type This is currently only implemented for the clang-based TypeSystem, but other languages are welcome to jump in! llvm-svn: 280151
* Add StructuredData plugin type; showcase with new DarwinLog featureTodd Fiala2016-08-193-2/+51
| | | | | | | | | | | | Take 2, with missing cmake line fixed. Build tested on Ubuntu 14.04 with clang-3.6. See docs/structured_data/StructuredDataPlugins.md for details. differential review: https://reviews.llvm.org/D22976 reviewers: clayborg, jingham llvm-svn: 279202
* Revert "Add StructuredData plugin type; showcase with new DarwinLog feature"Todd Fiala2016-08-193-51/+2
| | | | | | This reverts commit 1d885845d1451e7b232f53fba2e36be67aadabd8. llvm-svn: 279200
* Add StructuredData plugin type; showcase with new DarwinLog featureTodd Fiala2016-08-193-2/+51
| | | | | | | | | See docs/structured_data/StructuredDataPlugins.md for details. differential review: https://reviews.llvm.org/D22976 reviewers: clayborg, jingham llvm-svn: 279198
* Add a few more needed bits to the scripted thread plans.Jim Ingham2016-08-052-0/+6
| | | | llvm-svn: 277879
* Add an API to unwind from a hand-called expression.Jim Ingham2016-07-081-0/+8
| | | | | | | This is just an SB API way of doing "thread return -x". <rdar://problem/27110360> llvm-svn: 274822
* Implement GetMemoryRegions() for Linux and Mac OSX core files.Howard Hellyer2016-07-071-0/+3
| | | | | | | | | | | | | | | Summary: This patch fills in the implementation of GetMemoryRegions() on the Linux and Mac OS core file implementations of lldb_private::Process (ProcessElfCore::GetMemoryRegions and ProcessMachCore::GetMemoryRegions.) The GetMemoryRegions API was added under: http://reviews.llvm.org/D20565 The patch re-uses the m_core_range_infos list that was recently added to implement GetMemoryRegionInfo in both ProcessElfCore and ProcessMachCore to ensure the returned regions match the regions returned by Process::GetMemoryRegionInfo(addr_t load_addr, MemoryRegionInfo &region_info). Reviewers: clayborg Subscribers: labath, lldb-commits Differential Revision: http://reviews.llvm.org/D21751 llvm-svn: 274741
* Because of our lifetime rules w.r.t. ValueObjects and ClusterManagers, ↵Enrico Granata2016-07-061-0/+23
| | | | | | | | | | | | | | | | synthetic children caching is a tricky area: - if a synthetic child comes from the same hierarchy as its parent object, then it can't be cached by SharedPointer inside the synthetic provider, or it will cause a reference loop; - but, if a synthetic child is made from whole cloth (e.g. from an expression, a memory region, ...), then it better be cached by SharedPointer, or it will be cleared out and cause an assert() to fail if used at a later point For most cases of self-rooted synthetic children, we have a flag we set "IsSyntheticChildrenGenerated", but we were not using it to track caching. So, what ended up happening is each provider would set up its own cache, and if it got it wrong, a hard to diagnose crash would ensue This patch fixes that by centralizing caching in ValueObjectSynthetic - if a provider returns a self-rooted child (as per the flag), then it gets cached centrally by the ValueObject itself This cache is used only for lifetime management and not later retrieval of child values - a different cache handles that (because we might have a mix of self-rooted and properly nested child values for the same parent, we can't trivially use this lifetime cache for retrieval) Fixes rdar://26480007 llvm-svn: 274683
* Fix "lldb.SBProcess.is_stopped" and "lldb.SBProcess.is_running" to do the ↵Greg Clayton2016-07-051-3/+3
| | | | | | | | right thing. https://llvm.org/bugs/show_bug.cgi?id=28428 llvm-svn: 274568
* fixits are apparently called fix-its.Jim Ingham2016-06-281-2/+2
| | | | | | <rdar://problem/26998596> llvm-svn: 273979
* Add .i files for SBMemoryRegionInfo and SBMemoryRegionInfoList and also hook ↵Greg Clayton2016-06-243-0/+99
| | | | | | | | up the new calls in SBProcess that give out SBMemoryRegionInfo and SBMemoryRegionInfoList objects. Also make sure the right headers and .i files are included so SWIG can hook everything up. llvm-svn: 273749
* Add the ability to limit "source regexp" breakpoints to a particular functionJim Ingham2016-04-281-0/+6
| | | | | | | | | | | | 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
* Add missing swig wrappers for r264662Pavel Labath2016-03-291-0/+5
| | | | llvm-svn: 264713
* Fix FILE * leak in Python APIStephane Sezer2016-03-251-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+9
| | | | | | | | | | | | | | | "." 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-231-0/+9
| | | | | | | | | | | | 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
* Add an "offset" option to "break set -n" and "break set -f -l". Jim Ingham2016-03-091-2/+46
| | | | | | | | | | | | 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
* This patch stops lldb from loading a .lldbinit file from the currentJason Molenda2016-02-192-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Adding an SBThread::StepInto that takes an end-line, also moved the code ↵Jim Ingham2016-02-131-0/+11
| | | | | | | | that figures out the address range for the step to SymbolContext. llvm-svn: 260772
* Add a note on how to create an empty target and use it to attach toJim Ingham2016-02-011-0/+10
| | | | | | processes whose executables you don't know up front. llvm-svn: 259396
* [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPSBhushan D. Attarde2016-01-271-0/+3
| | | | | | | | | | | | | 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 some issues with bytes and strings in Python 3.Zachary Turner2016-01-251-1/+1
| | | | | | | | | | | | | | | | | | SBProcess::ReadMemory and other related functions such as WriteMemory are returning Python string() objects. This means that in Python 3 that are returning Unicode objects. In reality they should be returning bytes objects which is the same as a string in Python 2, but different in Python 3. This patch updates the generated SWIG code to return Python bytes objects for all memory related functions. One quirk of this patch is that the C++ signature of ReadCStringFromMemory has it writing c-string data into a void*. This confuses our swig typemaps which expect that a void* means byte data. So I hacked up a custom typemap which maps this specific function to treat the void* as string data instead of byte data. llvm-svn: 258743
* Add API to support retrieving the formatters category for a specific languageEnrico Granata2015-12-181-0/+3
| | | | llvm-svn: 256033
* Make it clear how you would get the pointee out of an SBValue withJim Ingham2015-12-041-0/+5
| | | | | | GetType().IsPointerType() returns true. llvm-svn: 254790
* Add documentation for SBTarget::CreateValueFromAddress.Jim Ingham2015-12-041-0/+18
| | | | llvm-svn: 254763
* Enable saving of mini dumps with lldb process save-core.Adrian McCarthy2015-11-201-0/+3
| | | | | | | | 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-3/+0
| | | | | | | | Accidentally commited before I was done. This reverts commit 2ec2da4ee52780582d5e9c88b2e982a688fbdbe1. llvm-svn: 253685
* FOOAdrian McCarthy2015-11-201-0/+3
| | | | llvm-svn: 253684
* Add the ability (through the SB API & command line) to specify an addressJim Ingham2015-11-171-0/+3
| | | | | | | | 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
* Python 3 - Use six in our embedded Python glue code.Zachary Turner2015-11-111-1/+1
| | | | llvm-svn: 252767
* Fixed TypeMemberFunctionImpl to not use clang types directly but use the new ↵Greg Clayton2015-11-102-0/+9
| | | | | | | | | | 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/+3
| | | | | | | | 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-0/+21
| | | | | | | | | | | | | 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 calls to the SB API to access the multi-language formatter category featureEnrico Granata2015-10-271-0/+9
| | | | llvm-svn: 251376
* [SBValue] Add a method GetNumChildren(uint32_t max)Siva Chandra2015-10-211-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Along with this, support for an optional argument to the "num_children" method of a Python synthetic child provider has also been added. These have been added with the following use case in mind: Synthetic child providers currently have a method "has_children" and "num_children". While the former is good enough to know if there are children, it does not give any insight into how many children there are. Though the latter serves this purpose, calculating the number for children of a data structure could be an O(N) operation if the data structure has N children. The new method added in this change provide a middle ground. One can call GetNumChildren(K) to know if a child exists at an index K which can be as large as the callers tolerance can be. If the caller wants to know about children beyond K, it can make an other call with 2K. If the synthetic child provider maintains state about it counting till K previosly, then the next call is only an O(K) operation. Infact, all calls made progressively with steps of K will be O(K) operations. Reviewers: vharron, clayborg, granata.enrico Subscribers: labath, lldb-commits Differential Revision: http://reviews.llvm.org/D13778 llvm-svn: 250930
* Added support for the "--repl" argument to LLDB. Sean Callanan2015-10-201-0/+3
| | | | | | | | | This makes LLDB launch and create a REPL, specifying no target so that the REPL can create one for itself. Also added the "--repl-language" option, which specifies the language to use. Plumbed the relevant arguments and errors through the REPL creation mechanism. llvm-svn: 250773
* Make some more of the LLDB/SWIG/Python glue Python 3 aware.Zachary Turner2015-10-1612-48/+48
| | | | | | | Mostly this is just converting some print statements to print functions. llvm-svn: 250533
* Fix TestTargetAPI.py test for users who use Swig 3.0.5 or greater.Adrian McCarthy2015-10-131-0/+2
| | | | | DifferentialRevision: http://reviews.llvm.org/D13679 llvm-svn: 250188
* Add a doc string for ReturnFromFrame.Jim Ingham2015-10-121-0/+7
| | | | llvm-svn: 250082
* SBTarget::Attach(SBAttachInfo &) was changed to not be asynchronous back in ↵Greg Clayton2015-10-051-0/+5
| | | | | | | | | | February and this affected Xcode's abililty to cancel an attach to process by name. Added the ability to specify if an attach by name should be synchronous or not in SBAttachInfo and ProcessAttachInfo. <rdar://problem/22821480> llvm-svn: 249361
* First part of an attempt to indicate to the user when they are Jason Molenda2015-07-291-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | debugging optimized code. Adds new methods on Function/SBFunction to query whether a given function is optimized. Adds a new function.is-optimized format entity and changes the default frame-format to append "[opt]" if the function was built with optimization. The only indication that a binary was built with optimization that we have right now is the presence of the DW_AT_APPLE_optimized attribute (DW_FORM_flag value 1) in the DW_TAG_compile_unit. The absence of this flag may mean that the compile_unit was not compiled with optimization, or it may mean that the producer does not generate this attribute. Currently this only works for dSYM debugging. When we create the CompileUnit with dwarf-in-.o-file debugging we don't have the attribute value yet so it's not set. I need to find the flag value when we do start to read the .o file DWARF and set the CompileUnit's status at that point - but haven't done it yet. I'm also going to add a mechanism for issuing warnings to users such that they're only issued once in a debug session and there is away for users to suppress these warnings altogether via .lldbinit file settings. But I want to get this changeset committed now that it's at a useful state. <rdar://problem/19281172> llvm-svn: 243508
* Refactor Unix signals.Chaoren Lin2015-07-141-0/+3
| | | | | | | | | | | | | | | | | | Summary: - Consolidate Unix signals selection in UnixSignals. - Make Unix signals available from platform. - Add jSignalsInfo packet to retrieve Unix signals from remote platform. - Get a copy of the platform signal for each remote process. - Update SB API for signals. - Update signal utility in test suite. Reviewers: ovyalov, clayborg Subscribers: chaoren, jingham, labath, emaste, tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D11094 llvm-svn: 242101
* Add a version of SBTarget::EvaluateExpression that doesn't requireJim Ingham2015-07-071-0/+4
| | | | | | | | an options (and makes an appropriate defaulted option for you.) <rdar://problem/20639202> llvm-svn: 241632
* Add a GetDisplayName() API to SBFrame, SBFunction and SBSymbolEnrico Granata2015-07-063-0/+9
| | | | | | | | | | This API is currently a no-op (in the sense that it has the same behavior as the already existing GetName()), but is meant long-term to provide a best-for-visualization version of the name of a function It is still not hooked up to the command line 'bt' command, nor to the 'gui' mode, but I do have ideas on how to make that work going forward rdar://21203242 llvm-svn: 241482
* Add const versions of SBFrame::GetFunctionName and SBFrame::IsInlined.Oleksiy Vyalov2015-06-251-1/+7
| | | | | | http://reviews.llvm.org/D10711 llvm-svn: 240660
OpenPOWER on IntegriCloud