Skip to content

Commit

Permalink
Merge pull request #23 from chaoticgd/symboltablefix5
Browse files Browse the repository at this point in the history
Silence the error that gets thrown when a function name is already applied
  • Loading branch information
chaoticgd authored Feb 22, 2023
2 parents b3fef77 + 85c0e1e commit 2a86c77
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

# v2.1.4

- stabs: Silence the error that gets thrown when a function name is already applied.

# v2.1.3

- stabs: Fixed an issue where Ghidra would mix up types in some cases for structures defined inline inside unions.
- stabs: Remove junk labels such as `gcc2_compiled.` during analysis so that Ghidra doesn't confuse them for the real function names.

## v2.1.2

- Improved type deduplication algorithm (stdump v1.1 is included).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public void importFunctions(StdumpAST.ImporterState importer, Program program) {
Address high = toAddr(def.addressRange.high - 1);
AddressSet range = new AddressSet(low, high);
Function function = findOrCreateFunction(def, low, high, range);
setFunctionName(function, def, sourceFile, low, program);
setFunctionName(function, def);
function.setComment(sourceFile.path);
if(type.returnType != null) {
try {
Expand Down Expand Up @@ -344,13 +344,12 @@ private Function findOrCreateFunction(StdumpAST.FunctionDefinition def, Address
return function;
}

private void setFunctionName(Function function, StdumpAST.FunctionDefinition def,
StdumpAST.SourceFile sourceFile, Address low, Program program) {
private void setFunctionName(Function function, StdumpAST.FunctionDefinition def) {
try {
function.setName(def.name, SourceType.ANALYSIS);
} catch (DuplicateNameException | InvalidInputException e) {
} catch (InvalidInputException e) {
log.appendException(e);
}
} catch (DuplicateNameException e) {}
}

private HashSet<String> fillInParameters(Function function, StdumpAST.ImporterState importer,
Expand Down

0 comments on commit 2a86c77

Please sign in to comment.