summaryrefslogtreecommitdiff
path: root/src/gui/panels
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-07-17 23:06:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-07-17 23:06:19 (GMT)
commitf225f8af4eff40b5096f512b699571554e54f097 (patch)
tree8f0ec45beab6434dc77cb32151242f6eeacb2bea /src/gui/panels
parent7efc82d0b78389638fd1b9fac7203f8aad13b53c (diff)
Got the namespace separator from formats when listing symbols.
Diffstat (limited to 'src/gui/panels')
-rw-r--r--src/gui/panels/symbols.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/gui/panels/symbols.c b/src/gui/panels/symbols.c
index 414c4c7..ab138e8 100644
--- a/src/gui/panels/symbols.c
+++ b/src/gui/panels/symbols.c
@@ -47,6 +47,7 @@
#include "../../gtkext/easygtk.h"
#include "../../gtkext/gtkdisplaypanel.h"
#include "../../gtkext/tmgt.h"
+#include "../../mangling/demangler.h"
@@ -640,6 +641,9 @@ static void change_symbols_panel_current_content(GSymbolsPanel *panel, GLoadedCo
GLoadedBinary *binary; /* Autre version de l'instance */
GtkBuilder *builder; /* Constructeur utilisé */
GtkTreeStore *store; /* Modèle de gestion */
+ GBinFormat *format; /* Format du binaire */
+ GCompDemangler *demangler; /* Décodeur privilégié associé */
+ GtkToggleToolButton *button; /* Bouton à encadrer */
if (G_IS_LOADED_BINARY(new))
binary = G_LOADED_BINARY(new);
@@ -668,7 +672,34 @@ static void change_symbols_panel_current_content(GSymbolsPanel *panel, GLoadedCo
if (binary != NULL)
{
- panel->sep = "."/*"::"*/; /* FIXME */
+ 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);
+
+ g_object_unref(G_OBJECT(demangler));
+ g_object_unref(G_OBJECT(format));
+
+ if (panel->sep == NULL)
+ {
+ button = GTK_TOGGLE_TOOL_BUTTON(gtk_builder_get_object(builder, "tree_display"));
+ gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
+
+ button = GTK_TOGGLE_TOOL_BUTTON(gtk_builder_get_object(builder, "list_display"));
+ gtk_toggle_tool_button_set_active(button, TRUE);
+
+ }
+ else
+ {
+ button = GTK_TOGGLE_TOOL_BUTTON(gtk_builder_get_object(builder, "tree_display"));
+
+ if (!gtk_widget_get_sensitive(GTK_WIDGET(button)))
+ {
+ gtk_widget_set_sensitive(GTK_WIDGET(button), TRUE);
+ gtk_toggle_tool_button_set_active(button, TRUE);
+ }
+
+ }
run_panel_update(G_UPDATABLE_PANEL(panel), PUI_0);