The plugin wouldn't properly trace breakpoint hits on different threads
since they weren't switched to and the events weren't always handled.
Also, since the breakpoints are removed after they are found in one of the
threads, it's best to stop all threads for now even if dbg.threads is false.
New threads were only added after being attached to manually or if
dbg->trace_clone was true. dbg->trace_clone stops debug and switches the
new thread now.
Instead of unsetting breakpoints they were set again without removing
the previous drx values, which also caused the "Invalid DRX length (0)
must be 1, 2, 4, 8 bytes" error because of the wrong len values.
Also, when resetting twice, del failed since there weren't any hw
registers to delete, which caused the "hw breakpoints not yet
Previously, `dp=` wouldn't fully switch to the given process since it was
treated like `dpt` thread switching, leaving the debugger in an undefined state.
Previously, the command didn't show the pid's path, replaced the path
field with current/ppid, and showed the ppid instead of only showing the
requested process and the children of the requested process.
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 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
* 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
* Reimplement r_buf_fread/fwrite
* Add slice buffer and introduce readonly field
* Do nothing if size is 0
* Prevents an overflow when 8 is subtracted from size.
* Fix ragg2 when patching outside currently existing buffer
* Implement r_mem_mmap_resize for systems where mremap is not defined
* r_buf_buffer can be called with no size arg as well
* Use size_t instead of ut64
* Use r_buf_size to get the size of a buffer, not the private field
* Use r_buf_seek instead of adjusting the private cur RBuffer field
* use r_buf_read instead of r_buf_read_at(.., cur, ..)
* Fix RBuffer usage in REgg
* Introduce r_buf_tell API instead of using seek
* write_at(cur) == write
Getting couple of process info, to get the full path name
it would require a bit more calls while not sure it worths it
but we get at least the exe name and figuring out its status.