Commit graph

183 commits

Author SHA1 Message Date
Florian Märkl
0b5e78e923
Make size arg of r_file_slurp() size_t (#16221) 2020-03-15 23:34:38 +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
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
3b804c5bc5 Add detailed location info to dpt using pc instead of path ##debug 2020-01-07 21:50:17 +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
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
yossizap
21ec674969 Allow debug plugins to modify pid/tid on select ##debug
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.
2019-12-04 10:55:29 +01:00
yossizap
129158101f Fix linux_set_options error ##debug
Previously, setting options would fail sometimes since PT_ATTACH's attach
SIGSTOP wasn't hit before reaching linux_set_options.
2019-12-04 10:55:29 +01:00
yossizap
7823430724 Add process selection to linux native 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-04 10:55:29 +01:00
yossizap
164e2cca23 Show all processes for pid 0 using dp ##debug 2019-12-01 11:44:15 +01:00
yossizap
a99c8026bd Improve linux native debug dp output ##debug
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.
2019-11-30 00:50:18 +01:00
Armin Weihbold
82047cc580 Add experimental ymm regs support for linux-x64 and extend drm command ##debug 2019-11-07 17:23:18 +01:00
Johannes
5d76b9ff99 fix linux x86 build (#15395) 2019-11-01 02:54:48 +01:00
radare
f639c3b6a1
Fix build for 32bit Linux systems ##build (#15384) 2019-10-30 13:04:25 +01:00
Armin Weihbold
b9874fb102 Add support for setting xmm registers on linux (#15365) ##debug 2019-10-27 17:38:36 +01:00
yossizap
74c54e24bb Added a way to break while in dbg_wait (continue, step etc) ##debug 2019-10-26 11:02:23 +02:00
Armin Weihbold
5742c3498c Fix xmm register offsets (#15360) 2019-10-25 19:41:18 +02:00
Armin Weihbold
fbd68eb1ce Fix drm[bwdq] command, add xmm0h/l and xmm8-15 registers (#15354) ##debug 2019-10-25 17:12:34 +02:00
Riccardo Schirone
7cd93eef9b Fix the way linux debugging options are set (#15323) ##debug
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.
2019-10-24 01:47:37 +02:00
yossizap
d9fa409563 Added support to thread switching in linux and fix r_debug_select ##debug 2019-10-17 19:21:58 +02:00
yossizap
f6bda32cb9 Fixed ptrace 'Operation not permitted' errors (#15287) ##debug 2019-10-16 13:08:38 +02:00
pancake
3be447f2c5 Fix debugger build for native GNU/Linux on RISC-V ##debug 2019-10-16 09:29:37 +00:00
Armin Weihbold
9b9103e00a Enhance drm command, add drm xmm0 functionality (#15214) ##debug
* Add shorthand versions of `drm` - `drm[bwdq]`
* Add mmx register to linux-x64
2019-10-10 04:40:08 +02:00
Armin Weihbold
db1b79b125 Fix #13118 - drf st0 - fpu regs (#15241) 2019-10-10 04:37:37 +02:00
Armin Weihbold
a4954a221e Fix drf output formatting ##debug 2019-10-09 10:18:30 +02:00
Anton Kochkov
20e19d6023 More spelling fixes in the code 2019-06-20 13:36:02 +08:00
pancake
3fe39f0c38 wzr/zr/xzr register on arm64 is wired to ground ##anal 2019-06-19 18:00:51 +02:00
xarkes
47153d9dfd Fixed missing parameter for linux i386 (#14026) 2019-05-10 12:44:52 +02:00
Florian Märkl
23e906ea70 Fix some warnings 2019-05-10 10:57:29 +02:00
pancake
5d646d3551 Fix some warnings in the linux-debugger code 2019-05-08 11:59:57 +02:00
Cyrill Leutwiler
501f6ab016 Fix dg in Linux by using r_debug_ptrace instead of ptrace ##debug 2019-04-21 00:38:36 +02:00
Johannes
a3568f0098 Fix musl compatibility - ARM_VFPREGS_SIZE is defined in asm/ptrace.h (#13427) 2019-03-18 22:37:35 +01:00
pancake
9930fd82d1 Fix Linux debugger crash regression 2019-01-14 00:18:09 +01:00
radare
18931ff3fb
Fix debugger regression in Android ##debugger 2019-01-24 05:22:56 +08:00
pancake
709ffb60b6 Fixes for the android build and related warnings 2019-01-21 12:10:33 +01:00
David CARLIER
2eb706029c Few code/cleanups mem leaks potential (#12591) 2018-12-31 00:21:47 +01:00
pancake
a6f943d87d Fix musl build (required for Alpine) 2018-12-18 18:24:09 +01:00
pancake
842dadc41d Add mips software breakpoint in the macro 2018-11-27 10:19:07 +01:00
radare
d05292e485
Fix 80 warnings coming from gcc8.2 (#12280) 2018-11-22 22:11:43 +01:00
lzutao
b790439e28 Cast arguments to ut8 when feeding ctype.h functions ##refactor
The behavior of the `<ctype.h>` functions is undefined for negative
arguments (other than `EOF`). In such a situation, the argument should
be cast to `unsiged char` for safety.

References:
 - C Programming: A Modern Approach, 2nd Edition: page 612, chapter 23.5
2018-11-06 13:40:00 +01:00
Florian Märkl
daddf534e3 Fix #11799 - Fix ptrace warnings (#11800) 2018-10-12 18:15:46 +02:00
Florian Märkl
0c0fee7b48 ptrace-wrap (#11723)
* Add ptrace-wrap
* Add r_io_ptrace* and r_debug_ptrace()
* Use wrappers instead of calling ptrace and fork directly
* Sleep while waiting in linux_debug
* Add ptrace-wrap Makefile
* Link io against ptrace-wrap with acr
* Define ptrace usages in r_userconf.h
* Conditional ptrace-wrap in acr
* Fix HAVE_PTRACE
* Some fixes for Solaris
* Fixes for FreeBSD
* More fixes for Solaris
* Style Fix
2018-10-12 12:20:18 +02:00
pancake
41ec949204 Fix #11112 - Rename {srwx,flags,perms} to perm. (-21 LOC)
Unify R_IO, R_BIN, R_BP, .. into R_PERM_* using 1 letter syntax
2018-09-22 11:31:45 +02:00
radare
f85ebe34cb
Fix #11437 - syscall calling conventions for x86-64 (#11549)
* Fix windows x64 fastcall conventions
2018-09-17 12:46:59 +02:00