summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* [Target] Remove ABI's dependence on ExpressionParserAlex Langford2019-05-311-5/+5
| | | | llvm-svn: 362259
* [FormatEntity] Ignore ASCII escape sequences when colors are disabled.Jonas Devlieghere2019-05-315-13/+42
| | | | | | | | | This patch makes the FormatEntity honor the debugger's color settings by not inserting ASCII escape sequences when colors are disabled. Differential revision: https://reviews.llvm.org/D62714 llvm-svn: 362240
* Fix problem with r362192Richard Trieu2019-05-311-5/+8
| | | | | | | The string returned only sometimes ends in NULL. Explicitly check for the NULL and pop off the NULL if it is there. llvm-svn: 362194
* Fix off-by-one error.Richard Trieu2019-05-311-1/+1
| | | | | | | The created string is one char too large, so it pulls the terminating NULL as the last character of the string. This later causes SocketTest.cpp to fail. llvm-svn: 362192
* Make CPlusPlusNameParser robust against nullptr StringRefs.Adrian Prantl2019-05-312-0/+8
| | | | | | | | | | There is likely also an underlying bug in all code that calls CPlusPlusNameParser with nullptrs, but this patch can also stand for itself. rdar://problem/49072829 llvm-svn: 362177
* Make ConnectionFileDescription work with all socketsAntonio Afonso2019-05-3010-19/+125
| | | | | | | | | | | | | | | | | | | | | Summary: My main goal here is to make lldb-server work with Android Studio. This is currently not the case because lldb-server is started in platform mode listening on a domain socket. When Android Studio connects to it lldb-server crashes because even though it's listening on a domain socket as soon as it gets a connection it asserts that it's a TCP connection, which will obviously fails for any non-tcp connection. To do this I came up with a new method called GetConnectURI() in Socket that returns the URI needed to connect to the connected portion of the socket. Reviewers: labath, clayborg, xiaobai Reviewed By: labath Subscribers: mgorny, jfb, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62089 llvm-svn: 362173
* [Target] Generalize language-specific behavior in ThreadPlanStepThroughAlex Langford2019-05-304-20/+14
| | | | | | | | | | | | Summary: When creating a ThreadPlan to step through a trampoline, we ask the ObjC language runtime and the CPP language runtime to come up with such a thread plan if the dynamic loader fails to give us one. I don't see why this behavior can't be language agnostic. Differential Revision: https://reviews.llvm.org/D61921 llvm-svn: 362164
* [Target] Generalize Process::IsPossibleDynamicValueAlex Langford2019-05-301-5/+5
| | | | llvm-svn: 362154
* Code and comment cleanups [NFC]Greg Clayton2019-05-302-51/+44
| | | | | | | | | Changes: - update comments to detail the info can come from .debug_info or .debug_types - Rename "debug_info_data" to "data" now that we can get data from .debug_info or .debug_types. - Also call DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr(...) instead of manually grabbing abbreviation. llvm-svn: 362116
* [Docs] Modernize references to macOSJ. Ryan Stinnett2019-05-303-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This updates all places in documentation that refer to "Mac OS X", "OS X", etc. to instead use the modern name "macOS" when no specific version number is mentioned. If a specific version is mentioned, this attempts to use the OS name at the time of that version: * Mac OS X for 10.0 - 10.7 * OS X for 10.8 - 10.11 * macOS for 10.12 - present Reviewers: JDevlieghere Subscribers: mgorny, christof, arphaman, cfe-commits, lldb-commits, libcxx-commits, llvm-commits Tags: #clang, #lldb, #libc, #llvm Differential Revision: https://reviews.llvm.org/D62654 llvm-svn: 362113
* Remove length modifier when using assignment suppression in TimerTestAntonio Afonso2019-05-301-2/+2
| | | | | | | | | | | | | | | | Summary: This is useless and it's giving warnings in the build bots: /home/motus/netbsd8/netbsd8/llvm/tools/lldb/unittests/Utility/TimerTest.cpp:67:43: warning: use of assignment suppression and length modifier together in gnu_scanf format [-Wformat=] Reviewers: xiaobai Subscribers: krytarowski, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62626 llvm-svn: 362107
* Fix a regression in DWARF access speed caused by svn revision 356190Greg Clayton2019-05-303-8/+263
| | | | | | | | | | | | | | The issue was caused by the error checking code that was added. It was incorrectly adding an extra abbreviation when DWARFEnumState::Complete was received since it would push an extra abbreviation onto the list with the abbreviation code of zero. This cause m_idx_offset in each DWARFAbbreviationDeclarationSet to be set to UINT32_MAX. This valid indicates we must linearly search for attributes, not access them in O(1) time. This caused every DWARFDebugInfoEntry that would try to get its DWARFAbbreviationDeclaration from the CU's DWARFAbbreviationDeclarationSet to always linearly search the abbreviation set for a given abbreviation code. Easy to see why this would cause things to be slow. This regression was caused by: https://reviews.llvm.org/D59370. I asked to ensure there was no regression is parsing or access speed, but that must not have been done. In my test with 40 DWARF files trying to set a breakpoint by function name and in a header file, I see a 8% speed improvement with this fix. There was no regression in correctness, just very inefficient access. Added full unit testing for DWARFAbbreviationDeclarationSet parsing to ensure this doesn't regress. Differential Revision: https://reviews.llvm.org/D62630 llvm-svn: 362105
* Improve DWARF parsing and accessing by 1% to 2%Greg Clayton2019-05-302-38/+18
| | | | | | | | | | When LLDB first started we didn't have our mmap of the DWARF data done correctly and if the backing file would change we would get live changes as the file changed and it would cause problems. We now mmap correctly and do not run into these issues. There was legacy code in DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr(...) that would always extract the abbrev index each time the function was called to verify that DWARF data hadn't changed and a warning was emitted if it did. We no longer need this and the code was removed. The other thing this function did when it parsed the abbrev index was give us the offset of the first attribute bytes by adding the LEB128 size to the offset. This required an extra parameter to DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr(...) which is now removed. I added "lldb::offset_t DWARFDebugInfoEntry::GetFirstAttributeOffset() const" which calculates this when we need it and modified all sites that need the offset to call it. Now that we aren't decoding and verifying the abbrev index, it speeds up DWARF access by 1% to 2%. Differential Revision: https://reviews.llvm.org/D62634 llvm-svn: 362103
* DWARFASTParserClang: Delete dead codePavel Labath2019-05-301-33/+0
| | | | | | | This removes places where DW_AT_decl_file/line/column was being parsed, but not used. llvm-svn: 362086
* DWARFASTParserClang: Move attribute parsing into a single functionPavel Labath2019-05-301-634/+427
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The ParseTypeFromDWARF function consists of a huge switch on the kind of type being parsed. Each case in this switch starts with parsing the attributes of the current DIE. A lot of these attributes are specific to one kind of a type, but a lot of them are common too, leading to code duplication. This patch reduces the duplication (and the size of ParseTypeFromDWARF) by moving the attribute parsing to a separate function. It creates a struct (ParsedTypeAttributes), which contains a parsed form of all attributes which are useful for parsing any kind of a type. The parsing code for a specific type kind can then access the fields which are relevant for that specific case. Reviewers: JDevlieghere, clayborg, aprantl Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D62477 llvm-svn: 362075
* Make CompileUnit::GetSupportFiles return a const listPavel Labath2019-05-303-11/+9
| | | | | | | | | | | | There's no reason for anyone to modify a list from outside of a symbol file (as that would break a lot of invariants that symbol files depend on). Make the function return a const FileSpecList and fix up a couple of places that were needlessly binding non-const references to the result of this function. llvm-svn: 362069
* [lldb-server] Support 'g' packetsPavel Labath2019-05-309-47/+279
| | | | | | | Differential Revision: https://reviews.llvm.org/D62221 Patch by Guilherme Andrade <guiandrade@google.com>. llvm-svn: 362063
* DWARFDebugInfoEntry: delete unused Extract() and rename FastExtract() to ↵Fangrui Song2019-05-303-172/+10
| | | | | | | | | | | | | Extract() The function Extract() is almost a duplicate of FastExtract() but is not used. Delete it and rename FastExtract() to Extract(). Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D62593 llvm-svn: 362049
* [crashlog] Add a missing call to decode.Davide Italiano2019-05-301-1/+1
| | | | | | <rdar://problem/51139357> llvm-svn: 362044
* [Commands] Remove commented out codeAlex Langford2019-05-291-4/+0
| | | | llvm-svn: 362042
* Use correct format specifier to silence -Wformat warning.Richard Trieu2019-05-291-1/+2
| | | | llvm-svn: 362035
* Fix Xcode project lldb unit test target so it compiles.Greg Clayton2019-05-291-0/+4
| | | | llvm-svn: 362033
* [Target] Sink some asserts into Process::GetLanguageRuntimeAlex Langford2019-05-291-5/+14
| | | | llvm-svn: 362032
* [Target] Introduce Process::GetLanguageRuntimesAlex Langford2019-05-295-10/+42
| | | | | | | | | | | | | | | | Summary: Currently there's not really a good way to iterate over the language runtimes a process has. This is sometimes desirable (as seen in my change to Thread). Additionally, there's not really a good reason to iterate over every available language, but rather only over languages for which we have a plugin loaded. Reviewers: JDevlieghere, davide, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D62562 llvm-svn: 361999
* Fixed source header [NFC]Greg Clayton2019-05-291-1/+1
| | | | llvm-svn: 361995
* Add more information to the log timer dumpAntonio Afonso2019-05-293-13/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The `log timer dump` is showing the time of the function itself minus any function that is called from this one that also happens to be timed. However, this is really not obvious and it also makes it hard to understand the time spent in total and also which children are actually taking the time. To get a better reading of the timer dump I added the total, children (which I named child) and also the hit count. I used these timers to figure out a performance issue and only after adding this things were more clear to me. It looks like this: ``` (lldb) log timer dump 35.447713617 sec (total: 35.449s; child: 0.001s; count: 1374) for void SymbolFileDWARF::Index() 29.717921481 sec (total: 29.718s; child: 0.000s; count: 8230500) for const lldb_private::ConstString &lldb_private::Mangled::GetDemangledName(lldb::LanguageType) const 21.049508865 sec (total: 24.683s; child: 3.633s; count: 1399) for void lldb_private::Symtab::InitNameIndexes() ... ``` Reviewers: clayborg, teemperor, labath, espindola, xiaobai Reviewed By: labath, xiaobai Subscribers: emaste, mgorny, arichardson, eraman, MaskRay, jdoerfert, labath, davide, teemperor, aprantl, erik.pilkington, jfb, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D61235 llvm-svn: 361987
* Clean up DWARFDebugInfoEntryFangrui Song2019-05-292-106/+0
| | | | llvm-svn: 361962
* Revert "D11003: Tolerate DWARF compile unit without filename."Pavel Labath2019-05-291-13/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: This code is modifying a support file list after it has been created. This makes it hard to share the file list between type units and compile units in DWARF. It's not a total showstopper, but supporting this while also sharing the lists would make things more complicated. Given that this was added to support a project which never fully materialised, and that even back then there were some concerns about the correctness of this approach (according to D11003#200772 the compile unit name is not guaranteed to be the first one in the support file list), I think we should just delete this workaround. Reviewers: clayborg, tberghammer, dsrbecky Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D62517 llvm-svn: 361948
* [CMake] Remove lldb-server from LLDB.frameworkStefan Granitz2019-05-291-4/+0
| | | | | | | | | | | | | | | | Summary: The LLDB test suite doesn't need lldb-server in the framework bundle anymore. Reviewers: JDevlieghere, jasonmolenda, xiaobai Reviewed By: JDevlieghere Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62474 llvm-svn: 361947
* [CMake] LLDB.framework tools handlingStefan Granitz2019-05-2911-19/+83
| | | | | | | | | | | | | | | | | | | | Summary: Modify the way LLDB.framework tools are collected. This allows for better fine-tuning of the install behavior downstream. Each target calls `lldb_add_to_framework()` individually. When entering the function, the target exists and we can tweak its very own post-build and install steps. This was not possible with the old `LLDB_FRAMEWORK_TOOLS` approach. No function change otherwise. This is a reduced follow-up from the proposal in D61952. Reviewers: xiaobai, compnerd, JDevlieghere Reviewed By: JDevlieghere Subscribers: clayborg, friss, ki.stfu, mgorny, lldb-commits, labath, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D62472 llvm-svn: 361946
* DWARFASTParserClang: Unify compilation unit language handlingPavel Labath2019-05-291-8/+5
| | | | | | | | | | | | | | | | | | Summary: The function was not being consistent in how it retrieved the language of the current compile unit. Sometimes it did so from the lldb CU object, and sometimes from the DWARF die. This patch unifies the handling on the latter. The reason for choosing the DWARF method is because I'd eventually like to stop creating lldb CUs for dwarf type units (and so this code needs to would need to work without them). Reviewers: clayborg, JDevlieghere, aprantl Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D62481 llvm-svn: 361939
* DWARF: Fix address range support in mixed 4+5 scenarioPavel Labath2019-05-297-94/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: debug_ranges got renamed to debug_rnglists in DWARF 5. Prior to this patch lldb was just picking the first section it could find in the file, and using that for all address ranges lookups. This is not correct in case the file contains a mixture of compile units with various standard versions (not a completely unlikely scenario). In this patch I make lldb support reading from both sections simulaneously, and decide the correct section to use based on the version number of the compile unit. SymbolFileDWARF::DebugRanges is split into GetDebugRanges and GetDebugRngLists (the first one is renamed mainly so we can catch all incorrect usages). I tried to structure the code similarly to how llvm handles this logic (hence DWARFUnit::FindRnglistFromOffset/Index), but the implementations are still relatively far from each other. Reviewers: JDevlieghere, aprantl, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D62302 llvm-svn: 361938
* build: only search for the needed python typeSaleem Abdulrasool2019-05-291-67/+23
| | | | | | | | | | Windows has different types of runtime libraries which are ABI incompatible with one another. This requires that the debug build of lldb link against the debug build of python. Adjust the python search to search for only the required type of python. This permits building a release build of lldb against just the release build of python. llvm-svn: 361915
* Fix IPv6 support on lldb-server platformAntonio Afonso2019-05-286-87/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a general fix for the ConnectionFileDescriptor class but my main motivation was to make lldb-server working with IPv6. The connect URI can use square brackets ([]) to wrap the interface part of the URI (e.g.: <scheme>://[<interface>]:<port>). For IPv6 addresses this is a must since its ip can include colons and it will overlap with the port colon otherwise. The URIParser class parses the square brackets correctly but the ConnectionFileDescriptor doesn't generate them for IPv6 addresses making it impossible to connect to the gdb server when using this protocol. How to reproduce the issue: ``` $ lldb-server p --server --listen [::1]:8080 ... $ lldb (lldb) platform select remote-macosx (lldb) platform connect connect://[::1]:8080 (lldb) platform process -p <pid> error: unable to launch a GDB server on 'computer' ``` The server was actually launched we were just not able to connect to it. With this fix lldb will correctly connect. I fixed this by wrapping the ip portion with []. Reviewers: labath Reviewed By: labath Subscribers: xiaobai, mgorny, jfb, lldb-commits, labath Tags: #lldb Differential Revision: https://reviews.llvm.org/D61833 llvm-svn: 361898
* [SymbolFileDWARF] Remove unused member (NFC)Jonas Devlieghere2019-05-282-4/+2
| | | | | | Removes the unused debug line instance. llvm-svn: 361886
* Fix 'warning: suggest explicit braces to avoid ambiguous ‘else’ ↵Alexandre Ganea2019-05-281-10/+20
| | | | | | | [-Wdangling-else]' with GCC 7.3 See: https://github.com/google/googletest/issues/1119 llvm-svn: 361862
* Fix 'warning: format specifies type 'int' but the argument has type 'MIuint' ↵Alexandre Ganea2019-05-281-1/+1
| | | | | | (aka 'unsigned long long') [-Wformat]' with Clang 8.0 llvm-svn: 361861
* [DWARFExpression] Remove ctor that takes just a compile unit.Jonas Devlieghere2019-05-288-160/+73
| | | | | | | | | | | | | | | | Like many of our DWARF classes, the DWARFExpression can be initialized in several ways. One such way was through a constructor that takes just the compile unit. This constructor is used to initialize both empty DWARFExpressions, and DWARFExpression that will be populated later. To make the distinction more clear, I changed the constructor to a default constructor and updated its call sites. Where the DWARFExpression was being populated later, I replaced that with a call to the copy assignment constructor. Differential revision: https://reviews.llvm.org/D62425 llvm-svn: 361849
* [CMake] Folder structure for generated Xcode project to cover more targetsStefan Granitz2019-05-2816-6/+32
| | | | llvm-svn: 361799
* DWARFDebugArangeSet: Remove references to SymbolFileDWARFPavel Labath2019-05-272-7/+4
| | | | | | | This class does not depend on SymbolFileDWARF. Instead, include more appropriate low-level headers. llvm-svn: 361765
* XFAIL prefer-debug-over-eh-frame.test on darwinPavel Labath2019-05-271-1/+2
| | | | | | | | | | | | | debug_frame does not seem to work on darwin, so there is nothing to prefer. Adding `-g` to the compiler command line is enough to get the __debug_frame section added to the dsym file. Though lldb then finds the section, and correctly assigns the section type to it, this does not seem to be enough to get lldb to actually use this section for unwinding. llvm-svn: 361760
* DWARF: Add a simple test exercising debug_loc parsingPavel Labath2019-05-271-0/+117
| | | | llvm-svn: 361759
* FuncUnwinders: prefer debug_frame over eh_framePavel Labath2019-05-273-4/+65
| | | | | | | | | | | | | | | The two sections usually contain the same information, and we rarely have both kinds of entries for a single function. However, in theory the debug_frame plan can be more complete, whereas eh_frame is only required to be correct at places where exceptions can be thrown. Reviewers: jasonmolenda, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D62374 llvm-svn: 361758
* DWARF: Remove cu_idx variables from parsing functionsPavel Labath2019-05-274-46/+31
| | | | | | | | These variables were useful when looking up the compile unit index required a binary search. Now that we can look up a compile unit index in constant time, they are no longer needed. llvm-svn: 361754
* Revert Xcode scheme changes from 361675 Greg Clayton2019-05-241-7/+1
| | | | llvm-svn: 361676
* Cleanup fixed form sizes.Greg Clayton2019-05-2411-162/+87
| | | | | | | | | | | | | The fix form sizes use to have two arrays: one for 4 byte addresses and in for 8 byte addresses. The table had an issue where DW_FORM_flag_present wasn't being represented as a fixed size form because its actual size _is_ zero and zero was used to indicate the form isn't fixed in size. Any code that needed to quickly access the DWARF had to get a FixedFormSizes instance using the address byte size. This fix cleans things up by adding a DWARFFormValue::GetFixedSize() both as a static method and as a member function on DWARFFormValue. It correctly can indicate if a form size is zero. This cleanup is a precursor to a follow up patch where I hope to speed up DWARF parsing. I verified performance doesn't regress by loading hundreds of DWARF files and setting a breakpoint by file and line and by name in files that do not have DWARF indexes. Performance remained consistent between the two approaches. Differential Revision: https://reviews.llvm.org/D62416 llvm-svn: 361675
* [Target] Make Processes' GetLanguageRuntime non-virtualAlex Langford2019-05-241-5/+4
| | | | llvm-svn: 361673
* [DWARFExpression] Remove commented-out code (NFC)Jonas Devlieghere2019-05-241-119/+0
| | | | llvm-svn: 361672
* [Process] Clean up some logic around LanguageRuntimesAlex Langford2019-05-241-7/+10
| | | | llvm-svn: 361666
* [FuncUnwinders] Use "symbol file" unwind plans for unwindingPavel Labath2019-05-248-9/+89
| | | | | | | | | | | | | | | | | Summary: Previous patch (r360409) introduced the "symbol file unwind plan" concept, but that plan wasn't used for unwinding yet. With this patch, we start to consider the new plan as a possible strategy for both synchronous and asynchronous unwinding. I also add a test that asserts that unwinding via breakpad STACK CFI info works end-to-end. Reviewers: jasonmolenda, clayborg Subscribers: lldb-commits, amccarth, markmentovai Differential Revision: https://reviews.llvm.org/D61853 llvm-svn: 361618
OpenPOWER on IntegriCloud