labath added a comment.

In D77045#1956879 <https://reviews.llvm.org/D77045#1956879>, @omjavaid wrote:

> Adding a testcase would be tricky as these register overlap in memory and we 
> store them with overlapping offsets with their children we should not need to 
> invalidate the children when we write the parent but for some strange 
> unexplainable reason QEMU was behaving strangely and not updating the first 
> half in certain random cases. I just thought invalidation of children will 
> force a read after write for that case.


Thanks for the explanation, but I'm afraid I still don't get what is going on 
here. Can you walk me through the individual steps here? Something like:

1. user does "register write x0 xxxxxx"
2. lldb translates that to the appropriate `p` packet
3. ???
4. user does "register read w0"
5. bad value comes out because...



================
Comment at: lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h:593-594
 
+#define STRINGIZE2(x) #x
+#define STRINGIZE(x) STRINGIZE2(x)
+
----------------
omjavaid wrote:
> labath wrote:
> > What's up with the indirection?
> We want to pass nullptr or register name as is then do stringize on regname 
> only. According to C macro expansion rules if we want our macros expanded 
> first and then do the # then we ll need double indirection.
I've figured it's something like that, though it's still not clear to me why 
that is needed in this particular case.

However, now I have a different question. As the only thing you're using the 
alt_name argument for is to turn it into a string, why not just pass a string 
in the first place:
```
DEFINE_GPR64(x0, nullptr, ...)
...
DEFINE_GPR64(fp, "x29", ...)
...
```


================
Comment at: lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h:597
 static lldb_private::RegisterInfo g_register_infos_arm64_le[] = {
     // DEFINE_GPR64(name, GENERIC KIND)
+    DEFINE_GPR64(x0, nullptr, LLDB_REGNUM_GENERIC_ARG1, g_x0_invalidates),
----------------
This comment is out of date now.


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

https://reviews.llvm.org/D77045



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

Reply via email to