summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Move common functionality from processwindows into processdebuggerAaron Smith2019-06-245-452/+716
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change extracts functionalities from processwindows into a introduced processdebugger that can be reused in native process debugging. The main reason is that the native process debugging can't directly be based on processwindows or be implemented as a pass-through to this plugin since the plugin has ties to Target and Process classes that are needed in host debugging but not necessary in native debugging. Reviewers: labath, Hui, jfb, clayborg, amccarth Reviewed By: labath Subscribers: amccarth, dexonsmith, mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D63166 llvm-svn: 364210
* [lit] Deduplicate logic in toolchain.pyJonas Devlieghere2019-06-211-6/+4
| | | | | | No need to compute the path of lit-lldb-init twice. llvm-svn: 364113
* [lit] Make lit-lldb-init configurable by CMakeJonas Devlieghere2019-06-213-2/+6
| | | | | | | | | | This makes the `lit-lldb-init` file configurable by CMake. This matters to us downstream in Swift, where we want to set environment variables with the `env` command for every test. Differential revision: https://reviews.llvm.org/D63679 llvm-svn: 364112
* [Target] Decouple ObjCLanguageRuntime from LanguageRuntimeAlex Langford2019-06-2116-65/+135
| | | | | | | | | | | | Summary: ObjCLanguageRuntime was being pulled into LanguageRuntime because of Breakpoint Preconditions. If we move BreakpointPrecondition out of Breakpoint, we can extend the LanguageRuntime plugin interface so that LanguageRuntimes can give us a BreakpointPrecondition for exceptions. Differential Revision: https://reviews.llvm.org/D63181 llvm-svn: 364098
* [lldb] [Process] Introduce common helpers to split/recombine YMM dataMichal Gorny2019-06-213-58/+32
| | | | | | | | | | | | | | | | | Introduce two common helpers to take care of splitting and recombining YMM registers to/from XSAVE-like data. Since FreeBSD, Linux and NetBSD all use XSAVE-like data structures but with potentially different field layouts, the function takes two pointers -- to XMM register and to YMM high bits, and copies the data from/to YMMReg type. While at it, remove support for big endian. To mine and Pavel Labath's combined knowledge, there is no such thing on x86. Furthermore, assuming that the YMM register data would be swapped for big endian seems to be a weird assumption. Differential Revision: https://reviews.llvm.org/D63610 llvm-svn: 364042
* [unittests] Simplify CMakeLists with object libraryTatyana Krasnukha2019-06-211-19/+2
| | | | | | | | The solution suggested by Chris Bieneman works for all versions of CMake. Differential Revision: https://reviews.llvm.org/D63544 llvm-svn: 364035
* DWARF: Add "dwo_num" field to the DIERef classPavel Labath2019-06-2124-138/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When dwo support was introduced, it used a trick where debug info entries were referenced by the offset of the compile unit in the main file, but the die offset was relative to the dwo file. Although there was some elegance to it, this representation was starting to reach its breaking point: - the fact that the skeleton compile unit owned the DWO file meant that it was impossible (or at least hard and unintuitive) to support DWO files containing more than one compile unit. These kinds of files are produced by LTO for example. - it made it impossible to reference any DIEs in the skeleton compile unit (although the skeleton units are generally empty, clang still puts some info into them with -fsplit-dwarf-inlining). - (current motivation) it made it very hard to support type units placed in DWO files, as type units don't have any skeleton units which could be referenced in the main file This patch addresses this problem by introducing an new "dwo_num" field to the DIERef class, whose purpose is to identify the dwo file. It's kind of similar to the dwo_id field in DWARF5 unit headers, but while this is a 64bit hash whose main purpose is to catch file mismatches, this is just a smaller integer used to indentify a loaded dwo file. Currently, this is based on the index of the skeleton compile unit which owns the dwo file, but it is intended to be eventually independent of that (to support the LTO use case). Simultaneously the cu_offset is dropped to conserve space, as it is no longer necessary. This means we can remove the "BaseObjectOffset" field from the DWARFUnit class. It also means we can remove some of the workarounds put in place to support the skeleton-unit+dwo-die combo. More work is needed to remove all of them, which is out of scope of this patch. Reviewers: JDevlieghere, clayborg, aprantl Subscribers: mehdi_amini, dexonsmith, arphaman, lldb-commits Differential Revision: https://reviews.llvm.org/D63428 llvm-svn: 364009
* Revert "Fix a crash in option parsing."Davide Italiano2019-06-203-9/+0
| | | | | | This fails on the bots around 1/10 of the time. llvm-svn: 363999
* [unittests] Use object library if cmake supports itTatyana Krasnukha2019-06-201-2/+19
| | | | | | Differential Revision: https://reviews.llvm.org/D63544 llvm-svn: 363933
* [lldb] [Process/NetBSD] Remove unnecessary register buffer abstractionMichal Gorny2019-06-204-117/+12
| | | | | | | | | | | | | | | | | Remove most of the abstraction over ptrace() register operations, as it has little value and introduces more code than it saves. Instead, leave a single ptrace() wrapper method and call it directly from ReadRegisterSet() and WriteRegisterSet() with correct PT_* request and buffer. Remove the remaining direct ReadGPR() and WriteGPR() invocations with ReadRegisterSet() and WriteRegisterSet(). Cleanup suggested by Pavel Labath in D63545. Differential Revision: https://reviews.llvm.org/D63594 llvm-svn: 363923
* Fix -Wmismatched-tags introduced in r363910Pavel Labath2019-06-203-4/+1
| | | | | | | | That commit changed DIERef from a struct to a class, but did not update the forward-declarations. This fixes one forward-declaration, and removes other (unused) decls. llvm-svn: 363915
* DWARF: Provide accessors to DIERef fieldsPavel Labath2019-06-209-24/+65
| | | | | | | | | | | | | | | | | | | | | | Summary: Instead of accessing the fields directly, use accessor functions to provide access to the DIERef components. This allows us to decouple the external interface, from the internal representation. The external interface can use llvm::Optional and similar goodies, while the data can still be stored internally in a more compact representation. I also document the purpose of the existing DIERef fields. The main motivation for this change is a need to introduce an additional field to the DIERef class, but I believe the change has its own merit. Reviewers: JDevlieghere, aprantl, clayborg Subscribers: arphaman, lldb-commits Differential Revision: https://reviews.llvm.org/D63400 llvm-svn: 363910
* [Process] Remove unused field from HistoryThreadAlex Langford2019-06-1910-49/+17
| | | | | | | | | | | | | | Summary: These fields are unused and have been since their inception, from what I can tell. Reviewers: compnerd, JDevlieghere, davide, labath Subscribers: kubamracek, lldb-commits Differential Revision: https://reviews.llvm.org/D63357 llvm-svn: 363881
* [lldb] [Process/NetBSD] Fix constructor after r363707Michal Gorny2019-06-191-1/+1
| | | | llvm-svn: 363827
* [lldb] [Process/NetBSD] Remove unnecessary FPU presence checks for x86_64Michal Gorny2019-06-191-53/+1
| | | | | | | | | | Remove the checks for FPU presence, FXSAVE support and usage from the code for x86_64. Those are always true for this architecture, and in fact are hardcoded to true inside NetBSD kernel. Differential Revision: https://reviews.llvm.org/D63554 llvm-svn: 363823
* Specify log level for CMake messages (less stderr)Stefan Granitz2019-06-192-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Specify message levels in CMake. Prefer STATUS (stdout). As the default message mode (i.e. level) is NOTICE in CMake, more then necessary messages get printed to stderr. Some tools, noticably ccmake treat this as an error and require additional confirmation and re-running CMake's configuration step. This commit specifies a mode (either STATUS or WARNING or FATAL_ERROR) instead of the default. * I used `csearch -f 'llvm-project/.+(CMakeLists\.txt|cmake)' -l 'message\("'` to find all locations. * Reviewers were chosen by the most common authors of specific files. If there are more suitable reviewers for these CMake changes, please let me know. Patch by: Christoph Siedentop Reviewers: zturner, beanz, xiaobai, kbobyrev, lebedev.ri, sgraenitz Reviewed By: sgraenitz Subscribers: mgorny, lebedev.ri, #sanitizers, lldb-commits, llvm-commits Tags: #sanitizers, #lldb, #llvm Differential Revision: https://reviews.llvm.org/D63370 llvm-svn: 363821
* Stabilize TestGdbRemoteLibrariesSvr4SupportPavel Labath2019-06-191-3/+6
| | | | | | | | | | | | | | on some systems this test fails because the two methods it uses to cross-reference the data don't match in the case of the vdso module. The "read from /proc/%pid/maps" method returns "[vdso]", while the method which reads it from the linker rendezvous structures returns "linux-vdso.so.1". Neither of the two names match any actual file. This restricts the test to only consider the libraries that we ourselves have added to the test, minimizing the impact of system dependencies that we cannot control. llvm-svn: 363772
* Fix a dangling StringRef in FileCollectorPavel Labath2019-06-191-1/+1
| | | | | | FileSpec::GetPath returns a temporary std::string. llvm-svn: 363770
* DWARF: Make DIERefs always validPavel Labath2019-06-1914-124/+101
| | | | | | | | | | | | | | | | | | | | | Summary: This patch makes the DIERef class always valid by default constructor and operator bool. This allows one to express the validity of a DIERef in the type system. Places which are working with potentially-invalid DIERefs have been updated to use Optional<DIERef> instead. The constructor taking a DWARFFormValue was not needed, as all places which were constructing a DIERef this way were immediately converting it into a DWARFDIE or a user_id. This can be done without constructing an intermediate DIERef. Reviewers: JDevlieghere, clayborg, aprantl Subscribers: arphaman, lldb-commits Differential Revision: https://reviews.llvm.org/D63399 llvm-svn: 363767
* Add ReadCStringFromMemory for faster string readsAntonio Afonso2019-06-185-7/+136
| | | | | | | | | | | | | | | | | | | | | | | Summary: This is the fifth patch to improve module loading in a series that started here (where I explain the motivation and solution): D62499 Reading strings with ReadMemory is really slow when reading the path of the shared library. This is because we don't know the length of the path so use PATH_MAX (4096) and these strings are actually super close to the boundary of an unreadable page. So even though we use process_vm_readv it will usually fail because the read size spans to the unreadable page and we then default to read the string word by word with ptrace. This new function is very similar to another ReadCStringFromMemory that already exists in lldb that makes sure it never reads cross page boundaries and checks if we already read the entire string by finding '\0'. I was able to reduce the GetLoadedSharedLibraries call from 30ms to 4ms (or something of that order). Reviewers: clayborg, xiaobai, labath Reviewed By: labath Subscribers: emaste, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62503 llvm-svn: 363750
* Implement xfer:libraries-svr4:read packetAntonio Afonso2019-06-1816-4/+362
| | | | | | | | | | | | | | | | | | | Summary: This is the fourth patch to improve module loading in a series that started here (where I explain the motivation and solution): D62499 Implement the `xfer:libraries-svr4` packet by adding a new function that generates the list and then in Handle_xfer I generate the XML for it. The XML is really simple so I'm just using string concatenation because I believe it's more readable than having to deal with a DOM api. Reviewers: clayborg, xiaobai, labath Reviewed By: labath Subscribers: emaste, mgorny, srhines, krytarowski, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62502 llvm-svn: 363707
* [Reproducers] Make reproducer relocatableJonas Devlieghere2019-06-187-11/+32
| | | | | | | | | | | | | | Before this patch, reproducers weren't relocatable. The reproducer contained hard coded paths in the VFS mapping, as well in the yaml file listing the different input files for the command interpreter. This patch changes that: - Use relative paths for the DataCollector. - Use an overlay prefix for the FileCollector. Differential revision: https://reviews.llvm.org/D63467 llvm-svn: 363697
* Fix windows build for r363357Pavel Labath2019-06-181-5/+1
| | | | | | | | MSVC has trouble referencing the protected Compare class from from the friend Entry operator<. Just delete that operator, as it's used only once. llvm-svn: 363653
* Add color to the default thread and frame format.Jonas Devlieghere2019-06-173-14/+21
| | | | | | | | | | | | | | Now that we correctly ignore ASCII escape sequences when colors are disabled (r362240), I'd like to change the default frame and thread format to include color in their output, in line with the syntax highlighting that Raphael added a while ago. This patch adds highlighting for the stop reason, the file, line and column number. With colors disabled, this of course is a no-op. Differential revision: https://reviews.llvm.org/D62743 llvm-svn: 363608
* [lldb] [test] Extend D55859 symbols.enable-external-lookup=false for more ↵Jan Kratochvil2019-06-1716-6/+48
| | | | | | | | | | | | | | | | | | | | | | testcases D55859 <https://reviews.llvm.org/D55859> has no effect for some of the testcases so this patch extends it even for (all?) other testcases known to me. LLDB was failing when LLDB prints errors reading system debug infos (`*-debuginfo.rpm`, DWZ-optimized) which should never happen as LLDB testcases should not be affected by system debug infos. `lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template` is using only SB API which does not expose `ModuleList` so I had to call `HandleCommand()` there. `lldb-test.cpp` could also use `HandleCommand` and then there would be no need for `ModuleListProperties::SetEnableExternalLookup()` but I think it is cleaner with API and not on based on text commands. Differential Revision: https://reviews.llvm.org/D63339 llvm-svn: 363567
* [lldb] [test] Watchpoint tests can be always run as root on NetBSDMichal Gorny2019-06-171-0/+2
| | | | llvm-svn: 363551
* [lldb] [test] Skip watchpoint tests on NetBSD if userdbregs is disabledMichal Gorny2019-06-171-0/+25
| | | | | | | | | | | Skip watchpoint tests if security.models.extensions.user_set_dbregs is disabled. This indicates that unprivileged processes are not allowed to write to debug registers which is a prerequisite for using hardware watchpoints. Differential Revision: https://reviews.llvm.org/D63380 llvm-svn: 363536
* DWARF: Avoid storing DIERefs in long-lived containersPavel Labath2019-06-174-51/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A user_id_t carries the same information as a DIERef, but it takes up less space. Furthermore, DIERef::operator<'s implementation is very questionable, as it does not take the cu_offset and section fields into account. Using just the die offset was correct in the days when all debug info lived in a single section, but since we started supporting DWO debug info, this was no longer true. The comparison operator could be fixed, but it seems like using the user_id_t for these purposes is a better idea overall. I think this did not cause any bugs, because the only place the comparison operator was used is in m_function_scope_qualified_name_map, and this one is local to a dwo file, but I am not 100% sure of that. Reviewers: clayborg, JDevlieghere Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D63322 llvm-svn: 363528
* Implement GetSharedLibraryInfoAddressAntonio Afonso2019-06-1410-167/+487
| | | | | | | | | | | | | | | | | | | | | Summary: This is the third patch to improve module loading in a series that started here (where I explain the motivation and solution): D62499 Add functions to read the r_debug location to know where the linked list of loaded libraries are so I can generate the `xfer:libraries-svr4` packet. I'm also using this function to implement `GetSharedLibraryInfoAddress` that was "not implemented" for linux. Most of this code was inspired by the current ds2 implementation here: https://github.com/facebook/ds2/blob/master/Sources/Target/POSIX/ELFProcess.cpp. Reviewers: clayborg, xiaobai, labath Reviewed By: clayborg, labath Subscribers: emaste, krytarowski, mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62501 llvm-svn: 363458
* Don't try to parse ObjC method if CU isn't ObjCGreg Clayton2019-06-141-20/+24
| | | | | | | | Improve manual indexing performance when indexing non objective C code. Differential Revision: https://reviews.llvm.org/D63171 llvm-svn: 363441
* Remove stale comment and disabled code (NFC)Jonas Devlieghere2019-06-141-19/+0
| | | | llvm-svn: 363438
* Python 3: decode string as utf-8 to avoid type mismatch.Adrian Prantl2019-06-141-5/+5
| | | | | | | | rdar://problem/51464644 Differential Revision: https://reviews.llvm.org/D63311 llvm-svn: 363413
* Make crashlog.py less noisyAdrian Prantl2019-06-141-9/+27
| | | | | | | | | | | For end-users there is no point in printing dSYM load errors for system frameworks, since they will all fail and there's nothing they can do about it. This patch hides them by default and shows them when --verbose is present. Differential Revision: https://reviews.llvm.org/D63310 llvm-svn: 363412
* EditlineTest: Improve error messagePavel Labath2019-06-142-8/+7
| | | | | | | | | | This test seems to occasionally fail because editline returns a different number of lines. Rewrite the message in such a way that we also see the actual lines when that happens (and not just their count). Also, clean up the dependencies of the test while I'm in there. llvm-svn: 363404
* DWARF: port debug_ranges/rnglists over to DWARFContextPavel Labath2019-06-146-37/+35
| | | | llvm-svn: 363400
* DWARF: Remove unused includes from DWARFDebugAranges.h/cppPavel Labath2019-06-142-15/+3
| | | | llvm-svn: 363382
* Have DWARFUnit store a *reference* to SymbolFileDWARFPavel Labath2019-06-1417-119/+86
| | | | | | | | | | | | Previously it was storing a *pointer*, which left open the possibility of this pointer being null. We never made use of that possibility (it does not make sense), and most of the code was already assuming that. However, there were a couple of null-checks scattered around the code. This patch replaces the reference with a pointer, making the non-null-ness explicit, and removes the remaining null-checks. llvm-svn: 363381
* DWARFIndex: s/ReportInvalidDIEOffset/ReportInvalidDIERefPavel Labath2019-06-147-27/+17
| | | | | | | | | | | | In a dwo/debug_types world, the die offset is not enough to uniquely idendify a debug info entry. Pass the the entire DIERef object instead. This is technically NFC, because only AppleIndex implemented this method (and there, the die offset *is* enough for unique identification). However, this makes the code simpler, and simplifies some of the follow-up patches. llvm-svn: 363373
* [C++20] add Basic consteval specifierGauthier Harnisch2019-06-142-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: this revision adds Lexing, Parsing and Basic Semantic for the consteval specifier as specified by http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1073r3.html with this patch, the consteval specifier is treated as constexpr but can only be applied to function declaration. Changes: - add the consteval keyword. - add parsing of consteval specifier for normal declarations and lambdas expressions. - add the whether a declaration is constexpr is now represented by and enum everywhere except for variable because they can't be consteval. - adapt diagnostic about constexpr to print constexpr or consteval depending on the case. - add tests for basic semantic. Reviewers: rsmith, martong, shafik Reviewed By: rsmith Subscribers: eraman, efriedma, rnkovacs, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61790 llvm-svn: 363362
* Make UniqueCStringMap work with non-default-constructible types and other ↵Pavel Labath2019-06-145-101/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | improvements/cleanups Summary: The motivation for this was me wanting to make the validity of dwarf DIERefs explicit (via llvm::Optional<DIERef>). This meant that the class would no longer have a default constructor. As the DIERef was being stored in a UniqueCStringMap, this meant that this container (like all standard containers) needed to work with non-default-constructible types too. This part is achieved by removing the default constructors for the map entry types, and providing appropriate comparison overloads so that we can search for map entries without constructing a dummy entry. While doing that, I took the opportunity to modernize the code, and add some tests. Functions that were completely unused are deleted. This required also some changes in the Symtab code, as it was default constructing map entries, which was not impossible even though its value type was default-constructible. Technically, these changes could be avoided with some SFINAE on the entry type, but I felt that the code is cleaner this way anyway. Reviewers: JDevlieghere, sgraenitz Subscribers: mgorny, aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D63268 llvm-svn: 363357
* Fixed typos in Log.hJonas Devlieghere2019-06-141-2/+2
| | | | | | | | Patch by: Yuya Fujita Differential revision: https://reviews.llvm.org/D63241 llvm-svn: 363356
* [NFC] Replace a plugin header with a non-plugin headerAlex Langford2019-06-131-1/+1
| | | | llvm-svn: 363338
* [CMake] Fix generated Xcode-project ignoring output directory setting for ↵Stefan Granitz2019-06-131-0/+6
| | | | | | | | | LLDB.framework Other generators honor the `LIBRARY_OUTPUT_DIRECTORY` target property, but apparently Xcode doesn't. So we call `set_output_directory()` as `llvm_add_library()` would do and this works. Note that `LIBRARY_OUTPUT_DIRECTORY` is still necessary, because it's used to store and read the target's absolute build directory (while `LLDB_FRAMEWORK_BUILD_DIR` is relative!). llvm-svn: 363280
* [CMake] Fix lldb-dotest for single-config generators in standalone buildsStefan Granitz2019-06-131-1/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D62859 llvm-svn: 363279
* [CMake] Add fallbacks for copying clang-resource-headers to LLDB.framework ↵Stefan Granitz2019-06-131-3/+25
| | | | | | in standalone builds llvm-svn: 363271
* DWARF: Don't create lldb CompileUnits for DWARF type unitsPavel Labath2019-06-1313-199/+355
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Type units don't represent actual compilations and a lot of the operations that we do with lldb compile units (getting their line tables, variables, etc.) don't make sense for them. There is also a lot more of them (sometimes over 100x), so making them more lightweight pays off. The main change in this patch is that we stop creating lldb CompileUnits for DWARF type units. The trickiest part here is that the SymbolFile interface requires that we assign consecutive sequence IDs to the compile units we create. As DWARF type and compile units can come in any order (in v5), this means we can no longer use 1-1 mapping between DWARF and lldb compile units. Instead I build a translation table between the two indices. To avoid pessimizing the case where there are no type units, I build the translation table only in case we have at least one type unit. Additionaly, I also tried to strenghted type safete by replacing DWARFUnit with DWARFCompileUnit where applicable. Though that was not stricly necessary, I found it a good way to ensure that the transformations I am doing here make sense. In the places where I was changing the function signatures, and where it was obvious that the objects being handled were not null, I also replaced pointers with references. There shouldn't be any major functional change with this patch. The only change I observed is that now the types in the type units will not be parsed when one calls Module::ParseAllDebugSymbols, unless they are referenced from other compile units. This makes sense, given how ParseAllDebugSymbols is implemented (it iterates over all compile units), and it only matters for one hand-writted test where I did not bother to reference the types from the compile units (which I now do). Reviewers: clayborg, JDevlieghere, aprantl Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D63005 llvm-svn: 363250
* [Reproducers] Remove call to lldb_private::GetVersion()Jonas Devlieghere2019-06-131-2/+1
| | | | | | | | Utility doesn't link against lldbBase so we cannot call GetVersion in keep. I already added a string member m_version to deal with that, but the call was still there. llvm-svn: 363228
* [Reproducers] Include lldb version in the reproducer rootJonas Devlieghere2019-06-134-5/+43
| | | | | | | | | | | Generally, reproducers are rev-locked to the version of LLDB, so it's valuable to have the LLDB version in the reproducer. For now I just want the information to be present, without enforcing it, but I envision emitting a warning during replay in the future. Differential revision: https://reviews.llvm.org/D63229 llvm-svn: 363225
* [Reproducers] Simplify providers with nested Info struct (NFC)Jonas Devlieghere2019-06-128-52/+41
| | | | | | | | | This replaces the `info` typedef with a nested struct named Info. This means we now have FooProvider and FooProvider::Info, instead of two related but separate classes FooProvider and FooInfo. This change is mostly cosmetic. llvm-svn: 363211
* Re-land r363103 ("When reading ObjC class table, use new SPI if it is avail")Jason Molenda2019-06-121-4/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | with a call to snprintf() to find the size of the formatted string, malloc memory, then snprintf again to format it into the buffer, instead of calling asprintf. Orig commit msg: When reading ObjC class table, use new SPI if it is avail In the latest OS betas, the objc runtime has a special interface for the debugger, class_getNameRaw(), instead of the existing class_getName(), which will return class names in their raw, unmangled (in the case of swift) form. When lldb can access the unmangled names of classes, it won't need to fetch them out of the inferior process after we run our "get the objc class table" expression. If the new interface is absent (debugging a process on an older target), lldb will fall back to class_getName and reading any class names that it got back in demangled form, at a bit of a performance cost on the first expression. <rdar://problem/50688054> llvm-svn: 363206
OpenPOWER on IntegriCloud