mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
validate: utils: Do not try to replace vars in debug info fields
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/190>
This commit is contained in:
parent
dcb719d6cc
commit
d203f4251b
1 changed files with 25 additions and 10 deletions
|
@ -50,6 +50,10 @@
|
||||||
static GRegex *_variables_regex = NULL;
|
static GRegex *_variables_regex = NULL;
|
||||||
static GstStructure *global_vars = NULL;
|
static GstStructure *global_vars = NULL;
|
||||||
|
|
||||||
|
static GQuark debug_quark = 0;
|
||||||
|
static GQuark lineno_quark = 0;
|
||||||
|
static GQuark filename_quark = 0;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
const gchar *str;
|
const gchar *str;
|
||||||
|
@ -559,6 +563,17 @@ skip_spaces (gchar * c)
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
setup_quarks (void)
|
||||||
|
{
|
||||||
|
if (filename_quark)
|
||||||
|
return;
|
||||||
|
|
||||||
|
filename_quark = g_quark_from_static_string ("__filename__");
|
||||||
|
lineno_quark = g_quark_from_static_string ("__lineno__");
|
||||||
|
debug_quark = g_quark_from_static_string ("__debug__");
|
||||||
|
}
|
||||||
|
|
||||||
/* Parse file that contains a list of GStructures */
|
/* Parse file that contains a list of GStructures */
|
||||||
#define GST_STRUCT_LINE_CONTINUATION_CHARS ",{\\["
|
#define GST_STRUCT_LINE_CONTINUATION_CHARS ",{\\["
|
||||||
static GList *
|
static GList *
|
||||||
|
@ -676,10 +691,11 @@ _file_get_structures (GFile * file, gchar ** err)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
gst_structure_set (structure,
|
setup_quarks ();
|
||||||
"__lineno__", G_TYPE_INT, current_lineno,
|
gst_structure_id_set (structure,
|
||||||
"__filename__", G_TYPE_STRING, filename,
|
lineno_quark, G_TYPE_INT, current_lineno,
|
||||||
"__debug__", G_TYPE_STRING, debug_line->str, NULL);
|
filename_quark, G_TYPE_STRING, filename,
|
||||||
|
filename_quark, G_TYPE_STRING, debug_line->str, NULL);
|
||||||
structures = g_list_append (structures, structure);
|
structures = g_list_append (structures, structure);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1201,12 +1217,11 @@ gst_validate_set_globals (GstStructure * structure)
|
||||||
if (!logsdir)
|
if (!logsdir)
|
||||||
logsdir = g_get_tmp_dir ();
|
logsdir = g_get_tmp_dir ();
|
||||||
|
|
||||||
global_vars =
|
global_vars = gst_structure_new_empty ("vars");
|
||||||
gst_structure_new ("vars",
|
structure_set_string_literal (global_vars, "TMPDIR", g_get_tmp_dir ());
|
||||||
"TMPDIR", G_TYPE_STRING, g_get_tmp_dir (),
|
structure_set_string_literal (global_vars, "LOGSDIR", logsdir);
|
||||||
"LOGSDIR", G_TYPE_STRING, logsdir,
|
structure_set_string_literal (global_vars, "tmpdir", g_get_tmp_dir ());
|
||||||
"tmpdir", G_TYPE_STRING, g_get_tmp_dir (),
|
structure_set_string_literal (global_vars, "logsdir", logsdir);
|
||||||
"logsdir", G_TYPE_STRING, logsdir, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!structure)
|
if (!structure)
|
||||||
|
|
Loading…
Reference in a new issue