[Lldb-commits] [lldb] [lldb] When re-enabling a watchpoint, save the current bytes (PR #218819)

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 26 18:06:25 PDT 2026


jasonmolenda wrote:

> > > Does `watch enable` not re-evaluate the variable expression that was passed in when the watchpoint was set? I was wondering why you have to require ASLR?
> > 
> > 
> > _cough_ I forgot how all this works, I had to reread a bit. We don't reevaluate the watchpoint specification when re-enabling. In the Watchpoint object the specification is resolved to an address and a size, and the WatchpointResource(s) for that Watchpoint are based on that addr+size.
> 
> Ah, Watchpoint itself never interprets the specification, at least not watch set variable. That's done in CommandObjectWatchpointSetVariable::DoExecute,

This also answers the question I had yesterday when writing the API test, why `SBTarget::CreateByAddress()` is the only API, there is no way to create one on an SBValue or variable path.  Probably because someone was reluctant to duplicate the code in CommandObjectWatchpointSetVariable to evaluate that down to addr+size.

https://github.com/llvm/llvm-project/pull/218819


More information about the lldb-commits mailing list