* Fix for ar= and dr= and add tests
* increase width to accomodate register name larger than 4 chr
* fix flag type register value not printed
* update r_debug_reg_list() to accept '=' arg
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.
This way it is possible to set breakpoints before starting debug through
'db' and the user will be notified when a breakpoint points to an
invalid map.
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
attach_new_process was called instead of regular attach because the
saved pid and tid in core->dbg weren't reset before calling r_debug_select
in a new session. Made sure this won't be a problem when using dp= after
dp- either.
Calculate the diff ourselves since bp->delta is calculated with the
dbg->bp->baddr at the time of breakpoint creation, which may not
reflect the correct baddr and break the rebase.
* Add ppid to win32 debug and 'dp''s display/json ##debug
* Add process selection to w32 debug ##debug
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.
The plugin would try to work with an old version of desc that was already
freed by r_io_close_all after closing the session. I set debug_gdb's
global 'desc' to NULL in detach as a temporary solution. We should convert
to **desc to keep an updated copy of the pointer.
Most servers/clients should have xml support by now so it should behave
like `dp` in any other debugger. vFile is the only way to get detailed pid info unfortunately.
Previously, when using `dp=`, the debug plugin would set a new tid based
on the requested pid, but r_debug_select would set the old tid as dbg->tid,
resulting in issues interacting with the current thread. This could also
be an issue when the requested pid/tid is invalid and the plugin selects
something else.
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.