staging: android: Add generic fiq serial debugger

Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Change-Id: I6c0e1a17c45f077b45cb29287648e901b62abab0
This commit is contained in:
Huibin Hong
2021-04-15 16:47:24 +08:00
committed by Tao Huang
parent b03bca5eae
commit 67ab450d38
5 changed files with 10 additions and 10 deletions

View File

@@ -27,6 +27,8 @@ config DEBUG_KINFO
source "drivers/staging/android/ion/Kconfig"
source "drivers/staging/android/fiq_debugger/Kconfig"
endif # if ANDROID
endmenu

View File

@@ -2,6 +2,7 @@
ccflags-y += -I$(src) # needed for trace events
obj-y += ion/
obj-$(CONFIG_FIQ_DEBUGGER) += fiq_debugger/
obj-$(CONFIG_ASHMEM) += ashmem.o
obj-$(CONFIG_DEBUG_KINFO) += debug_kinfo.o

View File

@@ -599,7 +599,7 @@ static bool fiq_debugger_fiq_exec(struct fiq_debugger_state *state,
unsigned long va_start;
#ifdef CONFIG_ARM64
va_start = VA_START;
va_start = PAGE_END;
#else
va_start = PAGE_OFFSET;
#endif

View File

@@ -212,7 +212,7 @@ static struct frame_tail *user_backtrace(struct fiq_debugger_output *output,
struct frame_tail buftail[2];
/* Also check accessibility of one struct frame_tail beyond */
if (!access_ok(VERIFY_READ, tail, sizeof(buftail))) {
if (!access_ok(tail, sizeof(buftail))) {
output->printf(output, " invalid frame pointer %px\n",
tail);
return NULL;

View File

@@ -157,21 +157,18 @@ struct stacktrace_state {
unsigned int depth;
};
static int report_trace(struct stackframe *frame, void *d)
static bool report_trace(void *data, unsigned long pc)
{
struct stacktrace_state *sts = d;
struct stacktrace_state *sts = data;
if (sts->depth) {
sts->output->printf(sts->output, "%pF:\n", frame->pc);
sts->output->printf(sts->output,
" pc %016lx fp %016lx\n",
frame->pc, frame->fp);
sts->output->printf(sts->output, "[<%016lx>] %pS:\n", pc, pc);
sts->depth--;
return 0;
return true;
}
sts->output->printf(sts->output, " ...\n");
return sts->depth == 0;
return sts->depth != 0;
}
void fiq_debugger_dump_stacktrace(struct fiq_debugger_output *output,