This adds a dependcy on libunwind for generating the back trace. * src/CMakeLists.txt: Require libunwind-generic package and libunwind VAPI. Update docs and debian/control with new dependencies. * src/engine/api/geary-problem-report.vala (ProblemReport): Generate a stack trace in the default constructor if an error is specified. * src/client/components/main-window-info-bar.vala (MainWindowInfoBar::format_details): Include stack trafe from problem report in output if present. * ui/main-window-info-bar.ui: Add a ScrolledWindow around the TextView since the details could now be quite large. * bindings/vapi/libunwind.vapi: Add bindings for libunwind courtesy Guillaume Poirier-Morency, add Error enum.
63 lines
1.2 KiB
Vala
63 lines
1.2 KiB
Vala
/*
|
|
* Based on version from Sentry-GLib: https://github.com/arteymix/sentry-glib
|
|
* Courtesy of Guillaume Poirier-Morency <guillaumepoiriermorency@gmail.com>
|
|
*/
|
|
|
|
[CCode (cprefix = "UNW_", lower_case_cprefix = "unw_", cheader_filename = "libunwind.h")]
|
|
namespace Unwind
|
|
{
|
|
|
|
[CCode (cname = "unw_context_t")]
|
|
public struct Context
|
|
{
|
|
[CCode (cname = "unw_getcontext")]
|
|
public Context ();
|
|
}
|
|
|
|
[CCode (cname = "unw_proc_info_t")]
|
|
public struct ProcInfo
|
|
{
|
|
void* start_ip;
|
|
void* end_ip;
|
|
void* lsda;
|
|
void* handler;
|
|
void* gp;
|
|
long flags;
|
|
int format;
|
|
}
|
|
|
|
[CCode (cname = "unw_frame_regnum_t")]
|
|
public enum Reg
|
|
{
|
|
IP,
|
|
SP,
|
|
EH
|
|
}
|
|
|
|
[CCode (cname = "unw_cursor_t", cprefix = "unw_")]
|
|
public struct Cursor
|
|
{
|
|
public Cursor.local (Context ctx);
|
|
public int get_proc_info (out ProcInfo pip);
|
|
public int get_proc_name (uint8[] bufp, out long offp = null);
|
|
public int get_reg (Reg reg, out void* valp);
|
|
public int step ();
|
|
}
|
|
|
|
[CCode (cname = "unw_error_t", cprefix = "UNW_E", has_type_id = false)]
|
|
public enum Error
|
|
{
|
|
SUCCESS,
|
|
UNSPEC,
|
|
NOMEM,
|
|
BADREG,
|
|
READONLYREG,
|
|
STOPUNWIND,
|
|
INVALIDIP,
|
|
BADFRAME,
|
|
INVAL,
|
|
BADVERSION,
|
|
NOINFO
|
|
}
|
|
|
|
}
|