summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
AgeCommit message (Collapse)Author
2025-05-30[LLDB][Platform Linux] Flip uid and pid in get signal description (#142200)Jacob Lalonde
Despite a great review from @labath, I accidentally landed the signal with the UID and PID properties flipped. I was actually trying to write tests for this feature when I discovered it. This fixes that bug, and add a shell test that runs only on Nix systems.
2025-05-30[lldb] Fix Linux core file tests hanging on Windows (#142143)David Spickett
After https://github.com/llvm/llvm-project/pull/141670, TestLinuxCore.py was timing out on our Windows on Arm bot. Non-Linux core files were ok, as were Linux core files unless it was ppc64le, riscv64 or loongarch. I eventually noticed that it was attempting to create PlatformLinux many times before trying PlatformAndroid, PlatformMac etc., which it should never need to do. The tests passed on a Linux host too, to add to the mystery. Turns out, all I needed to do was mark those architectures as supported in the PlatformLinux constructor. If they're not listed there we get stuck here: ``` // Wait for a stopped event since we just posted one above... printf("waiting for process to stop...\n"); lldb::EventSP event_sp; StateType state = WaitForProcessToStop(std::nullopt, &event_sp, true, listener_sp, nullptr, true, SelectMostRelevantFrame); printf("process stopped\n"); ``` Waiting for a stop event that never comes, because it appears we try to treat the core as a real process? ``` DynamicLoaderPOSIXDYLD::virtual DynamicLoaderPOSIXDYLD::DidAttach pid 28147 executable '<null executable>', load_offset 0xffffffffffffffff <...> Process::ShouldBroadcastEvent (000002ABC43FF4A0) Restarting process from state: stopped Process::PrivateResume() m_stop_id = 1, public state: unloaded private state: stopped Process::PrivateResume() got an error "error: elf-core does not support resuming processes". Process::ShouldBroadcastEvent (000002ABC43FF4A0) => new state: stopped, last broadcast state: invalid - NO ``` Some actionable feedback here would be nice, but all I care about for now is that the tests run again. I have not added riscv32 as that appears to only be supported for Darwin at the moment (I expect someone will get burned by this when it is). I think debug on these architectures worked if they were also the host arch, if someone tried to remote debug them, I think it would have failed.
2025-05-29[LLDB] Add ifndef to platform linux (#141971)Jacob Lalonde
Another iteration of fixes for #141670. Platform linux can be used by other platforms, so we need to supply the signal values if they're not defined. Values are from the [manpage](https://man7.org/linux/man-pages/man7/signal.7.html)
2025-05-29Reapply "[LLDB][ELF Core] Support all the Generic (Negative) SI Codes." ↵Jacob Lalonde
(#141670) After some debugging, I found out ProcessELFCore never updates the platform. I've updated ProcessElfCore to set the arch and platform before we parse the Notes.
2025-05-27Revert "[LLDB][ELF Core] Support all the Generic (Negative) SI Codes." (#141645)Jacob Lalonde
Reverts llvm/llvm-project#140150 Broke the Darwin tests, but they pass on Linux. Reverting to make the build healthy while I investigate
2025-05-27[LLDB][ELF Core] Support all the Generic (Negative) SI Codes. (#140150)Jacob Lalonde
Recently, I was on an issue that generated a large number of Coredumps, and every time in both LLDB and GDB the signal was just `SIGSEGV`. This was frustrating because we would expect a `SIGSEGV` to have an address, or ideally even bounds. After some digging I found the `si_code` consistently was -6. With some help from [@cdown](https://github.com/cdown), we found neither LLDB or GDB supports the si_codes sent from [user space](https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/siginfo.h#L185). Excerpted from the sigaction man page. ``` For a regular signal, the following list shows the values which can be placed in si_code for any signal, along with the reason that the signal was generated. ``` For which I added all of the si_codes to every Linux signal. Now for the Coredump that triggered this whole investigation we get the accurate and now very informative summary. <img width="524" alt="image" src="https://github.com/user-attachments/assets/5149f781-ef21-4491-a077-8fac862fbc20" /> Additionally from @labath's suggestion to move this to platform and leverage the existing `getSiginfo()` call on thread, we can now inspect the siginfo struct itself via `thread siginfo`. Giving us another towards GDB parity on elf cores.
2025-03-19[lldb] Use UnwindPlan::Row as values (#131150)Pavel Labath
In most places, the rows are copied anyway (because they are generated by cumulating modifications) immediately after adding them to the unwind plans. In others, they can be moved into the unwind plan. This lets us remove some backflip copies and make `const UnwindPlan` actually mean something. I've split this patch into two (and temporarily left both APIs) as this patch was getting a bit big. This patch covers all the interesting cases. Part two all about converting "architecture default" unwind plans from ABI and InstructionEmulation plugins.
2023-11-03[clang][NFC] Refactor `TagTypeKind` (#71160)Vlad Serebrennikov
This patch converts TagTypeKind into scoped enum. Among other benefits, this allows us to forward-declare it where necessary.
2023-10-24[lldb][AArch64][NFC] Fix typo in get trap handler functionDavid Spickett
2023-07-03[lldb][NFCI] TypeSystemClang::CreateStructForIdentifier should take a StringRefAlex Langford
This doesn't really use fast comparison or string uniqueness. In fact, all of the current callers pass an empty string for type_name. The only reason I don't remove it is because it looks like it is used downstream for swift. Differential Revision: https://reviews.llvm.org/D153810
2023-04-17[lldb] Add support for MSP430 in LLDB.Ilya Kuklin
Add MSP430 to the list of available targets, implement MSP430 ABI, add support for debugging targets with 16-bit address size. The update is intended for use with MSPDebug, a GDB server implementation for MSP430. Reviewed By: bulbazord, DavidSpickett Differential Revision: https://reviews.llvm.org/D146965
2023-04-17Revert "[lldb] Add support for MSP430 in LLDB."Anton Korobeynikov
This reverts commit 82c02b733c7736507a41a26bebd37d3f8e88bd4e. Apparently, the original patch was not rebased onto `main
2023-04-17[lldb] Add support for MSP430 in LLDB.Anton Korobeynikov
Add MSP430 to the list of available targets, implement MSP430 ABI, add support for debugging targets with 16-bit address size. The update is intended for use with MSPDebug, a GDB server implementation for MSP430. Reviewed By: bulbazord, DavidSpickett Differential Revision: https://reviews.llvm.org/D146965
2023-03-27Revert "[lldb] Move UnixSignals creation into Platform plugins"Alex Langford
This reverts commit ee232506b870ce5282cc4da5ca493d41d361feb3. As discussed in https://reviews.llvm.org/D146668 we'll find another way forward.
2023-03-20[lldb] Move UnixSignals creation into Platform pluginsAlex Langford
The high level goal of this change is to remove lldbTarget's dependency on lldbPluginProcessUtility. The reason for this existing dependency is so that we can create the appropriate UnixSignals object based on an ArchSpec. Instead of using the ArchSpec, we can instead take advantage of the Platform associated with the current Target. This is accomplished by adding a new method to Platform, CreateUnixSignals, which will create the correct UnixSignals object for us. We then can use `Platform::GetUnixSignals` and rely on that to give us the correct signals as needed. Differential Revision: https://reviews.llvm.org/D146263
2023-01-13Revert "[lldb] Add Debugger & ScriptedMetadata reference to ↵Med Ismail Bennani
Platform::CreateInstance" This reverts commit 2d53527e9c64c70c24e1abba74fa0a8c8b3392b1.
2023-01-12[lldb] Add Debugger & ScriptedMetadata reference to Platform::CreateInstanceMed Ismail Bennani
This patch is preparatory work for Scripted Platform support and does multiple things: First, it introduces new options for the `platform select` command and `SBPlatform::Create` API, to hold a reference to the debugger object, the name of the python script managing the Scripted Platform and a structured data dictionary that the user can use to pass arbitrary data. Then, it updates the various `Create` and `GetOrCreate` methods for the `Platform` and `PlatformList` classes to pass down the new parameter to the `Platform::CreateInstance` callbacks. Finally, it updates every callback to reflect these changes. Differential Revision: https://reviews.llvm.org/D139249 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-11-16Make CompilerType safeAdrian Prantl
When a process gets restarted TypeSystem objects associated with it may get deleted, and any CompilerType objects holding on to a reference to that type system are a use-after-free in waiting. Because of the SBAPI, we don't have tight control over where CompilerTypes go and when they are used. This is particularly a problem in the Swift plugin, where the scratch TypeSystem can be restarted while the process is still running. The Swift plugin has a lock to prevent abuse, but where there's a lock there can be bugs. This patch changes CompilerType to store a std::weak_ptr<TypeSystem>. Most of the std::weak_ptr<TypeSystem>* uglyness is hidden by introducing a wrapper class CompilerType::WrappedTypeSystem that has a dyn_cast_or_null() method. The only sites that need to know about the weak pointer implementation detail are the ones that deal with creating TypeSystems. rdar://101505232 Differential Revision: https://reviews.llvm.org/D136650
2022-03-14[lldb] Plumb process host architecture through platform selectionJonas Devlieghere
To allow us to select a different platform based on where the process is running, plumb the process host architecture through platform selection. This patch is in preparation for D121444 which needs this functionality to tell apart iOS binaries running on Apple Silicon vs on a remote iOS device. Differential revision: https://reviews.llvm.org/D121484
2022-02-03[lldb] Rename Logging.h to LLDBLog.h and clean up includesPavel Labath
Most of our code was including Log.h even though that is not where the "lldb" log channel is defined (Log.h defines the generic logging infrastructure). This worked because Log.h included Logging.h, even though it should. After the recent refactor, it became impossible the two files include each other in this direction (the opposite inclusion is needed), so this patch removes the workaround that was put in place and cleans up all files to include the right thing. It also renames the file to LLDBLog to better reflect its purpose.
2022-02-02[lldb] Convert "LLDB" log channel to the new APIPavel Labath
2022-01-27[lldb] [Platform] Support synthesizing siginfo_tMichał Górny
Support synthesizing the siginfo_t type from the Platform plugin. This type is going to be used by LLDB client to process the raw siginfo data received from lldb-server without the necessity of relying on target's debug info being present. Differential Revision: https://reviews.llvm.org/D117707
2021-11-16[lldb] Simplify specifying of platform supported architecturesPavel Labath
The GetSupportedArchitectureAtIndex pattern forces the use of complicated patterns in both the implementations of the function and in the various callers. This patch creates a new method (GetSupportedArchitectures), which returns a list (vector) of architectures. The GetSupportedArchitectureAtIndex is kept in order to enable incremental rollout. Base Platform class contains implementations of both of these methods, using the other method as the source of truth. Platforms without infinite stacks should implement at least one of them. This patch also ports Linux, FreeBSD and NetBSD platforms to the new API. A new helper function (CreateArchList) is added to simplify the common task of creating a list of ArchSpecs with the same OS but different architectures. Differential Revision: https://reviews.llvm.org/D113608
2021-11-11[lldb][AArch64] Add UnwindPlan for Linux sigreturnDavid Spickett
This adds a specific unwind plan for AArch64 Linux sigreturn frames. Previously we assumed that the fp would be valid here but it is not. https://github.com/torvalds/linux/blob/master/arch/arm64/kernel/vdso/sigreturn.S On Ubuntu Bionic it happened to point to an old frame info which meant you got what looked like a correct backtrace. On Focal, the info is completely invalid. (probably due to some code shuffling in libc) This adds an UnwindPlan that knows that the sp in a sigreturn frame points to an rt_sigframe from which we can offset to get saved sp and pc values to backtrace correctly. Based on LibUnwind's change: https://reviews.llvm.org/D90898 A new test is added that sets all compares the frames from the initial signal catch to the handler break. Ensuring that the stack/frame pointer, function name and register values match. (this test is AArch64 Linux specific because it's the only one with a specific unwind plan for this situation) Fixes https://bugs.llvm.org/show_bug.cgi?id=52165 Reviewed By: omjavaid, labath Differential Revision: https://reviews.llvm.org/D112069
2021-10-26[lldb] Remove ConstString from Platform plugin namesPavel Labath
2021-10-18[lldb] Return StringRef from PluginInterface::GetPluginNamePavel Labath
There is no reason why this function should be returning a ConstString. While modifying these files, I also fixed several instances where GetPluginName and GetPluginNameStatic were returning different strings. I am not changing the return type of GetPluginNameStatic in this patch, as that would necessitate additional changes, and this patch is big enough as it is. Differential Revision: https://reviews.llvm.org/D111877
2021-05-26[lldb][NFC] Use C++ versions of the deprecated C standard library headersRaphael Isemann
The C headers are deprecated so as requested in D102845, this is replacing them all with their (not deprecated) C++ equivalent. Reviewed By: shafik Differential Revision: https://reviews.llvm.org/D103084
2020-10-27[lldb][NFC] Make GetResumeCountForLaunchInfo return an unsigned.Raphael Isemann
The number of resumes should always be positive to let's make this an unsigned everywhere. Also remove the unused 'localhost' parameter from ConvertArgumentsForLaunchingInShell.
2020-10-09[lldb] Delete copy operations on PluginInterface classPavel Labath
This is a polymorphic class, copying it is a bad idea. This was not a problem because most classes inheriting from it were deleting their copy operations themselves. However, this enables us to delete those explicit deletions, and ensure noone forgets to add them in the future.
2020-10-06[lldb] [Platform] Move common ::DebugProcess() to PlatformPOSIXMichał Górny
Move common ::DebugProcess() implementation shared by Linux and NetBSD (and to be shared by FreeBSD shortly) into PlatformPOSIX, and move the old base implementation used only by Darwin to PlatformDarwin. Differential Revision: https://reviews.llvm.org/D88852
2020-06-15[lldb] Rename Master/Slave to Primary/Secondary (NFC)Jonas Devlieghere
2020-02-14Remove 'process launch failed:' message prefix in Target::LaunchJason Molenda
SB API clients can describe the failure message in a more natural way for their UI, this doesn't add information for them. Differential Revision: https://reviews.llvm.org/D74585 <rdar://problem/49953304>
2020-02-14[lldb/Plugin] s/LLDB_PLUGIN/LLDB_PLUGIN_DEFINE/ (NFC)Jonas Devlieghere
Rename LLDB_PLUGIN to LLDB_PLUGIN_DEFINE as Pavel suggested in D73067 to avoid name conflict.
2020-02-10[LLDB] Fix GCC warnings about extra semicolons. NFC.Martin Storsjö
2020-02-07[lldb/Plugins] Use external functions to (de)initialize pluginsJonas Devlieghere
This is a step towards making the initialize and terminate calls be generated by CMake, which in turn is towards making it possible to disable plugins at configuration time. Differential revision: https://reviews.llvm.org/D74245
2020-01-24[lldb][NFC] Fix all formatting errors in .cpp file headersRaphael Isemann
Summary: A *.cpp file header in LLDB (and in LLDB) should like this: ``` //===-- TestUtilities.cpp -------------------------------------------------===// ``` However in LLDB most of our source files have arbitrary changes to this format and these changes are spreading through LLDB as folks usually just use the existing source files as templates for their new files (most notably the unnecessary editor language indicator `-*- C++ -*-` is spreading and in every review someone is pointing out that this is wrong, resulting in people pointing out that this is done in the same way in other files). This patch removes most of these inconsistencies including the editor language indicators, all the different missing/additional '-' characters, files that center the file name, missing trailing `===//` (mostly caused by clang-format breaking the line). Reviewers: aprantl, espindola, jfb, shafik, JDevlieghere Reviewed By: JDevlieghere Subscribers: dexonsmith, wuzish, emaste, sdardis, nemanjai, kbarton, MaskRay, atanasyan, arphaman, jfb, abidh, jsji, JDevlieghere, usaxena95, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D73258
2019-12-13[lldb/Host] Use cmakedefine01 for LLDB_ENABLE_POSIXJonas Devlieghere
Rename LLDB_DISABLE_POSIX to LLDB_ENABLE_POSIX and use cmakedefine01 for consistency.
2019-09-24[lldb] Decouple importing the std C++ module from the way the program is ↵Raphael Isemann
compiled Summary: At the moment, when trying to import the `std` module in LLDB, we look at the imported modules used in the compiled program and try to infer the Clang configuration we need from the DWARF module-import. That was the initial idea but turned out to cause a few problems or inconveniences: * It requires that users compile their programs with C++ modules. Given how experimental C++ modules are makes this feature inaccessible for many users. Also it means that people can't just get the benefits of this feature for free when we activate it by default (and we can't just close all the associated bug reports). * Relying on DWARF's imported module tags (that are only emitted by default on macOS) means this can only be used when using DWARF (and with -glldb on Linux). * We essentially hardcoded the C standard library paths on some platforms (Linux) or just couldn't support this feature on other platforms (macOS). This patch drops the whole idea of looking at the imported module DWARF tags and instead just uses the support files of the compilation unit. If we look at the support files and see file paths that indicate where the C standard library and libc++ are, we can just create the module configuration this information. This fixes all the problems above which means we can enable all the tests now on Linux, macOS and with other debug information than what we currently had. The only debug information specific code is now the iteration over external type module when -gmodules is used (as `std` and also the `Darwin` module are their own external type module with their own files). The meat of this patch is the CppModuleConfiguration which looks at the file paths from the compilation unit and then figures out the include paths based on those paths. It's quite conservative in that it only enables modules if we find a single C library and single libc++ library. It's still missing some test mode where we try to compile an expression before we actually activate the config for the user (which probably also needs some caching mechanism), but for now it works and makes the feature usable. Reviewers: aprantl, shafik, jdoerfert Reviewed By: aprantl Subscribers: mgorny, abidh, JDevlieghere, lldb-commits Tags: #c_modules_in_lldb, #lldb Differential Revision: https://reviews.llvm.org/D67760 llvm-svn: 372716
2019-07-19Support Linux signal return trampolines in frame initializationJoseph Tremoulet
Summary: Add __kernel_rt_sigreturn to the list of trap handlers for Linux (it's used as such on aarch64 at least), and __restore_rt as well (used on x86_64). Skip decrement-and-recompute for trap handlers in InitializeNonZerothFrame, as signal dispatch may point the child frame's return address to the start of the return trampoline. Parse the 'S' flag for signal handlers from eh_frame augmentation, and propagate it to the unwind plan. Reviewers: labath, jankratochvil, compnerd, jfb, jasonmolenda Reviewed By: jasonmolenda Subscribers: clayborg, MaskRay, wuzish, nemanjai, kbarton, jrtc27, atanasyan, jsji, javed.absar, kristof.beyls, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D63667 llvm-svn: 366580
2019-05-23[lldb] NFC modernize codebase with modernize-use-nullptrKonrad Kleine
Summary: NFC = [[ https://llvm.org/docs/Lexicon.html#nfc | Non functional change ]] This commit is the result of modernizing the LLDB codebase by using `nullptr` instread of `0` or `NULL`. See https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html for more information. This is the command I ran and I to fix and format the code base: ``` run-clang-tidy.py \ -header-filter='.*' \ -checks='-*,modernize-use-nullptr' \ -fix ~/dev/llvm-project/lldb/.* \ -format \ -style LLVM \ -p ~/llvm-builds/debug-ninja-gcc ``` NOTE: There were also changes to `llvm/utils/unittest` but I did not include them because I felt that maybe this library shall be updated in isolation somehow. NOTE: I know this is a rather large commit but it is a nobrainer in most parts. Reviewers: martong, espindola, shafik, #lldb, JDevlieghere Reviewed By: JDevlieghere Subscribers: arsenm, jvesely, nhaehnle, hiraditya, JDevlieghere, teemperor, rnkovacs, emaste, kubamracek, nemanjai, ki.stfu, javed.absar, arichardson, kbarton, jrtc27, MaskRay, atanasyan, dexonsmith, arphaman, jfb, jsji, jdoerfert, lldb-commits, llvm-commits Tags: #lldb, #llvm Differential Revision: https://reviews.llvm.org/D61847 llvm-svn: 361484
2019-05-16Simplify ArchSpec::IsMIPS()Fangrui Song
llvm-svn: 360865
2019-04-10[NFC] Remove ASCII lines from commentsJonas Devlieghere
A lot of comments in LLDB are surrounded by an ASCII line to delimit the begging and end of the comment. Its use is not really consistent across the code base, sometimes the lines are longer, sometimes they are shorter and sometimes they are omitted. Furthermore, it looks kind of weird with the 80 column limit, where the comment actually extends past the line, but not by much. Furthermore, when /// is used for Doxygen comments, it looks particularly odd. And when // is used, it incorrectly gives the impression that it's actually a Doxygen comment. I assume these lines were added to improve distinguishing between comments and code. However, given that todays editors and IDEs do a great job at highlighting comments, I think it's worth to drop this for the sake of consistency. The alternative is fixing all the inconsistencies, which would create a lot more churn. Differential revision: https://reviews.llvm.org/D60508 llvm-svn: 358135
2019-03-12Add ability to import std module into expression parser to improve C++ debuggingRaphael Isemann
Summary: This patch is the MVP version of importing the std module into the expression parser to improve C++ debugging. What happens in this patch is that we inject a `@import std` into our expression source code. We also modify our internal Clang instance for parsing this expression to work with modules and debug info at the same time (which is the main change in terms of LOC). We implicitly build the `std` module on the first use. The C++ include paths for building are extracted from the debug info, which means that this currently only works if the program is compiled with `-glldb -fmodules` and uses the std module. The C include paths are currently specified by LLDB. I enabled the tests currently only for libc++ and Linux because I could test this locally. I'll enable the tests for other platforms once this has landed and doesn't break any bots (and I implemented the platform-specific C include paths for them). With this patch we can now: * Build a libc++ as a module and import it into the expression parser. * Read from the module while also referencing declarations from the debug info. E.g. `std::abs(local_variable)`. What doesn't work (yet): * Merging debug info and C++ module declarations. E.g. `std::vector<CustomClass>` doesn't work. * Pretty much anything that involves the ASTImporter and templated code. As the ASTImporter is used for saving the result declaration, this means that we can't call yet any function that returns a non-trivial type. * Use libstdc++ for this, as it requires multiple include paths and Clang only emits one include path per module. Also libstdc++ doesn't support Clang modules without patches. Reviewers: aprantl, jingham, shafik, friss, davide, serge-sans-paille Reviewed By: aprantl Subscribers: labath, mgorny, abidh, jdoerfert, lldb-commits Tags: #c_modules_in_lldb, #lldb Differential Revision: https://reviews.llvm.org/D58125 llvm-svn: 355939
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2019-01-07ProcessLaunchInfo: remove Debugger referencePavel Labath
Summary: The Debuffer object was being used in "GetListenerForProcess" to provide a default listener object if one was not specified in the launch_info object. Since all the callers of this function immediately passed the result to Target::CreateProcess, it was easy to move this logic there instead. This brings us one step closer towards being able to move the LaunchInfo classes to the Host layer (which is there the launching code that consumes them lives). Reviewers: zturner, jingham, teemperor Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D56174 llvm-svn: 350510
2018-12-15Simplify Boolean expressionsJonas Devlieghere
This patch simplifies boolean expressions acorss LLDB. It was generated using clang-tidy with the following command: run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD Differential revision: https://reviews.llvm.org/D55584 llvm-svn: 349215
2018-11-11Remove header grouping comments.Jonas Devlieghere
This patch removes the comments grouping header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. llvm-svn: 346626
2018-09-20[NFC] Turn "load dependent files" boolean into an enumJonas Devlieghere
This is an NFC commit to refactor the "load dependent files" parameter from a boolean to an enum value. We want to be able to specify a default, in which case we decide whether or not to load the dependent files based on whether the target is an executable or not (i.e. a dylib). This is a dependency for D51934. Differential revision: https://reviews.llvm.org/D51859 llvm-svn: 342633
2018-08-07Move RegisterValue,Scalar,State from Core to UtilityPavel Labath
These three classes have no external dependencies, but they are used from various low-level APIs. Moving them down to Utility improves overall code layering (although it still does not break any particular dependency completely). The XCode project will need to be updated after this change. Differential Revision: https://reviews.llvm.org/D49740 llvm-svn: 339127
2018-04-30Reflow paragraphs in comments.Adrian Prantl
This is intended as a clean up after the big clang-format commit (r280751), which unfortunately resulted in many of the comment paragraphs in LLDB being very hard to read. FYI, the script I used was: import textwrap import commands import os import sys import re tmp = "%s.tmp"%sys.argv[1] out = open(tmp, "w+") with open(sys.argv[1], "r") as f: header = "" text = "" comment = re.compile(r'^( *//) ([^ ].*)$') special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$') for line in f: match = comment.match(line) if match and not special.match(match.group(2)): # skip intentionally short comments. if not text and len(match.group(2)) < 40: out.write(line) continue if text: text += " " + match.group(2) else: header = match.group(1) text = match.group(2) continue if text: filled = textwrap.wrap(text, width=(78-len(header)), break_long_words=False) for l in filled: out.write(header+" "+l+'\n') text = "" out.write(line) os.rename(tmp, sys.argv[1]) Differential Revision: https://reviews.llvm.org/D46144 llvm-svn: 331197