У меня есть эта функция C в огромном коде:Невозможно породить оболочку с помощью GDB
void test() {
char *arg[] = {"/bin/sh", 0};
execve("/bin/sh", arg, 0);
}
Я пытаюсь отлаживать этот код с помощью GDB
(gdb) call test() process 1948 is executing new program: /bin/dash warning: Selected architecture i386:x86-64 is not compatible with reported target architecture i386 Architecture of file not recognized. An error occurred while in a function called from GDB. Evaluation of the expression containing the function (test) will be abandoned. When the function is done executing, GDB will silently stop.
Следовательно, оболочка не нерест. Как это сделать?
Какую версию gdb вы используете? – Hasturkun
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4.2012.04 – leet
Запускает ли оболочка нормально, если запускается без gdb? – teppic