Commit graph

4 commits

Author SHA1 Message Date
Ivan Roberto de Oliveira 7a019ac317 Prepare for full LLE implementation 2018-03-05 13:39:27 -03:00
Matt Borgerson 126fbd13a5 Fix issue with GDB breakpoints
This patch fixes an issue with GDB breakpoints where continuing after a
breakpoint would cause an invalid instruction exception. This was due
to how GDB sets soft breakpoints, and how Unicorn records the state
after emulation is halted.

GDB sets soft breakpoints using the single byte `int3` instruction
(CCh).  After the instruction executes, EIP will point to the next
instruction, which is likely to be in the middle of the instruction we
are trying to break on! In this case, roll EIP back by 1 so that when
GDB resumes execution, EIP is will be in the correct place.

An issue with calling kernel functions is also fixed. This was due to
how `hlt` instructions are used to enter kernel functions. If we are
single stepping code, execution will stop before the `hlt` is executed
but the code which looks to see if we are entering a kernel function
would execute and incorrectly calculate the import number.
2017-12-27 14:08:57 -07:00
Matt Borgerson 803f16b752 Update README 2017-12-25 21:37:23 -07:00
Matt Borgerson 94af31d238 Add GDB server to enable CPU debug
This patch adds support for remote debugging of the guest via the GDB
debugger. Once enabled, the emulator will open a TCP socket and wait
for the GDB client to connect upon startup before beginning XBE
execution.
2017-12-22 15:31:59 -07:00