1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-21 05:12:07 +00:00
serenity/Libraries/LibDebug
Itamar f9d62fd5e5 LibDebug: Make sure to not single step the program twice
After hitting a breakpoint, we single step the program to execute the
instruction we breaked on and re-enable the breakpoint.
We also single step the program when the user of LibDebug returned a
DebugDecision::SingleStep.

Previously, if we hit a breakpoint and then were asked to to a
DebugDecision::SingleStep, we would single step twice.

This bug can actually crash programs, because it might cause us to
skip over a patched INT3 instruction in the second single-step.

Interestingely enough, this bug manifested as functrace crashing
certain programs: after hitting a breakpoint on a CALL instruction,
functrace single steps the program to see where the CALL jumps to
(yes, this can be optimized :D). functrace crashed when a CALL
instruction jumps to another CALL, because it inserts breakpoints on CALL
instructions, and so the INT3 in the 2nd CALL was skipped over, and we
executed garbage :).

This commit fixes this by making sure not to single-step twice.
2020-05-24 10:42:21 +02:00
..
Dwarf LibDebug: Tolerate missing debug information 2020-05-24 10:42:21 +02:00
CMakeLists.txt Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
DebugInfo.cpp LibDebug: Tolerate missing debug information 2020-05-24 10:42:21 +02:00
DebugInfo.h LibDebug: Add support for creating VariableInfo for paramters 2020-05-09 23:41:08 +02:00
DebugSession.cpp LibDebug: Make sure to not single step the program twice 2020-05-24 10:42:21 +02:00
DebugSession.h LibDebug: Make sure to not single step the program twice 2020-05-24 10:42:21 +02:00