From 21d310503e29c61411491eef6be2fb83bb5ed61c Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Wed, 4 Jul 2018 14:40:16 +0200
Subject: Kept information about arguments for templated routines.

---
 plugins/itanium/component.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/plugins/itanium/component.c b/plugins/itanium/component.c
index d890a1b..b8aa9c5 100644
--- a/plugins/itanium/component.c
+++ b/plugins/itanium/component.c
@@ -1755,12 +1755,15 @@ GBinRoutine *itd_translate_component_to_routine(const itanium_component *comp)
 
     switch (name->type)
     {
-        case ICT_NAME:
-            g_binary_routine_set_name(result, itd_translate_component(name, NULL));
-            break;
+        /**
+         * Seules les productions de itd_name() sont valides ici.
+         * On écarte volontairement les noms qualifiés ICT_QUALIFIED_TYPE.
+         */
 
         case ICT_NESTED_NAME:
         case ICT_TEMPLATE_NAME_ARGS:
+        case ICT_STD_UNSCOPED_NAME:
+        case ICT_NAME:
 
             type = itd_translate_component_to_type(name);
             if (type == NULL) goto unsupported_encoding;
@@ -1769,11 +1772,18 @@ GBinRoutine *itd_translate_component_to_routine(const itanium_component *comp)
 
             g_data_type_set_namespace(type, NULL, NULL);
 
-            desc = g_data_type_to_string(type, true);
+            if (G_IS_TEMPLATE_TYPE(type))
+                g_binary_routine_set_name_from_type(result, type);
 
-            g_object_unref(G_OBJECT(type));
+            else
+            {
+                desc = g_data_type_to_string(type, true);
+
+                g_object_unref(G_OBJECT(type));
 
-            g_binary_routine_set_name(result, desc);
+                g_binary_routine_set_name(result, desc);
+
+            }
 
             g_binary_routine_set_namespace(result, ns, "::");
 
-- 
cgit v0.11.2-87-g4458