mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-01 11:11:56 +00:00
Add support for iOS tfp0 debugging
This commit is contained in:
parent
dc6ab3c1ca
commit
02ab1d68a1
@ -364,9 +364,16 @@ static int __plugin_open(RIO *io, const char *file, ut8 many) {
|
||||
|
||||
static RIODesc *__open(RIO *io, const char *file, int rw, int mode) {
|
||||
char uri[128];
|
||||
int pid;
|
||||
if (__plugin_open (io, file, 0)) {
|
||||
int pid = atoi (file+6);
|
||||
if (pid == 0) {
|
||||
const char *pidfile = file + 6;
|
||||
if (!strcmp (pidfile, "0")) {
|
||||
pid = 0;
|
||||
} else {
|
||||
pid = atoi (pidfile);
|
||||
if (pid <1) pid = -1;
|
||||
}
|
||||
if (pid == -1) {
|
||||
pid = fork_and_ptraceme (io, io->bits, file+6);
|
||||
if (pid==-1)
|
||||
return NULL;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* radare - LGPL - Copyright 2009-2014 - pancake */
|
||||
/* radare - LGPL - Copyright 2009-2015 - pancake */
|
||||
|
||||
#include <r_userconf.h>
|
||||
|
||||
@ -215,14 +215,21 @@ static int debug_attach(int pid) {
|
||||
static RIODesc *__open(RIO *io, const char *file, int rw, int mode) {
|
||||
RIODesc *ret = NULL;
|
||||
RIOMach *riom;
|
||||
const char *pidfile;
|
||||
char *pidpath;
|
||||
int pid;
|
||||
task_t task;
|
||||
if (!__plugin_open (io, file, 0))
|
||||
return NULL;
|
||||
pid = atoi (file+(file[0]=='a'?9:7));
|
||||
if (pid<1)
|
||||
return NULL;
|
||||
pidfile = file+(file[0]=='a'?9:7);
|
||||
if (!strcmp (pidfile, "0")) {
|
||||
/* tfp0 */
|
||||
pid = 0;
|
||||
} else {
|
||||
pid = atoi (pidfile);
|
||||
if (pid<1)
|
||||
return NULL;
|
||||
}
|
||||
task = debug_attach (pid);
|
||||
if ((int)task == -1) {
|
||||
switch (errno) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user