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.
This commit is contained in:
parent
422f6a55e4
commit
a6ec857123
3 changed files with 43 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue