@@ -49,6 +49,7 @@ class FidServiceLibraryIngest {
49
49
private Predicate <Pair <Function , FidHashQuad >> functionFilter ;
50
50
private LanguageID languageId ; // Language for everything in this library
51
51
private List <LibraryRecord > linkLibraries ;
52
+ private boolean disableNamespaceStripping ;
52
53
private TaskMonitor monitor ;
53
54
54
55
private LibraryRecord library = null ; // Database record of the library we are creating
@@ -176,11 +177,13 @@ public int compareTo(ChildSymbol o) {
176
177
* @param languageId the Ghidra language id to filter programs by
177
178
* @param linkLibraries the list of libraries to use for unresolved symbols
178
179
* @param monitor a task monitor
180
+ * @param disableNamespaceStripping boolean to disable namespace stripping
179
181
*/
180
182
public FidServiceLibraryIngest (FidDB fidDb , FidService service , String libraryFamilyName ,
181
183
String libraryVersion , String libraryVariant , List <DomainFile > programFiles ,
182
184
Predicate <Pair <Function , FidHashQuad >> functionFilter , LanguageID languageId ,
183
- List <LibraryRecord > linkLibraries , TaskMonitor monitor ) {
185
+ List <LibraryRecord > linkLibraries , TaskMonitor monitor ,
186
+ boolean disableNamespaceStripping ) {
184
187
this .fidDb = fidDb ;
185
188
this .service = service ;
186
189
this .libraryFamilyName = libraryFamilyName ;
@@ -191,6 +194,7 @@ public FidServiceLibraryIngest(FidDB fidDb, FidService service, String libraryFa
191
194
this .languageId = languageId ;
192
195
this .linkLibraries = linkLibraries ;
193
196
this .monitor = monitor ;
197
+ this .disableNamespaceStripping = disableNamespaceStripping ;
194
198
if (languageId == null ) {
195
199
throw new IllegalArgumentException ("LanugageID can't be null" ); // null used to be allowed, so add special check
196
200
}
@@ -240,7 +244,7 @@ public FidPopulateResult create() throws CancelledException, VersionException, I
240
244
result = new FidPopulateResult (library );
241
245
}
242
246
243
- populateLibraryFromProgram (program );
247
+ populateLibraryFromProgram (program , disableNamespaceStripping );
244
248
}
245
249
finally {
246
250
if (program != null ) {
@@ -261,16 +265,18 @@ public FidPopulateResult create() throws CancelledException, VersionException, I
261
265
* Processes a single program, adding it to the library.
262
266
* @param result the populate result
263
267
* @param program the program
268
+ * @param disableNamespaceStripping boolean to disable namespace stripping
264
269
* @throws CancelledException if the user cancels
265
270
*/
266
- private void populateLibraryFromProgram (Program program ) throws CancelledException {
271
+ private void populateLibraryFromProgram (Program program , boolean disableNamespaceStripping )
272
+ throws CancelledException {
267
273
268
274
FidHasher hasher = service .getHasher (program );
269
275
ArrayList <Function > theFunctions = new ArrayList <>();
270
276
Map <Function , FunctionRow > recordMap = new HashMap <>();
271
277
272
278
// 1) hash all the functions, create function rows for them
273
- hashAllTheFunctions (program , hasher , theFunctions , recordMap );
279
+ hashAllTheFunctions (program , hasher , theFunctions , recordMap , disableNamespaceStripping );
274
280
275
281
// 3) add all the forward (child) call relatives
276
282
for (Entry <Function , FunctionRow > entry : recordMap .entrySet ()) {
@@ -328,10 +334,12 @@ else if (childRow.toRow.functionRecord == null) { // This child was removed loca
328
334
* @param hasher the FID hasher
329
335
* @param theFunctions the functions
330
336
* @param recordMap the map of function to function records
337
+ * @param disableNamespaceStripping boolean to disable namespace stripping
331
338
* @throws CancelledException if the user cancels
332
339
*/
333
340
private void hashAllTheFunctions (Program program , FidHasher hasher ,
334
- ArrayList <Function > theFunctions , Map <Function , FunctionRow > recordMap )
341
+ ArrayList <Function > theFunctions , Map <Function , FunctionRow > recordMap ,
342
+ boolean disableNamespaceStripping )
335
343
throws CancelledException {
336
344
DomainFile domainFile = program .getDomainFile ();
337
345
FunctionManager functionManager = program .getFunctionManager ();
@@ -351,7 +359,7 @@ private void hashAllTheFunctions(Program program, FidHasher hasher,
351
359
exclude (domainFile , function , FidPopulateResult .Disposition .NO_DEFINED_SYMBOL );
352
360
}
353
361
else {
354
- name = function .getSymbol ().getName ();
362
+ name = function .getSymbol ().getName (disableNamespaceStripping );
355
363
}
356
364
357
365
FidHashQuad hashQuad = null ;
0 commit comments