| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[lldb] Refactor LLDB Breakpoint Event Notifications to centralize and eliminate code duplication (#164739) ### Summary This PR refactors breakpoint event notification in LLDB to centralize and eliminate code duplication. It creates a unified method in the Target class for sending breakpoint change events. The new methods check if listeners exist before broadcasting events ### Test <img width="1532" height="76" alt="Screenshot 2025-10-23 at 12 49 31 PM" src="https://github.com/user-attachments/assets/6d6a6da6-9684-463c-aeeb-90663cdbd077" /> --------- Co-authored-by: Piyush Jaiswal <piyushjais@meta.com> | 9 个月前 | |
[lldb] Turn lldb_private::Status into a value type. (#106163) This patch removes all of the Set.* methods from Status. This cleanup is part of a series of patches that make it harder use the anti-pattern of keeping a long-lives Status object around and updating it while dropping any errors it contains on the floor. This patch is largely NFC, the more interesting next steps this enables is to: 1. remove Status.Clear() 2. assert that Status::operator=() never overwrites an error 3. remove Status::operator=() Note that step (2) will bring 90% of the benefits for users, and step (3) will dramatically clean up the error handling code in various places. In the end my goal is to convert all APIs that are of the form ResultTy DoFoo(Status& error) to llvm::Expected<ResultTy> DoFoo() How to read this patch? The interesting changes are in Status.h and Status.cpp, all other changes are mostly perl -pi -e 's/\.SetErrorString/ = Status::FromErrorString/g' $(git grep -l SetErrorString lldb/source) plus the occasional manual cleanup. | 1 年前 | |
[lldb] Fix trailing whitespace in Breakpoint (NFC) Working in the Breakpoint library is a minefield if you have your editor configured to trim trailing whitespace. Remove it and format the affected lines. | 1 年前 | |
[lldb] Refactor LLDB Breakpoint Event Notifications to centralize and eliminate code duplication (#164739) ### Summary This PR refactors breakpoint event notification in LLDB to centralize and eliminate code duplication. It creates a unified method in the Target class for sending breakpoint change events. The new methods check if listeners exist before broadcasting events ### Test <img width="1532" height="76" alt="Screenshot 2025-10-23 at 12 49 31 PM" src="https://github.com/user-attachments/assets/6d6a6da6-9684-463c-aeeb-90663cdbd077" /> --------- Co-authored-by: Piyush Jaiswal <piyushjais@meta.com> | 9 个月前 | |
[lldb] Mark single-argument SourceLanguage constructors explicit (#166527) This avoids unintentional comparisons between SourceLanguage and LanguageType. Also marks operator bool explicit so we don't implicitly convert to bool. | 8 个月前 | |
[lldb] Fix crash in BreakpointSite::BumpHitCounts (#166876) Fix crash in BreakpointSite::BumpHitCounts due to missing synchronization. When bumping the hit count, we were correctly acquiring the constituents mutex, but didn't protect the breakpoint location collection. This PR fixes the issue by making the iterator returned by the collection a LockingAdaptedIterable. rdar://163760832 | 8 个月前 | |
Add a scripted way to re-present a stop location (#158128) This patch adds the notion of "Facade" locations which can be reported from a ScriptedResolver instead of the actual underlying breakpoint location for the breakpoint. Also add a "was_hit" method to the scripted resolver that allows the breakpoint to say which of these "Facade" locations was hit, and "get_location_description" to provide a description for the facade locations. I apologize in advance for the size of the patch. Almost all of what's here was necessary to (a) make the feature testable and (b) not break any of the current behavior. The motivation for this feature is given in the "Providing Facade Locations" section that I added to the python-reference.rst so I won't repeat it here. rdar://152112327 | 9 个月前 | |
[lldb] Fix trailing whitespace in Breakpoint (NFC) Working in the Breakpoint library is a minefield if you have your editor configured to trim trailing whitespace. Remove it and format the affected lines. | 1 年前 | |
[lldb] Support specifying a language for breakpoint conditions (#147603) LLDB breakpoint conditions take an expression that's evaluated using the language of the code where the breakpoint is located. Users have asked to have an option to tell it to evaluate the expression in a specific language. This is feature is especially helpful for Swift, for example for a condition based on the value in memory at an offset from a register. Such a condition is pretty difficult to write in Swift, but easy in C. This PR adds a new argument (-Y) to specify the language of the condition expression. We can't reuse the current -L option, since you might want to break on only Swift symbols, but run a C expression there as per the example above. rdar://146119507 | 1 年前 | |
[lldb] Turn lldb_private::Status into a value type. (#106163) This patch removes all of the Set.* methods from Status. This cleanup is part of a series of patches that make it harder use the anti-pattern of keeping a long-lives Status object around and updating it while dropping any errors it contains on the floor. This patch is largely NFC, the more interesting next steps this enables is to: 1. remove Status.Clear() 2. assert that Status::operator=() never overwrites an error 3. remove Status::operator=() Note that step (2) will bring 90% of the benefits for users, and step (3) will dramatically clean up the error handling code in various places. In the end my goal is to convert all APIs that are of the form ResultTy DoFoo(Status& error) to llvm::Expected<ResultTy> DoFoo() How to read this patch? The interesting changes are in Status.h and Status.cpp, all other changes are mostly perl -pi -e 's/\.SetErrorString/ = Status::FromErrorString/g' $(git grep -l SetErrorString lldb/source) plus the occasional manual cleanup. | 1 年前 | |
[lldb-dap] persistent assembly breakpoints (#148061) Resolves #141955 - Adds data to breakpoints Source object, in order for assembly breakpoints, which rely on a temporary sourceReference value, to be able to resolve in future sessions like normal path+line breakpoints - Adds optional instructions_offset parameter to BreakpointResolver | 11 个月前 | |
[lldb-dap] persistent assembly breakpoints (#148061) Resolves #141955 - Adds data to breakpoints Source object, in order for assembly breakpoints, which rely on a temporary sourceReference value, to be able to resolve in future sessions like normal path+line breakpoints - Adds optional instructions_offset parameter to BreakpointResolver | 11 个月前 | |
[lldb] Eliminate SupportFileSP nullptr derefs (#168624) This patch fixes and eliminates the possibility of SupportFileSP ever being nullptr. The support file was originally treated like a value type, but became a polymorphic type and therefore has to be stored and passed around as a pointer. To avoid having all the callers check the validity of the pointer, I introduced the invariant that SupportFileSP is never null and always default constructed. However, without enforcement at the type level, that's fragile and indeed, we already identified two crashes where someone accidentally broke that invariant. This PR introduces a NonNullSharedPtr to prevent that. NonNullSharedPtr is a smart pointer wrapper around std::shared_ptr that guarantees the pointer is never null. If default-constructed, it creates a default-constructed instance of the contained type. Note that I'm using private inheritance because you shouldn't inherit from standard library classes due to the lack of virtual destructor. So while the new abstraction looks like a std::shared_ptr, it is in fact **not** a shared pointer. Given that our destructor is trivial, we could use public inheritance, but currently there's no need for it. rdar://164989579 | 8 个月前 | |
[lldb] Deal with SupportFiles in SourceManager (NFC) (#106740) To support detecting MD5 checksum mismatches, deal with SupportFiles rather than a plain FileSpecs in the SourceManager. | 1 年前 | |
[lldb][Lanugage][NFC] Adapt Language::ForEach to IterationAction (#161830) | 9 个月前 | |
Add a scripted way to re-present a stop location (#158128) This patch adds the notion of "Facade" locations which can be reported from a ScriptedResolver instead of the actual underlying breakpoint location for the breakpoint. Also add a "was_hit" method to the scripted resolver that allows the breakpoint to say which of these "Facade" locations was hit, and "get_location_description" to provide a description for the facade locations. I apologize in advance for the size of the patch. Almost all of what's here was necessary to (a) make the feature testable and (b) not break any of the current behavior. The motivation for this feature is given in the "Providing Facade Locations" section that I added to the python-reference.rst so I won't repeat it here. rdar://152112327 | 9 个月前 | |
Add a scripted way to re-present a stop location (#158128) This patch adds the notion of "Facade" locations which can be reported from a ScriptedResolver instead of the actual underlying breakpoint location for the breakpoint. Also add a "was_hit" method to the scripted resolver that allows the breakpoint to say which of these "Facade" locations was hit, and "get_location_description" to provide a description for the facade locations. I apologize in advance for the size of the patch. Almost all of what's here was necessary to (a) make the feature testable and (b) not break any of the current behavior. The motivation for this feature is given in the "Providing Facade Locations" section that I added to the python-reference.rst so I won't repeat it here. rdar://152112327 | 9 个月前 | |
[lldb/cmake] Use ADDITIONAL_HEADER(_DIR)?S (#142587) Replace (questionable) header globs with an explicit argument supported by llvm_add_library. | 1 年前 | |
[lldb] [mostly NFC] Large WP foundation: WatchpointResources (#68845) This patch is rearranging code a bit to add WatchpointResources to Process. A WatchpointResource is meant to represent a hardware watchpoint register in the inferior process. It has an address, a size, a type, and a list of Watchpoints that are using this WatchpointResource. This current patch doesn't add any of the features of WatchpointResources that make them interesting -- a user asking to watch a 24 byte object could watch this with three 8 byte WatchpointResources. Or a Watchpoint on 1 byte at 0x1002 and a second watchpoint on 1 byte at 0x1003, these must both be served by a single WatchpointResource on that doubleword at 0x1000 on a 64-bit target, if two hardware watchpoint registers were used to track these separately, one of them may not be hit. Or if you have one Watchpoint on a variable with a condition set, and another Watchpoint on that same variable with a command defined or different condition, or ignorecount, both of those Watchpoints need to evaluate their criteria/commands when their WatchpointResource has been hit. There's a bit of code movement to rearrange things in the direction I'll need for implementing this feature, so I want to start with reviewing & landing this mostly NFC patch and we can focus on the algorithmic choices about how WatchpointResources are shared and handled as they're triggeed, separately. This patch also stops printing "Watchpoint <n> hit: old value: <x>, new vlaue: <y>" for Read watchpoints. I could make an argument for print "Watchpoint <n> hit: current value <x>" but the current output doesn't make any sense, and the user can print the value if they are particularly interested. Read watchpoints are used primarily to understand what code is reading a variable. This patch adds more fallbacks for how to print the objects being watched if we have types, instead of assuming they are all integral values, so a struct will print its elements. As large watchpoints are added, we'll be doing a lot more of those. To track the WatchpointSP in the WatchpointResources, I changed the internal API which took a WatchpointSP and devolved it to a Watchpoint*, which meant touching several different Process files. I removed the watchpoint code in ProcessKDP which only reported that watchpoints aren't supported, the base class does that already. I haven't yet changed how we receive a watchpoint to identify the WatchpointResource responsible for the trigger, and identify all Watchpoints that are using this Resource to evaluate their conditions etc. This is the same work that a BreakpointSite needs to do when it has been tiggered, where multiple Breakpoints may be at the same address. There is not yet any printing of the Resources that a Watchpoint is implemented in terms of ("watchpoint list", or SBWatchpoint::GetDescription). "watchpoint set var" and "watchpoint set expression" take a size argument which was previously 1, 2, 4, or 8 (an enum). I've changed this to an unsigned int. Most hardware implementations can only watch 1, 2, 4, 8 byte ranges, but with Resources we'll allow a user to ask for different sized watchpoints and set them in hardware-expressble terms soon. I've annotated areas where I know there is work still needed with LWP_TODO that I'll be working on once this is landed. I've tested this on aarch64 macOS, aarch64 Linux, and Intel macOS. https://discourse.llvm.org/t/rfc-large-watchpoint-support-in-lldb/72116 (cherry picked from commit fc6b72523f3d73b921690a713e97a433c96066c6) | 2 年前 | |
[lldb] Replace default bodies of special member functions with = default; Replace default bodies of special member functions with = default; $ run-clang-tidy.py -header-filter='lldb' -checks='-*,modernize-use-equals-default' -fix , https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-default.html Differential revision: https://reviews.llvm.org/D104041 | 5 年前 | |
[Breakpoint] Remove redundant member initialization (NFC) Identified with readability-redundant-member-init. | 4 年前 | |
Remove hardware index from watchpoints and breakpoints (#72012) The Watchpoint and Breakpoint objects try to track the hardware index that was used for them, if they are hardware wp/bp's. The majority of our debugging goes over the gdb remote serial protocol, and when we set the watchpoint/breakpoint, there is no (standard) way for the remote stub to communicate to lldb which hardware index was used. We have an lldb-extension packet to query the total number of watchpoint registers. When a watchpoint is hit, there is an lldb extension to the stop reply packet (documented in lldb-gdb-remote.txt) to describe the watchpoint including its actual hardware index, <addr within wp range> <wp hw index> <actual accessed address> (the third field is specifically needed for MIPS). At this point, if the stub reported these three fields (the stub is only required to provide the first), we can know the actual hardware index for this watchpoint. Breakpoints are worse; there's never any way for us to be notified about which hardware index was used. Breakpoints got this as a side effect of inherting from StoppointSite with Watchpoints. We expose the watchpoint hardware index through "watchpoint list -v" and through SBWatchpoint::GetHardwareIndex. With my large watchpoint support, there is no *single* hardware index that may be used for a watchpoint, it may need multiple resources. Also I don't see what a user is supposed to do with this information, or an IDE. Knowing the total number of watchpoint registers on the target, and knowing how many Watchpoint Resources are currently in use, is helpful. Knowing how many Watchpoint Resources a single user-specified watchpoint needed to be implemented is useful. But knowing which registers were used is an implementation detail and not available until we hit the watchpoint when using gdb remote serial protocol. So given all that, I'm removing watchpoint hardware index numbers. I'm changing the SB API to always return -1. | 2 年前 | |
[lldb] Fix else-after-return in Breakpoint (NFC) The LLVM Coding Standards [1] discourages the use of 'else' or 'else if' after something that interrupts control flow. Bulk fix all instances as I'm working on this part of LLDB. [1] https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return | 1 年前 | |
[lldb] Use llvm::bit_ceil (NFC) (#138723) This patch replaces a local implementation of bit_ceil with llvm::bit_ceil. Technically, the local implementation evaluates to 0 on input 0, whereas llvm::bit_ceil evaluates to 1, but that doesn't matter because we have: // Can't watch zero bytes. if (user_size == 0) return {}; | 1 年前 | |
[lldb] Use llvm::find_if (NFC) (#141385) | 1 年前 | |
[lldb] Fix else-after-return in Breakpoint (NFC) The LLVM Coding Standards [1] discourages the use of 'else' or 'else if' after something that interrupts control flow. Bulk fix all instances as I'm working on this part of LLDB. [1] https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return | 1 年前 | |
[lldb] Use llvm::find (NFC) (#143338) This patch should be mostly obvious, but in one place, this patch changes: const auto &it = std::find(...) to: auto it = llvm::find(...) We do not need to bind to a temporary with const ref. | 1 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 9 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 9 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 11 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 |