From 72f44833948e00402d686dc1b9c1669b404bda0a Mon Sep 17 00:00:00 2001 From: dev747368 <48332326+dev747368@users.noreply.github.com> Date: Fri, 17 Mar 2023 17:12:06 +0000 Subject: [PATCH] GP-1928 additional findPdb util method --- .../PDB/src/main/java/pdb/PdbPlugin.java | 52 ++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/Ghidra/Features/PDB/src/main/java/pdb/PdbPlugin.java b/Ghidra/Features/PDB/src/main/java/pdb/PdbPlugin.java index 4be44f0c46..8f733ba1ba 100644 --- a/Ghidra/Features/PDB/src/main/java/pdb/PdbPlugin.java +++ b/Ghidra/Features/PDB/src/main/java/pdb/PdbPlugin.java @@ -15,11 +15,12 @@ */ package pdb; +import java.util.*; +import java.util.stream.Collectors; + import java.io.File; import java.io.IOException; import java.lang.reflect.InvocationTargetException; -import java.util.*; -import java.util.stream.Collectors; import javax.swing.SwingConstants; @@ -221,6 +222,53 @@ public class PdbPlugin extends Plugin { return null; } + /** + * Searches the currently configured symbol server paths for a Pdb symbol file. + *
+ * Any "SameDir" search location in the configuration will be ignored because there is
+ * not an associated Program.
+ *
+ * @param symbolFileInfo info about the pdb that is being searched for.
+ * See {@link SymbolFileInfo#fromValues(String, String, int)}
+ * @param findOptions options that control how to search for the symbol file
+ * @param monitor a {@link TaskMonitor} that allows the user to cancel
+ * @return a File that points to the found Pdb symbol file, or null if no file was found
+ */
+ public static File findPdb(SymbolFileInfo symbolFileInfo, Set