The user was interrupted during continue and switched to a different
thread since DebugBreakProcess creates a thread that triggers a breakpoint.
With these changes the DebugBreak thread is recorded to skip the breakpoint
event afterwards.
* Fixed w32dbg breaking issues and moved break_push to w32_dbg_wait to support stepping as well
Previously, breaking would only work during 'dc' because it was pushed
in debug.c specifically for continue. This change moves the
responsibility of pushing/popping w32_break_process_wrapper to
windows_debug.c instead to support calls to w32_dbg_wait from anywhere.
* Fixed issues in windows thread switching by implementing thread attach for w32dbg =!pid
Previously the function attempted to OpenProcess even though the main
pid is already opened by __open and the fact that re-opening the main
pid wouldn't do anything. This way it attaches to new threads when
called by r_debug_select.
* Modified w32_continue to update rio->pi.dwThreadId after switching to the requested thread
Manually changing iop->pi.dwThreadId in io_w32dbg's =!pid created a
problematic scenario when w32_continue is called with the last event's
tid from dbg_wait. This solution makes sure iop->pi.dwThreadId keeps
being updated after events on other threads arrive and that w32_continue
actually uses the given tid.
* Modified w32_continue return values
In linux_attach_single_pid there is a check to avoid calling PT_ATTACH
multiple times on an already traced pid, which is an operation that
should be done only one time. The old code supposedly tried to set the
options only the first time you attach to a process, however when
debugging a process through the io_ptrace plugin, the process uses
TRACEME and the code never set the options of ptrace to intercept the
process before dying, amongst other things.
This patch addresses this issue by just always setting ptrace options.
Those options could be changed by the user during the life of the debug
session, so it's not an operation that should be done only one time.
* Added ba2 so that the gdbserver backend connects correctly
* Fixes to remote gdb register writes:
1. Byte order is target-defined. Use cfg.bigendian for now. Possibly get it from target later?
2. Register number should be hexadecimal.
* Linux debug plugin, page promotion feature proposal.
Providing new 'dmL' debugger sub command.
This is the only system having THP feature, others are more into
direct huge tlb equivalent ...
The system ought to be set in madvise mode and disabled on Android,
would not do any good in this environment if this is ever supported.
Once the syscall succeed, the address range ought to get the
little 'hg' VmFlags.
* interface changes