From f0ec22e9b029f9eeedd7cce9ab6d691ab9590683 Mon Sep 17 00:00:00 2001 From: roblabla Date: Thu, 15 Aug 2024 14:36:07 +0200 Subject: [PATCH 1/2] Fix wrong namespaces when using XML imports --- .../java/ghidra/app/util/xml/SymbolTableXmlMgr.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/SymbolTableXmlMgr.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/SymbolTableXmlMgr.java index f7daf9ffce..b6271f6ba2 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/SymbolTableXmlMgr.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/SymbolTableXmlMgr.java @@ -197,7 +197,7 @@ class SymbolTableXmlMgr { String addrStr = element.getAttribute("ADDRESS"); String namespace = element.getAttribute("NAMESPACE"); if (namespace != null && namespace.endsWith("::")) { - namespace = namespace.substring(namespace.length() - 2); + namespace = namespace.substring(0, namespace.length() - 2); } String primary = element.getAttribute("PRIMARY"); String sourceTypeString = element.getAttribute("SOURCE_TYPE"); @@ -233,13 +233,8 @@ class SymbolTableXmlMgr { scope = localNamespace; } else if (namespace != null && namespace.length() != 0) { - if (program.getGlobalNamespace().equals(localNamespace)) { - scope = NamespaceUtils.createNamespaceHierarchy(namespace, - program.getGlobalNamespace(), program, sourceType); - } - else { - name = namespace + name; - } + scope = NamespaceUtils.createNamespaceHierarchy(namespace, + program.getGlobalNamespace(), program, sourceType); } Symbol s = symbolTable.getPrimarySymbol(addr); From 1b26d26928c38468f487f70f0d25fd63a634af78 Mon Sep 17 00:00:00 2001 From: dev747368 <48332326+dev747368@users.noreply.github.com> Date: Thu, 12 Sep 2024 20:16:27 +0000 Subject: [PATCH 2/2] GP-4925 cert file from PR --- .../src/main/java/ghidra/app/util/xml/SymbolTableXmlMgr.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/SymbolTableXmlMgr.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/SymbolTableXmlMgr.java index b6271f6ba2..a20fa46a98 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/SymbolTableXmlMgr.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/SymbolTableXmlMgr.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.