jingham added inline comments.

================
Comment at: lldb/test/API/python_api/watchpoint/TestSetWatchpoint.py:66
+        if variable_watchpoint:
+            # FIXME: There should probably be an API to create a variable 
watchpoint
+            self.runCmd('watchpoint set variable -w read_write -- global')
----------------
delcypher wrote:
> delcypher wrote:
> > mib wrote:
> > > +1, please file an enhancement request :) 
> > Will do. TBH I'm actually surprised that calling `SBValue::Watch()` doesn't 
> > create a variable watchpoint.
> Actually I'm even more confident this is a bug. If `value.Watch(...)` created 
> an expression watchpoint you would expect the type to be a `int32_t*` 
> (because the watched expression would need to have been `&global`), not 
> `int32_t`.
> 
> However, I think this bug should be fixed in a different commit.
There's no guarantee that an SBValue represents a variable.  An SBValue backed 
by a ValueObjectVariable (or a ValueObjectChild whose root object is a 
ValueObjectVariable) could create a Variable watchpoint.  But for instance a 
typed memory address isn't a variable, nor is an expression result.  They don't 
have scopes, which is the main thing "variable" watchpoints have over 
expression ones, for instance.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144937/new/

https://reviews.llvm.org/D144937

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to