Commit graph

104 commits

Author SHA1 Message Date
radare
0cacc6e829
Fix file reopen in debug mode ood/doo (#16131) ##debug 2020-03-05 14:42:32 +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
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
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
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
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
842dadc41d Add mips software breakpoint in the macro 2018-11-27 10:19:07 +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
Neven Sajko
4a722e80d8 Add braces to if, else, for, while ... (#11504) 2018-09-13 10:17:26 +02:00
Neven Sajko
d8784641ee Add parentheses in macros where needed for safety (#11290) 2018-08-30 13:16:50 +02:00
Fangrui Song
6e776b986a Fix some warnings in debug (#10929) 2018-08-05 11:56:15 +02:00
pancake
4eec87cdf6 More warnings fixed 2018-07-14 10:58:19 +02:00
Andrea Sindoni
238cbbfc11 Add stop address info to the "di" command (#10445) 2018-06-22 13:17:40 +02:00
radare
9e08da0fa6
Improve build of libr.a and libr.dylib, fix and improve sys/ios-sdk.sh (#10046)
- Update spp and force hidden visibility
- Use R_API wisely
- RSys.prefix returns const things
- Use -install_name on Apple
- Fix merged lib visibility linking on Linux
- Use OSTYPE instead of BUILD_OS
- Honor crosscompiler-objcopy and support android like linux
- Add extra missing archives
- Fix for android
- Upgrade spp and sdb
- Skip libr. from symstall
- Add --enable-merged configure option
- Use --enable-merged on ios-sdk
- Upgrade sdb again for js0n
- Kill sys/ios-shell.sh
- Msvc dynamic build fix
2018-05-09 23:31:52 +02:00
Fangrui Song
320a2d5a58 Add FUNC_ATTR_USED and fix some warnings (#9413) 2018-02-17 20:19:33 -06:00
pancake
4e44e8e18e Fix compilation warnings on Linux 2018-02-09 18:45:54 +01:00
Khairul Kasmiran
9484bdb622 Fixed r_debug_native_reg_profile const qualifier warning 2017-12-31 20:59:52 +08:00
Khairul Kasmiran
0c048b2774 Moved some static prototypes into their source file 2017-12-20 22:38:20 +08:00
pancake
b07653dbe3 Fix #8751 - Infinite loop when a signal is received in the middle of a step-over 2017-10-31 14:28:08 +01:00
Fangrui Song
d9608fe186 Support powerpc64 PTRACE_GETREGS (#8529)
On BSD, addr and data are swapped. But on Linux, only SPARC strays.

Goodbye SPARC and Solaris.
2017-09-16 02:33:52 +02:00
pancake
ac63497b5a Remove harmless attach warning and support sparc in get/set-regs 2017-09-15 13:08:16 +02:00
xarkes
c1f6b29e8e Windbg code cleaning 2017-08-08 18:45:11 +02:00