Commit Graph

1517 Commits

Author SHA1 Message Date
radare
3f77b9a76b
Avoid duplicated module filenames to fix static.sh ##build (#16403) 2020-04-02 14:30:27 +02:00
Florian Märkl
2c7ecc9736
Even more R2R (#16348)
* Fix r2r without FILE
* Fix many tests for r2r-c
* Pipe stdin in r2r to make isatty() return false
* Fix a leak in r2r
* Fix lock usage in RThread
* Always print stderr on failed tests
* Break broken zip tests
* Add -j arg to r2r
* Temporarily disable some tests that js and v don't parse
* Fix ar= trailing newline
2020-03-29 18:07:44 +02:00
Zi Fan
fec0aea039
Decouple shlr/gdb registers profile from code (#16312) ##debug
* Sync r2 debugger registers profile with shlr/gdb
* Add new set_reg_profile function to r_debug plugin
* Add set_reg_profile to r_debug_plugin_gdb
* Change "drp" to sync r_debug plugin register profile
* Fix incorrect pointer arithmetic and code style
2020-03-27 02:00:27 +01:00
Florian Märkl
0eb98d24be
Fix all Warnings for GCC 9 (#16223) 2020-03-17 13:31:28 +01:00
Florian Märkl
0b5e78e923
Make size arg of r_file_slurp() size_t (#16221) 2020-03-15 23:34:38 +01:00
Khairulmizam Samsudin
bb389101da
Make r_reg_get_list() search harder (#16202) ##reg 2020-03-13 12:01:54 +01:00
radare
0cacc6e829
Fix file reopen in debug mode ood/doo (#16131) ##debug 2020-03-05 14:42:32 +01:00
radare
f74dd31440
Fix debugger build on Linux/s390x ##build (#16105) 2020-03-03 00:03:43 +01:00
radare
5e629a3260
Avoidify the strTrim() APIs + cleanup/refactor ##util (#16056) 2020-03-02 21:39:37 +01:00
radare
6ae8806411
Do not use the elvis operator for bool expressions (#16073) 2020-02-28 15:19:37 +01:00
Anton Kochkov
9ae41ae69f
Revert "Avoidify the RUtil.strTrim() APIs, rename trimHeadTail() and add asserts in RConfig ##refactor" (#16055)
This reverts commit 38b61c7bcf.
2020-02-26 09:59:04 +08:00
radare
38b61c7bcf
Avoidify the RUtil.strTrim() APIs, rename trimHeadTail() and add asserts in RConfig ##refactor 2020-02-25 17:53:09 +01:00
pancake
5677390ca6 Fix #10696 - Kill r_io_map_add_next_available
The function is just renamed to be reused and we have no tests for it, but it may fall into an infinite loop
2020-02-24 01:16:14 +01:00
Khairulmizam Samsudin
17026c8c62
Fix show register value in column (#16010) ##debug
* 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
2020-02-20 16:26:29 +01:00
Florian Märkl
14215350af Refactor RAnal Basic Blocks and Functions (#15169) ##anal
Basic Blocks are now global instead of owned by a single function.
2020-01-15 15:23:34 +01:00
Anton Kochkov
f3a0a3d01c Some coverity fixes 2020-01-10 12:30:23 +01:00
pancake
0e34303648 Third fix attepmt for musl builds 2020-01-10 03:50:30 +01:00
pancake
5a48a40178 Second fix attempt for Alpine/musl builds 2020-01-10 03:32:13 +01:00
pancake
52d9baf988 Aim to fix the alpine build 2020-01-10 03:06:46 +01:00
yossizap
2e5f4b41b4 Fix multithreaded breakpoint behavior in linux ##debug
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.
2020-01-10 00:30:18 +01:00
yossizap
ed1f42085c Attach to new linux threads on creation ##debug
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.
2020-01-10 00:30:18 +01:00
radare
c3651a43ec
Fix debugger build on linux-s390x ##debug
* Add s390x reg profile
* Add missing pc register
* Use gregset instead of regset
2020-01-09 15:21:41 +01:00
yossizap
0de7c21bcc Always unset bps after continue and step hard ##debug (#15772)
Breakpoints were left in disassembly after a signal/break and there
are probably other cases that may lead to it.
2020-01-09 12:00:24 +01:00
Anton Kochkov
0c46c3e1e3 Some coverity fixes 2020-01-08 14:16:11 +01:00
yossizap
3b804c5bc5 Add detailed location info to dpt using pc instead of path ##debug 2020-01-07 21:50:17 +01:00
pancake
836ea638b7 Revert "Validate bp addr on rebase and restore instead of preventing creation ##debug (#15750)"
This reverts commit e503bdd9c2.
2020-01-03 01:35:05 +01:00
yossizap
e503bdd9c2 Validate bp addr on rebase and restore instead of preventing creation ##debug (#15750)
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.
2020-01-03 00:57:18 +01:00
yossizap
3f7dd9a47f Fix hardware bp restoring and fix hwbp repeating errors ##debug (#15749)
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
2020-01-03 00:56:54 +01:00
yossizap
230d2364f4 Add location in file to linux dpt output ##debug (#15744)
Shows the module, offset and function name instead of showing the executable's
path for all threads
2020-01-03 00:56:15 +01:00
yossizap
9a6bcce392 Fix windows dp showing the parent's path for all processes (#15741) 2020-01-01 20:39:45 -06:00
GustavoLCR
21781aa0d1 Fix #15734 - Automatically download PDB file if pdb.autoload=1 (#15738)
* Automatically download PDB file if pdb.autoload=1
* Don't re-download pdb if it already exists on the symstore
* Only download if file doesn't exist
2020-01-01 20:37:28 -06:00
David CARLIER
bac525d8e9 Refactoring ptrace register write for BSD ##debug (#15725) 2019-12-29 14:27:34 +01:00
David CARLIER
86768ccfdd Implement bsd_thread_list for FreeBSD ##debug (#15695) 2019-12-29 08:02:25 +01:00
David Carlier
7ee39fb157 Few warning build fixes proposal. 2019-12-27 06:13:53 -06:00
yossizap
59ce43d52c Fix reopening of windows debug after detaching not working ##debug
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.
2019-12-27 02:46:59 -06:00
yossizap
f0027aa263 Fix windows breakpoint rebasing ##debug
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.
2019-12-27 02:46:59 -06:00
David Carlier
28ec4ca297 Debug, BSD systems refactoring ##r_debug
Separate pure BSD calls into its separate compilation unit.
2019-12-20 21:11:30 -06:00
yossizap
bfa40cd5db Fix gdbr reg sync and concurrency ##debug 2019-12-20 10:17:58 +09:00
GustavoLCR
0e19329de7 Fix rebasing for remote GDB on windows 2019-12-19 17:42:22 -06:00
yossizap
6cfdafdf51 Refactor debug native's wait function ##debug
Separate windows, linux and *bsd/apple since they have vastly different
logic and the ifdef jungle implementation was too confusing
2019-12-17 11:04:19 -06:00
David CARLIER
8caa059c9b Refactor signal handling for FreeBSD ##r_debug (#15659)
Solving r_debug_handle_signals build warning issue.
2019-12-17 15:08:50 +01:00
Anton Kochkov
4e8e330475 Fix some MSVC warnings 2019-12-16 12:26:05 -06:00
yossizap
f1de1becfa Add ppid to dp and fix dp= for windows (#15649)
* 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.
2019-12-16 09:24:17 -06:00
yossizap
89a5320e5f Fixed a crash caused by reopening gdb ##debug
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.
2019-12-16 01:23:27 +01:00
GustavoLCR
7e4157bc2b Fix format string in windows_message.c 2019-12-15 23:37:54 +01:00
Paul I
9a4578a915 Replace some strstr() calls with strchr() 2019-12-15 23:37:27 +01:00
yossizap
6f546149cf Fixed gdbr warnings and a dpt crash after debug was over ##debug (#15636)
RDebugPid not being initialized with NULL resulted in a free on an invalid
pointer after gdbr_threads_list failed.
2019-12-15 04:45:11 -06:00
yossizap
28cac248a6 Added an event to signal the end of the debug session ##debug 2019-12-15 10:46:48 +01:00
Anton Kochkov
e11b2a9145
Some Coverity defect fixes (#15626) 2019-12-13 11:25:19 -06:00
yossizap
9fca7b1f58 Fixed an issue with detached child breakpoint inheretence ##debug (#15561)
Previously, forked children would instantly die if the fork was stepped
over using a breakpoint which is accessible to the child process.
2019-12-09 09:52:53 +01:00