summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-04-18 15:30:21 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-04-18 15:30:21 (GMT)
commitc8092365591d1336c1e03cf42b6bd6ea58a17350 (patch)
treee9b0b8a125f89f852108a2fc60a08ad1ff8182f2 /src/gui
parent0794024b412604ae5e5aca0f104b5a8f3ec5412c (diff)
Taken into account the potential absence of demangler in the symbol panel.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/panels/symbols.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gui/panels/symbols.c b/src/gui/panels/symbols.c
index 809fed8..2cb2b34 100644
--- a/src/gui/panels/symbols.c
+++ b/src/gui/panels/symbols.c
@@ -61,7 +61,7 @@ struct _GSymbolsPanel
GPanelItem parent; /* A laisser en premier */
GLoadedBinary *binary; /* Binaire à prendre en compte */
- const char *sep; /* Délimitateur à utiliser */
+ char *sep; /* Délimitateur à utiliser */
size_t count; /* Quantité de symboles utiles */
@@ -658,6 +658,12 @@ static void change_symbols_panel_current_content(GSymbolsPanel *panel, GLoadedCo
if (panel->binary != NULL)
g_object_unref(G_OBJECT(panel->binary));
+ if (panel->sep != NULL)
+ {
+ free(panel->sep);
+ panel->sep = NULL;
+ }
+
panel->binary = binary;
if (panel->binary != NULL)
@@ -676,11 +682,18 @@ static void change_symbols_panel_current_content(GSymbolsPanel *panel, GLoadedCo
if (binary != NULL)
{
format = G_BIN_FORMAT(g_loaded_binary_get_format(binary));
+
demangler = g_binary_format_get_demangler(format);
- panel->sep = g_compiler_demangler_get_ns_separator(demangler);
+ if (demangler == NULL)
+ panel->sep = NULL;
+
+ else
+ {
+ panel->sep = strdup(g_compiler_demangler_get_ns_separator(demangler));
+ g_object_unref(G_OBJECT(demangler));
+ }
- g_object_unref(G_OBJECT(demangler));
g_object_unref(G_OBJECT(format));
if (panel->sep == NULL)