rizin/librz/debug
Rot127 a6c7864198
Fix mismatch 'rz_cons_break_push' and 'rz_cons_break_pop' calls. (#4289)
If a function calls 'rz_cons_break_push()' but never calls 'rz_cons_break_pop()' before return,
the stack count of 'RzConsContext->break_stack' contains too many elements (each time one too much).

This in turn will lead to not resetting 'RzConsContext->breaked' flag.
Because the flag is only set to false, if 'rz_stack_is_empty(context->break_stack) == true'
(in 'rz_cons_context_break_push()').

This wasn't a problem so far, because 'RzConsContext->breaked' is simply never set to true
(exceptions are some timeout cases as far as I can see).
Also these cases when 'rz_cons_break_pop()' was forgetten to be called, were edge error cases.
So not often hit.

But if Rizin is usd by Cutter 'RzConsContext->breaked' is set to 'true',
if an `AnalysisTask` interrupt is handled (in 'AnalysisTask::interrupt()').
This interrupt is triggered for example, when the introduction dialog is closed
and the main Cutter window opens (after the optional 'aaa').

Now, if the binary file was analysed with 'aaa', and a lot of error cases were hit,
those error cases sometimes never called 'rz_cons_break_pop()' before returning from their function.
Although, of course, they should have to the `RzConsContext->break_stack` is in a proper state.

This means, when the main Cutter window opens binary files which trigger many error edge cases,
the `RzConsContext->break_stack` is not empty
(because of the not executed 'rz_cons_break_pop()').

This also means, that the last thing done, was setting 'RzConsContext->breaked = true'
(by 'AnalysisTask::interrupt()').

If Cutter wants to show some disassembly, it calls 'rz_core_print_disasm()' which checks
'RzConsContext == false' via 'rz_cons_is_breaked()'. This condition is never true, because
the flag was not reset to `false` because the stack was never empty.
So it returns before anything was disassembled.

Hence Cutter gets no disassembly text.

Fixes https://github.com/rizinorg/cutter/issues/2552
Fixes https://github.com/rizinorg/cutter/issues/3275
2024-02-23 23:50:11 +08:00
..
p Fix mismatch 'rz_cons_break_push' and 'rz_cons_break_pop' calls. (#4289) 2024-02-23 23:50:11 +08:00
ddesc.c Convert dd commands to rzshell (#3049) 2022-09-29 08:24:50 +08:00
debug.c Remove sdb_fmt() calls in RzDebug (#4135) 2024-01-21 23:24:52 +08:00
desil.c Convert de commands to the rzshell (#3083) 2022-10-10 22:10:48 +08:00
dmap.c Refactoring debug plugin and cleanup output (#3634) 2023-07-04 10:42:41 +08:00
dreg.c Make xnu reg profile depend on cpu type instead of RzDebug.bits (#3270) 2023-01-07 17:43:41 +01:00
dsession.c Remove sdb_fmt() calls in RzDebug (#4135) 2024-01-21 23:24:52 +08:00
dsignal.c Convert dk commands to the rzshell (#3078) 2022-10-11 18:02:52 +08:00
meson.build Removed rzbochs 2022-12-04 16:53:58 +01:00
pid.c Convert dp commands to the rzshell (#3047) 2022-09-27 01:21:25 +08:00
plugin.c librz: do not duplicate plugins (#3313) 2023-01-23 12:51:09 +00:00
README.md librz: add some initial documentation (#3782) 2023-10-13 13:46:19 +08:00
serialize_debug.c Format according to clang-format-13 2021-11-25 15:44:28 +08:00
snap.c hash: use RzHash in most hash APIs 2022-06-28 21:55:26 +08:00
trace.c Add user pointer to RzListComparator (#4204) 2024-02-11 13:28:33 +08:00