Update ImportMarkersAsBookmarks Ghidra script after faults.csv format change (mnemonic)
This commit is contained in:
@@ -33,8 +33,8 @@ public class ImportMarkersAsBookmarks extends GhidraScript {
|
|||||||
int skipped = 0;
|
int skipped = 0;
|
||||||
int lineNo = 0;
|
int lineNo = 0;
|
||||||
|
|
||||||
// CSV columns: (benchmark, resulttype, faults, fault_address)
|
// CSV columns: (benchmark, resulttype, faults, fault_address, mnemonic)
|
||||||
// Example: (ip , OK_MARKER , 4311 , 0x10001B )
|
// Example: (ip , OK_MARKER , 4311 , 0x10001B , mov)
|
||||||
try (BufferedReader br = new BufferedReader(new FileReader(input))) {
|
try (BufferedReader br = new BufferedReader(new FileReader(input))) {
|
||||||
String line;
|
String line;
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
@@ -47,7 +47,7 @@ public class ImportMarkersAsBookmarks extends GhidraScript {
|
|||||||
|
|
||||||
// Make sure to always use "," delimiter and never quotations
|
// Make sure to always use "," delimiter and never quotations
|
||||||
String[] parts = line.split(",");
|
String[] parts = line.split(",");
|
||||||
if (parts.length != 4) {
|
if (parts.length != 5) {
|
||||||
skipped++;
|
skipped++;
|
||||||
printerr("Line " + lineNo + ": malformed");
|
printerr("Line " + lineNo + ": malformed");
|
||||||
continue;
|
continue;
|
||||||
@@ -57,11 +57,13 @@ public class ImportMarkersAsBookmarks extends GhidraScript {
|
|||||||
String typeText = parts[1].trim();
|
String typeText = parts[1].trim();
|
||||||
String countText = parts[2].trim();
|
String countText = parts[2].trim();
|
||||||
String addrText = parts[3].trim();
|
String addrText = parts[3].trim();
|
||||||
|
String mnemonicText = parts[4].trim();
|
||||||
|
|
||||||
if (benchText.isEmpty()
|
if (benchText.isEmpty()
|
||||||
|| typeText.isEmpty()
|
|| typeText.isEmpty()
|
||||||
|| countText.isEmpty()
|
|| countText.isEmpty()
|
||||||
|| addrText.isEmpty()) {
|
|| addrText.isEmpty()
|
||||||
|
|| mnemonicText.isEmpty()) {
|
||||||
skipped++;
|
skipped++;
|
||||||
printerr("Line " + lineNo + ": malformed");
|
printerr("Line " + lineNo + ": malformed");
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user