Commit a6ec8571 authored by Ell's avatar Ell

app: add source-location information to GimpBacktrace

Add source filename and line number fields to the
GimpBacktraceAddressInfo struct, populated through
gimp_backtrace_get_address_info().  This is not currently supported
by the Linux backend, but is supported by the Windows backend,
which we'll be added in the next commit.
parent 422f6a55
......@@ -585,6 +585,9 @@ gimp_backtrace_get_address_info (guintptr address,
info->symbol_address = (guintptr) dl_info.dli_saddr;
#endif
info->source_file[0] = '\0';
info->source_line = 0;
return TRUE;
}
......
......@@ -31,6 +31,9 @@ struct _GimpBacktraceAddressInfo
gchar symbol_name[256];
guintptr symbol_address;
gchar source_file[256];
gint source_line;
};
......
......@@ -3899,6 +3899,43 @@ gimp_dashboard_log_write_address_map (GimpAsync *async,
}
}
if (n == 0 || strcmp (info->source_file, prev_info->source_file))
{
NONEMPTY ();
if (info->source_file[0])
{
gimp_dashboard_log_printf (dashboard,
"<source>");
gimp_dashboard_log_print_escaped (dashboard,
info->source_file);
gimp_dashboard_log_printf (dashboard,
"</source>\n");
}
else
{
gimp_dashboard_log_printf (dashboard,
"<source />\n");
}
}
if (n == 0 || info->source_line != prev_info->source_line)
{
NONEMPTY ();
if (info->source_line)
{
gimp_dashboard_log_printf (dashboard,
"<line>%d</line>\n",
info->source_line);
}
else
{
gimp_dashboard_log_printf (dashboard,
"<line />\n");
}
}
if (empty)
{
gimp_dashboard_log_printf (dashboard,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment