UFO: Alien Invasion
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
android_debugger.cpp
Go to the documentation of this file.
1
/* This function will dump stack trace to logcat and continue running on Android OS */
2
#include <stdio.h>
3
#include <stdlib.h>
4
#include <unistd.h>
5
#include <ctype.h>
6
#include <signal.h>
7
#include <errno.h>
8
#include <android/log.h>
9
#include "
android_debugger.h
"
10
11
/* TODO: it does not work */
12
13
static
sighandler_t
debuggerHandler
;
14
15
static
void
mySignalHandler
(
int
sig)
16
{
17
debuggerHandler
(sig);
18
signal( sig,
debuggerHandler
);
19
}
20
21
void
androidDumpBacktrace
(
FILE
* out)
22
{
23
__android_log_print(ANDROID_LOG_INFO,
"UFOAI"
,
"Backtrace on Android does not work currently, you need to actually crash your code to get backtrace"
);
24
/*
25
debuggerHandler = signal(SIGSEGV, mySignalHandler);
26
__android_log_print(ANDROID_LOG_INFO, "UFOAI", "Backtrace (run command \"arm-eabi-gdb libapplication.so -ex 'list *0xaabbccdd'\" where aabbccdd is a stack address below):");
27
if (debuggerHandler == SIG_IGN || debuggerHandler == SIG_DFL || debuggerHandler == SIG_ERR) {
28
__android_log_print(ANDROID_LOG_INFO, "UFOAI", "Getting backtrace failed, you have very custom or broken Android firmware");
29
signal(SIGSEGV, debuggerHandler);
30
return;
31
}
32
raise(SIGSEGV);
33
*/
34
}
debuggerHandler
static sighandler_t debuggerHandler
Definition:
android_debugger.cpp:13
FILE
#define FILE
Definition:
test_webapi.cpp:30
mySignalHandler
static void mySignalHandler(int sig)
Definition:
android_debugger.cpp:15
android_debugger.h
androidDumpBacktrace
void androidDumpBacktrace(FILE *out)
Definition:
android_debugger.cpp:21
src
ports
android
android_debugger.cpp
Generated on Mon Feb 24 2020 05:28:06 for UFO: Alien Invasion by
1.8.8