decompiler: Implement variable values tooltip in debugging#3572
decompiler: Implement variable values tooltip in debugging#3572i-m00n wants to merge 5 commits intorizinorg:devfrom
Conversation
2b97c60 to
b5a8fc9
Compare
|
5e7c040 to
cde2485
Compare
cde2485 to
1ae564d
Compare
|
@i-m00n Please add a video where you show off the changes. |
573f7a6 to
d067e2d
Compare
|
Hi @wargio, just a quick follow-up on this when you have a moment. I've addressed the previous feedback and rebased the PR. Let me know if it's ready for another look! also, I've updated the PR body with the required video. |
| pointedAddr_state = | ||
| rz_io_read_at_mapped(core->io, stackAddr, (ut8 *)&pointedAddr, ptrSize); |
There was a problem hiding this comment.
you cannot do this. you should read to a buffer and then use rz_read_ble to get the correct pointerAddr value.
There was a problem hiding this comment.
oh, thanks for this note, I’ve updated the logic to read the pointer into a ut8 ptrBuf[8] and then used rz_read_ble() with core->rasm->big_endian to ensure the address is correctly reconstructed regardless of the target architecture.
| if (str_state) { | ||
| size_t len = strnlen((const char *)buf, sizeof(buf)); | ||
| if (len > 0 && rz_str_is_printable((const char *)buf)) { | ||
| QString str = QString::fromUtf8((const char *)buf, len); |
There was a problem hiding this comment.
| QString str = QString::fromUtf8((const char *)buf, len); | |
| QString str = QString::fromUtf8((const char *)buf, len).toHtmlEscaped();; |
| } | ||
| } | ||
| } | ||
| return QString("%1 (%2)\nValue: %3").arg(QString::fromUtf8(var->name), typeStr, displayValue); |
There was a problem hiding this comment.
| return QString("%1 (%2)\nValue: %3").arg(QString::fromUtf8(var->name), typeStr, displayValue); | |
| return QString("%1 (%2)\nValue: %3").arg(QString::fromUtf8(var->name).toHtmlEscaped(), typeStr, displayValue); |
| rz_mem_free(rawVal); | ||
| if (typeStr.contains("*")) { | ||
| ut64 pointedAddr = 0; | ||
| int ptrSize = core->analysis->bits / 8; |
There was a problem hiding this comment.
Updated. I’m now pulling the bitness from core->rasm->bits.
There was a problem hiding this comment.
Could you clarify what method you'd like me to use for getting the bitness? I checked for rz_asm_get_bits but it's marked as RZ_DEPRECATE in rizin, and I don't see a corresponding wrapper in Cutter's API.
Also I’ve updated to the latest dev and refactored the register access to use the new Core()->getRegisterRefValue() helper introduced in #3570 .
d067e2d to
490fa01
Compare
|
@wargio I'd be happy to open a separate PR to standardize this across the project if needed. |
0c9dc37 to
49761c5
Compare
later. finish this first. |
There was a problem hiding this comment.
sorry for that, it happened when I mistakenly ran rg rasm->bits, I should've put it in double quotes as the symbol > created a new bits file searching for the text rasm-.
now it's removed.
0a8cae4 to
4dadd4b
Compare
4dadd4b to
15f8e32
Compare
15f8e32 to
c1cc178
Compare
Your checklist for this pull request
Detailed description
This PR enhances the decompiler's variable tooltips by implementing live string dereferencing as mentioned in #3344.
cutter.-.decompiler.tooltips.webm
Test plan (required)
Start a debug session and try moving to different break points and hover over various variables and check the tooltip.
Closing issues
it doesn't fully close #3344 or #2532 as it currently handles only explicitly tracked analysis variables.
Limitations
Synthetic/Untracked Variables: Does not currently handle variables that Rizin hasn't fully analyzed or "Synthetic" variables generated by the decompiler.
Configuration Toggle: Would you like me to add a checkbox in the Preferences settings to enable/disable this feature? Currently, it is always active