Commit graph

289 commits

Author SHA1 Message Date
pancake
55e0804d1d Fix some null-terminated strings issues in the procfs parsing 2016-06-20 18:22:25 +02:00
Joshua J. Drake
0431a0efdf Properly handle forks on Linux 2.5.46+ (#5153)
Linux 2.5.46 made changes to the ptrace(2) API to inform a tracer when various
events occur. These are known as PTRACE_EVENTs. Start handling PTRACE_EVENTs
by:

 * Handling PTRACE_EVENT_FORK and PTRACE_EVENT_EXIT
 * For _FORK, stores the newly created pid in dbg->forked_pid
 * Add the "dpc" command to select the most recently forked child process.
 * Add the "dpc*" command to show the recently forked process' pid.

Additional minor changes to white space are included.

NOTE: This partially addresses #3549. It does handleLinux before 2.5.46.
2016-06-17 04:20:18 +02:00
Joshua J. Drake
9c21df9272 Minor cleanups to process handling (#5152)
* Fixed 'dpk' handling (signal wasn't being groked)
* Mostly comments added
* Some eprintfs added
2016-06-17 01:59:10 +02:00
Joshua J. Drake
fb820f9c8e Fixes #4875: Refactor process listing (#5144)
* Fixes #4875: Refactor process listing
* Move procfs-based process listing into linux_debug.c, guarded by __linux__
* Provide a warning and eprintf a TODO on the remaining platforms.
* Break reusable parts into linux_get_proc_pid and call it as needed.
* Add/remove comments for clarity
* Address feedback and re-enable non-Linux
2016-06-16 22:39:11 +02:00
pancake
e032a48cbe Fix latest 26 COVs 2016-06-14 23:47:58 +02:00
Jeffrey Crowell
ed47ce4fb3 add missing ; in debug_native.c 2016-06-09 21:16:02 +00:00
leberus
6b1a46be23 Add: Generate Coredump - added support for threads and x86 (#5104)
* Add: Generate Coredump - added support for threads and x86

* Fix: debug_native.c allow coredump for i386 too
2016-06-09 22:23:39 +02:00
Joshua J. Drake
a4b21680d8 Re-work r_debug_native_map_get to fix issues (#5108)
* Fixes #4972
* Check more return values
* Improve error reporting
* Minor formatting fixes
2016-06-09 22:12:16 +02:00
Anton Kochkov
24c0dfc961 Do not include coredump.h for non x86 2016-06-02 08:07:12 +03:00
Anton Kochkov
c7f1f7a87b Add missing header for linux coredump 2016-06-02 07:55:31 +03:00
pancake
d3394d5a7a Fix latest 28 COVs 2016-06-02 03:19:31 +02:00
Sven Steinbauer
547f8bbc5c Infer fixes Round 2 (#4993) 2016-05-24 22:22:15 +02:00
Oscar Salvador Vilardaga
876f3fd547 Initial coredump support for Linux-x86-64 (no threads yet)
* http://man7.org/linux/man-pages/man5/core.5.html
* Able to dump the header and the program headers
* Checks /proc/[pid]/coredump_filter to know which maps should be dumped
* Check for bit 6 to 0 (priv/share anon mappings, priv/share file-backed, elf hdr, priv/share huge pages)
* Missing: priv/share DAX pages
2016-05-21 12:27:13 +02:00
SkUaTeR
75ea9cea3c Fix w32 debugger 2016-05-11 13:09:40 +02:00
Riccardo Schirone
26fc8f92ef libr: remove some unused variables and functions 2016-04-27 12:59:45 +02:00
pancake
6dfb95e9c5 Drop some unsupported debug features for osx-ppc 2016-04-27 11:40:42 +02:00
pancake
d24bc909ec Update sdb for osx-ppc and other 0.10.2 updates 2016-04-27 00:25:28 +02:00
pancake
280abd4f77 ARM can't hwstep by default 2016-04-22 10:15:22 +02:00
Jeffrey Crowell
6115d68736 libr/debug/p/debug_native.c: fix possible overflow 2016-04-19 09:08:15 -04:00
Jeffrey Crowell
96686841de handle spaces in shared library paths
fixes #4623
2016-04-18 14:04:38 -04:00
pancake
34a7837079 Include r_lib from r_bp 2016-04-13 14:48:17 +02:00
Jeffrey Crowell
74b5edd984 fix register get in dbg on BSD s/pc/PC 2016-04-11 12:34:42 -04:00
pancake
fe02539afb Fix some warnings for debug.mach0 2016-04-08 01:09:56 +02:00
Daniel Domínguez
71beec242e Coredump generation for Mach0 binaries 2016-04-05 12:03:59 +02:00
pancake
846263a51b Implement ios9 pangu's tfp0 in the debugger 2016-03-14 23:24:49 +01:00
pancake
f7fbbc419e Add dh in anal.x86-64.reg and fix some arm/x86 esil bugs 2016-02-22 01:14:06 +01:00
pancake
74b23f10b9 Merge branch 'xnu' of https://github.com/alvarofe/radare2 2016-02-06 22:37:52 +01:00
Álvaro Felipe Melchor
efa2a8ecdf xnu: step, breakpoint working with mach exception 2016-02-06 19:53:29 +01:00
Álvaro Felipe Melchor
feea7f4d17 xnu: change logic handle exception
instead of a thread waiting for incoming messages, i've implemented
wait functionality above mach_msg, now i have to make it work
with r2 and avoid while (1) in the code, understand better the
references and start thinking about edge cases
2016-02-02 20:27:57 +01:00
pancake
44a86928cc Fix some of the warnings in #4013 2016-01-27 03:14:19 +01:00
pancake
90e2fc3031 Fix reg-write in gdb-thumb and tiny io cache optimization 2016-01-27 00:26:49 +01:00
Álvaro Felipe Melchor
c372743315 xnu: get rid of ptrace even for attach and detach
some rework in order to handle mach message as mach_exc_server and alike does
api change in plugin debug, now the function detach receive a pointer to RDebug
trying to deallocate port when are not needed any more
2016-01-23 22:50:28 +01:00
Álvaro Felipe Melchor
d9e77ca0d1 xnu: first series of patches to use mach exceptions
* use set_trace_bit and clear_trace_bit macros

* use PT_ATTACHEXC since PT_ATTACH will be deprecated in the future
and we are interested in receiving mach exceptions

* first attempt to handle mach exceptions

* api change: added a parameter to r_core_setup_debugger
at least in OS X this function was producing double attachment.
I've added a boolean value to indicate when use dpa.

* added pipe to communicate between main process and traced process
by far this is not a good implementation. We should develop a better
approach/design to save all the exceptions and handle them accordingly.
This is the initial implementation

* bring back ptrace for stability and in order to merge this into master
2016-01-18 22:24:16 +01:00
pancake
9051fed9e9 Fix #3951 - rarun2 with stdin and support for strings 2016-01-13 22:15:13 +01:00
pancake
40e08dbd89 Get rid of _Bool 2015-12-01 12:39:12 +01:00
pancake
2b51bf1acd Fix #3759 - ood on OSX 2015-11-25 11:52:29 +01:00
skuater
513200a7fa Fixes for the w32 debugger 2015-11-24 23:28:50 +01:00
pancake
46b5340093 Fix various inconsistencies in the iOS debugger 2015-10-31 00:51:44 +01:00
pancake
77d34628d7 Fix @b: 2015-10-23 17:11:04 +02:00
pancake
a05ac7eaa4 RDebugPlugin.arch.typeof(char*) 2015-10-22 03:11:03 +02:00
skuater
99e2333395 dbg.libs/dbg.unlibs implementation. 2015-10-16 11:23:32 +02:00
Riccardo Schirone
6420f03107 debug/p/debug_native: don't waitpid only on IOS
waitpid is necessary on OS X.
2015-10-15 22:13:12 +02:00
skuater
c72caa67ac Implement dbg.libs/unlibs for w32 2015-10-13 02:18:14 +02:00
pancake
7a04833eac Little refactoring for w32dll handling from rdebug 2015-10-12 18:49:16 +02:00
pancake
747c7bbacb More fixes for io.mach.write 2015-10-11 03:07:53 +02:00
pancake
196d7db68d Honor asm.bits=64 in ios.dbg, very wip much test 2015-09-22 01:49:14 +02:00
pancake
b86bf19c85 Fix #3051 - Honor CFLAGS everywhere and fix some windows/android warnings 2015-09-14 20:43:11 +02:00
pancake
49975ccf95 Fix #3286 - Use stdbool.h 2015-09-14 02:08:31 +02:00
Álvaro Felipe Melchor
1d4ebdeb25 some refactoring & added threads field in RDebug 2015-09-01 18:45:08 +02:00
skuater
b9569ad92a Implementation 'dd' for windows debugger. 2015-08-26 23:34:52 +02:00