mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
Added backtrace to C++ expection handler and memory related fault handlers.
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
/* Genode includes */
|
/* Genode includes */
|
||||||
#include <rm_session/rm_session.h>
|
#include <rm_session/rm_session.h>
|
||||||
|
#include <os/backtrace.h>
|
||||||
|
|
||||||
/* base-internal includes */
|
/* base-internal includes */
|
||||||
#include <base/internal/native_thread.h>
|
#include <base/internal/native_thread.h>
|
||||||
@@ -102,18 +103,29 @@ struct Page_fault_info
|
|||||||
|
|
||||||
void print(Genode::Output &out) const
|
void print(Genode::Output &out) const
|
||||||
{
|
{
|
||||||
Genode::print(out, "pd='", pd, "' "
|
Genode::print(
|
||||||
"thread='", thread, "' "
|
out, "pd='", pd,
|
||||||
"cpu=", cpu, " "
|
"' "
|
||||||
"ip=", Hex(ip), " "
|
"thread='",
|
||||||
"address=", Hex(addr), " "
|
thread,
|
||||||
"stack pointer=", Hex(sp), " "
|
"' "
|
||||||
"qualifiers=", Hex(pf_type), " ",
|
"cpu=",
|
||||||
pf_type & Ipc_pager::ERR_I ? "I" : "i",
|
cpu,
|
||||||
pf_type & Ipc_pager::ERR_R ? "R" : "r",
|
" "
|
||||||
pf_type & Ipc_pager::ERR_U ? "U" : "u",
|
"ip=",
|
||||||
pf_type & Ipc_pager::ERR_W ? "W" : "w",
|
Hex(ip),
|
||||||
pf_type & Ipc_pager::ERR_P ? "P" : "p");
|
" "
|
||||||
|
"address=",
|
||||||
|
Hex(addr),
|
||||||
|
" "
|
||||||
|
"stack pointer=",
|
||||||
|
Hex(sp),
|
||||||
|
" "
|
||||||
|
"qualifiers=",
|
||||||
|
Hex(pf_type), " ", pf_type & Ipc_pager::ERR_I ? "I" : "i",
|
||||||
|
pf_type & Ipc_pager::ERR_R ? "R" : "r", pf_type & Ipc_pager::ERR_U ? "U" : "u",
|
||||||
|
pf_type & Ipc_pager::ERR_W ? "W" : "w", pf_type & Ipc_pager::ERR_P ? "P" : "p");
|
||||||
|
Genode::backtrace();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -236,6 +248,8 @@ void Pager_object::exception(uint8_t exit_id)
|
|||||||
res == 0xFF ? "no signal handler"
|
res == 0xFF ? "no signal handler"
|
||||||
: (res == NOVA_OK ? "" : "recall failed"));
|
: (res == NOVA_OK ? "" : "recall failed"));
|
||||||
|
|
||||||
|
Genode::backtrace();
|
||||||
|
|
||||||
Tukija::revoke(Obj_crd(exc_pt_sel_client(), NUM_INITIAL_PT_LOG2));
|
Tukija::revoke(Obj_crd(exc_pt_sel_client(), NUM_INITIAL_PT_LOG2));
|
||||||
|
|
||||||
enum { TRAP_BREAKPOINT = 3 };
|
enum { TRAP_BREAKPOINT = 3 };
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include <base/slab.h>
|
#include <base/slab.h>
|
||||||
#include <util/construct_at.h>
|
#include <util/construct_at.h>
|
||||||
#include <util/misc_math.h>
|
#include <util/misc_math.h>
|
||||||
|
#include <os/backtrace.h>
|
||||||
|
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
@@ -425,6 +426,7 @@ void Slab::_free(void *addr)
|
|||||||
|
|
||||||
if (!e->used()) {
|
if (!e->used()) {
|
||||||
error("slab address ", addr, " freed which is unused");
|
error("slab address ", addr, " freed which is unused");
|
||||||
|
Genode::backtrace();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
/* base-internal includes */
|
/* base-internal includes */
|
||||||
#include <base/internal/globals.h>
|
#include <base/internal/globals.h>
|
||||||
|
|
||||||
|
#include <os/backtrace.h>
|
||||||
|
|
||||||
extern "C" char __eh_frame_start__[]; /* from linker script */
|
extern "C" char __eh_frame_start__[]; /* from linker script */
|
||||||
extern "C" void __register_frame (const void *begin); /* from libgcc_eh */
|
extern "C" void __register_frame (const void *begin); /* from libgcc_eh */
|
||||||
extern "C" char *__cxa_demangle(const char *mangled_name,
|
extern "C" char *__cxa_demangle(const char *mangled_name,
|
||||||
@@ -63,9 +65,12 @@ static void terminate_handler()
|
|||||||
Genode::error("Uncaught exception of type "
|
Genode::error("Uncaught exception of type "
|
||||||
"'", Genode::Cstring(demangled_name), "'");
|
"'", Genode::Cstring(demangled_name), "'");
|
||||||
free(demangled_name);
|
free(demangled_name);
|
||||||
|
Genode::backtrace();
|
||||||
} else {
|
} else {
|
||||||
Genode::error("Uncaught exception of type '", t->name(), "' "
|
Genode::error("Uncaught exception of type '", t->name(),
|
||||||
|
"' "
|
||||||
"(use 'c++filt -t' to demangle)");
|
"(use 'c++filt -t' to demangle)");
|
||||||
|
Genode::backtrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user