Add support for iOS tfp0 debugging

This commit is contained in:
pancake 2015-07-01 18:41:43 +02:00
parent dc6ab3c1ca
commit 02ab1d68a1
2 changed files with 20 additions and 6 deletions

View File

@ -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;

View File

@ -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) {