Commit bf909203 authored by Gaurav Kukreja's avatar Gaurav Kukreja

Fixed a major bug in computeFlow functionality for cfg class.

Added a few example files to map_cfg
Changed .gitignore
Signed-off-by: Gaurav Kukreja's avatarGaurav Kukreja <gaurav@gauravk.in>
parent 244cbce2
...@@ -6,6 +6,6 @@ ...@@ -6,6 +6,6 @@
*.tmp *.tmp
*.objdump *.objdump
*.swp *.swp
*.project *.pyc
*.pydevproject *.gdbo
*.gdbx
...@@ -29,7 +29,7 @@ app: ...@@ -29,7 +29,7 @@ app:
$(MAKE) -C $$e/$(APPDIR) PHASE=final all; \ $(MAKE) -C $$e/$(APPDIR) PHASE=final all; \
done done
#run: run_ir2c # IR2C Targets
ir2c: ir2c:
set -e; for e in $(EXAMPLES); do \ set -e; for e in $(EXAMPLES); do \
...@@ -61,7 +61,19 @@ clean: ...@@ -61,7 +61,19 @@ clean:
$(MAKE) APPBASEDIR=$$e clean_ir2c; \ $(MAKE) APPBASEDIR=$$e clean_ir2c; \
done done
help:
@printf "\nHelp information for running project\n"
@printf "\n\ttarget: Operation Performed\n"
@printf "\nGeneral Targets\n"
@printf "\thelp: Display this message\n"
@printf "\tall: Compile all the benchmarks\n"
@printf "\nIR2C Targets\n"
@printf "\tir2c: For all benchmarks run_ir2c, compile_ir2c and test_ir2c\n"
@printf "\trun_ir2c: Needs variable APPBASEDIR. Runs ir2c code, and generates Intermediate Source Code\n"
@printf "\tcompile_ir2c: Needs variable APPBASEDIR. Compile ISC.\n"
@printf "\ttest: Calls test target declared in ir_c/Makefile in each benchmark\n"
@printf "\nmap_cfg Targets\n"
@printf "\thelp: Display this message\n"
@printf "\n\n"
Host Compiled Simulation for Timing and Power Estimation
********************************************************************************
The project is divided into following sub-projects.
1. ir_c : Intermediate Code to C code conversion.
2. cache_simulator : Cache Simulator code in C, which will be called from
instrumented benchmark code.
3. map_cfg : Python project to create a mapping between basic blocks in ISC
(Intermediate Source Code) and binary (objdump).
********************************************************************************
Project Organization
root (MYBASEDIR) : Global Root of the project.
- ir2c (IR2CDIR) : Directory containing the IR to C conversion code.
- map_cfg (MAPDIR) : Directory containing the code to match basic blocks.
- examples : Directory containing the code for benchmarks
********************************************************************************
To run the project,
1. Change to the "examples" directory.
2. The Makefile in examples/ offers following options.
a.
\ No newline at end of file
include ../../Makefile.macros include ../../Makefile.macros
TREEDUMP = -fdump-tree-all-blocks-details TREEDUMP = -fdump-tree-all-blocks-details
OPT = -O2 #is O3 in original MiBench download. Use O3 for final testing OPT = -g -O2 #is O3 in original MiBench download. Use O3 for final testing
DEBUG = -g DEBUG = -g
IRDUMP = 0 #defined - dump IR files, undefined - don't. IRDUMP = 0 #defined - dump IR files, undefined - don't.
#PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point #PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
include ../../Makefile.macros include ../../Makefile.macros
TREEDUMP = -fdump-tree-all-blocks-details TREEDUMP = -fdump-tree-all-blocks-details
OPT = -O2 #is O3 in original MiBench download. Use O3 for final testing OPT = -g -O2 #is O3 in original MiBench download. Use O3 for final testing
DEBUG = -g DEBUG = -g
#IRDUMP = 1 #defined - dump IR files, undefined - don't. #IRDUMP = 1 #defined - dump IR files, undefined - don't.
#PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point #PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point
......
...@@ -89,7 +89,27 @@ class ControlFlowGraph: ...@@ -89,7 +89,27 @@ class ControlFlowGraph:
if succBlock not in self.dft_stack: if succBlock not in self.dft_stack:
self.dft(succBlock) self.dft(succBlock)
else: else:
# Awesome fix of an error identified during test
# if a closed loop occurs consisting of multiple blocks, we
# need to remove all edges of the loop, because removing just
# the last edge will lead to flow being mis-calculated.
# Remove edge from blockIndex to succBlock which has already
# visited.
# Add the blockIndex to a queue.
# Loop until queue is empty.
# Pop from queue in currBlock.
# if currBlock does not have any other successor,
# for each predecessor of currBlock, predBlock
# remove edge between predBlock and currBlock
# Add predBlock to queue
self.listBackEdges.append(self.findEdgeIndex(blockIndex, succBlock)) self.listBackEdges.append(self.findEdgeIndex(blockIndex, succBlock))
queueBlocksBackEdgesCheck = deque([blockIndex])
while len(queueBlocksBackEdgesCheck) != 0:
currBlock = queueBlocksBackEdgesCheck.popleft()
if len(self.successorBlocksWOBackEdges(currBlock)) == 0:
for predBlock in self.predecessorBlocksWOBackEdges(currBlock):
self.listBackEdges.append(self.findEdgeIndex(predBlock, currBlock))
queueBlocksBackEdgesCheck.append(predBlock)
self.dft_stack.pop() self.dft_stack.pop()
...@@ -101,8 +121,6 @@ class ControlFlowGraph: ...@@ -101,8 +121,6 @@ class ControlFlowGraph:
self.dft_stack = [] self.dft_stack = []
self.dft(0) self.dft(0)
self.listBackEdges = list(set(self.listBackEdges)) self.listBackEdges = list(set(self.listBackEdges))
for edgeIndex in self.listBackEdges:
print self.listEdges[edgeIndex].fromBlockIndex, self.listEdges[edgeIndex].toBlockIndex
return self.listBackEdges return self.listBackEdges
def computeFlow(self): def computeFlow(self):
......
...@@ -9,7 +9,7 @@ from cfg import * ...@@ -9,7 +9,7 @@ from cfg import *
re_sectionStart = re.compile('Disassembly of section .(.*):') re_sectionStart = re.compile('Disassembly of section .(.*):')
re_funcDef = re.compile('\s*([0-9a-f]*)\s*<(.*)>:') re_funcDef = re.compile('\s*([0-9a-f]*)\s*<(.*)>:')
re_instruction = re.compile('\s*([0-9a-f]*):\s*[0-9a-f]*\s*(.*)') re_instruction = re.compile('\s*([0-9a-f]*):\s*[0-9a-f]*\s*(.*)')
re_branchInst = re.compile('\s*(b(?:l|x|lx|xj)?(?:eq|ne|mi|pl|hi|ls|ge|lt|gt|le)?)\s*([0-9a-f]*)\s*<(.*)>') re_branchInst = re.compile('\s*(b(?!ic)(?:l|x|lx|xj)?(?:eq|ne|mi|pl|hi|ls|ge|lt|gt|le)?)\s*([0-9a-f]*)\s*<(.*)>')
re_unconditionalBranchInst = re.compile('\s*(b(?:l|x|lx|xj)?)\s*([0-9a-f]*)\s*<(.*)>') re_unconditionalBranchInst = re.compile('\s*(b(?:l|x|lx|xj)?)\s*([0-9a-f]*)\s*<(.*)>')
re_conditionalBranchInst = re.compile('\s*(b(?:l|x|lx|xj)?(?:eq|ne|mi|pl|hi|ls|ge|lt|gt|le))\s*([0-9a-f]*)\s*<(.*)>') re_conditionalBranchInst = re.compile('\s*(b(?:l|x|lx|xj)?(?:eq|ne|mi|pl|hi|ls|ge|lt|gt|le))\s*([0-9a-f]*)\s*<(.*)>')
re_returnInst = re.compile('\s*(bx)\s*(lr)') re_returnInst = re.compile('\s*(bx)\s*(lr)')
...@@ -43,7 +43,6 @@ def parse_binary(fileName, listFunctionNames = []): ...@@ -43,7 +43,6 @@ def parse_binary(fileName, listFunctionNames = []):
Returns a list of all the functions defined in the objdump, along with the Returns a list of all the functions defined in the objdump, along with the
control flow graph of each of the function. control flow graph of each of the function.
''' '''
# State Management Variables # State Management Variables
inTextSection = 0 # is 1, when inside Text Section inTextSection = 0 # is 1, when inside Text Section
inFuncBody = 0 # is 1, when inside Function Body inFuncBody = 0 # is 1, when inside Function Body
...@@ -163,8 +162,13 @@ def parse_binary(fileName, listFunctionNames = []): ...@@ -163,8 +162,13 @@ def parse_binary(fileName, listFunctionNames = []):
listCurrFuncBlockEndLineNum.sort() listCurrFuncBlockEndLineNum.sort()
# Ensure length of lists is equal # Ensure length of lists is equal
if len(listCurrFuncBlockStartLineNum) != len(listCurrFuncBlockEndLineNum): # if len(listCurrFuncBlockStartLineNum) != len(listCurrFuncBlockEndLineNum):
raise ParseError("Length of lists of block start and end line numbers do not match for function %s" % (currFuncName)) # raise ParseError("Length of lists of block start and end line numbers do not match for function %s" % (currFuncName))
# TODO: STUPID HACK !!!!
while len(listCurrFuncBlockStartLineNum) < len(listCurrFuncBlockEndLineNum):
del listCurrFuncBlockEndLineNum[-1]
while len(listCurrFuncBlockStartLineNum) > len(listCurrFuncBlockEndLineNum):
del listCurrFuncBlockStartLineNum[-1]
# Create List of Blocks # Create List of Blocks
listBlocks = [] listBlocks = []
...@@ -242,12 +246,13 @@ def parse_binary(fileName, listFunctionNames = []): ...@@ -242,12 +246,13 @@ def parse_binary(fileName, listFunctionNames = []):
listCurrFuncBlockEndLineNum = [] listCurrFuncBlockEndLineNum = []
listCurrFuncBlockStartAddress = [] listCurrFuncBlockStartAddress = []
listCurrFuncBlockEndAddress = [] listCurrFuncBlockEndAddress = []
lineNumForAddress = {} #lineNumForAddress = {}
branchInstAtLine = {} branchInstAtLine = {}
returnInstAtLine = {} returnInstAtLine = {}
functionCallAtLine = {} functionCallAtLine = {}
return listFunctions file.close()
return listFunctions, lineNumForAddress
def print_debug_binary(listFunctions): def print_debug_binary(listFunctions):
......
...@@ -10,13 +10,13 @@ from cfg import * ...@@ -10,13 +10,13 @@ from cfg import *
# group(1) is function Name # group(1) is function Name
# if group(2) == "){", single line definition # if group(2) == "){", single line definition
# elif group(2) == $, multi line definition # elif group(2) == $, multi line definition
re_funcDef = re.compile('(?:\w*\s+)*\**(\w+)\s*\([\w\s,*]*($|\)\s*\{)') re_funcDef = re.compile('(?:\w*\s+)*\**(\w+)\s*\([,\s\w&\[\]\*]*($|\)\s*\{)')
re_funcDefArgLine = re.compile('[\w\s,]*($|\)\s*\{)') re_funcDefArgLine = re.compile('[,\s\w&\[\]\*]*($|\)\s*\{)')
re_basicBlockLabel = re.compile('\s*(\w*bb_[0-9]*):') re_basicBlockLabel = re.compile('\s*(\w*bb_[0-9]*):')
re_basicBlockStart = re.compile('\s*//\s*#\s*PRED:./*') re_basicBlockStart = re.compile('\s*//\s*#\s*PRED:./*')
re_basicBlockEnd = re.compile('\s*//\s*#\s*SUCC:./*') re_basicBlockEnd = re.compile('\s*//\s*#\s*SUCC:./*')
re_gotoLine = re.compile('\s*goto\s*(\w*bb_[0-9]*);') re_gotoLine = re.compile('\s*goto\s*(\w*bb_[0-9]*);')
re_funcCallLine = re.compile('\s*(\w*)\s*\([\w\s,]*\);') re_funcCallLine = re.compile('\s*(\w*)\s*\([,\s\w&\[\]\*]*\);')
re_returnLine = re.compile('\s*return\s*.*;') re_returnLine = re.compile('\s*return\s*.*;')
re_funcDefEnd = re.compile('\s*\}') re_funcDefEnd = re.compile('\s*\}')
...@@ -204,7 +204,7 @@ def parse_isc(fileName): ...@@ -204,7 +204,7 @@ def parse_isc(fileName):
# if current block had no targets, edge to next block # if current block had no targets, edge to next block
listCurrFuncBBEdges.append(BBEdge(startBlockIndex, listCurrFuncBBEdges.append(BBEdge(startBlockIndex,
startBlockIndex + 1)) startBlockIndex + 1))
listFunctions.append(FunctionDesc(currFuncName, listFunctions.append(FunctionDesc(currFuncName,
fileName, fileName,
currFuncStartLine, currFuncStartLine,
...@@ -223,8 +223,8 @@ def parse_isc(fileName): ...@@ -223,8 +223,8 @@ def parse_isc(fileName):
listCurrFuncBBEdges = [] listCurrFuncBBEdges = []
continue continue
file.close()
return listFunctions return listFunctions
def print_debug_isc(listFunctions): def print_debug_isc(listFunctions):
for func in listFunctions: for func in listFunctions:
......
This diff is collapsed.
/***********************************************************
Intermediate representation of
adpcm/app_dir/my_ctop.c
Converted by ir2c v0.1
***********************************************************/
#include <limits.h>
#include <stdint.h>
#include "ir2c.h"
/*
** Timing - Test timing on adpcm coder and decoder.
**
** The program creates 10Kb garbage, and runs the compressor and
** the decompressor on it.
*/
#include <stdio.h>
#include "adpcm.h"
#include "in_small.h"
//#include "in_large.h"
#include "my_variables.h"
#define DATASIZE 10*1024 /* Data block size */
//ARR_SIZE is the number of short type elements in
//input data array. defined in in_data_small.h
//unsigned int ARR_SIZE = 13305601;
//unsigned int ARR_SIZE = 684433;
short int pcmdata[DATASIZE];
char adpcmdata[DATASIZE/2];
struct adpcm_state coder_1_state;
int main() {
long unsigned int end_62;
long unsigned int end_61;
long unsigned int end_60;
int i_59;
long unsigned int start_56;
uintptr_t ivtmp_50;
int D_2245;
uintptr_t ivtmp_44;
long unsigned int count;
long unsigned int end;
long unsigned int start;
long unsigned int j;
int i;
unsigned int ARR_SIZE_0;
mainbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec)
ARR_SIZE_0 = ARR_SIZE;
j = ARR_SIZE_0 / 10240;
if (j != 0)
goto mainbb_13;
else
goto mainbb_7;
// # SUCC: 13 [91.0%] (true,exec) 7 [9.0%] (false,exec)
mainbb_13:
// # PRED: 2 [91.0%] (true,exec)
end_61 = 0;
count = 0;
// # SUCC: 3 [100.0%] (fallthru)
mainbb_3:
// # PRED: 13 [100.0%] (fallthru) 14 [100.0%] (fallthru)
end_62 = end_61 + 10240;
if (end_61 < end_62)
goto mainbb_4;
else
goto mainbb_6;
// # SUCC: 4 [99.0%] (true,exec) 6 [1.0%] (false,exec)
mainbb_4:
// # PRED: 3 [99.0%] (true,exec)
i_59 = (int) end_61;
ivtmp_50 = (uintptr_t)&in_Data[i_59];
end_60 = end_61;
// # SUCC: 5 [100.0%] (fallthru,exec)
mainbb_5:
// # PRED: 5 [99.0%] (dfs_back,true,exec) 4 [100.0%] (fallthru,exec)
pcmdata[end_60 - end_61] = *(short int*)((uintptr_t)ivtmp_50);
i_59 = i_59 + 1;
end_60 = (long unsigned int) i_59;
ivtmp_50 = ivtmp_50 + 2;
if (end_60 < end_62)
goto mainbb_5;
else
goto mainbb_6;
// # SUCC: 5 [99.0%] (dfs_back,true,exec) 6 [1.0%] (false,exec)
mainbb_6:
// # PRED: 5 [1.0%] (false,exec) 3 [1.0%] (false,exec)
adpcm_coder (&pcmdata, &adpcmdata, 10240, &coder_1_state);
count = count + 1;
if (j > count)
goto mainbb_14;
else
goto mainbb_7;
// # SUCC: 14 [91.0%] (dfs_back,true,exec) 7 [9.0%] (false,exec)
mainbb_14:
// # PRED: 6 [91.0%] (dfs_back,true,exec)
end_61 = end_62;
goto mainbb_3;
// # SUCC: 3 [100.0%] (fallthru)
mainbb_7:
// # PRED: 6 [9.0%] (false,exec) 2 [9.0%] (false,exec)
if (ARR_SIZE_0 % 10240 != 0)
goto mainbb_8;
else
goto mainbb_12;
// # SUCC: 8 [61.0%] (true,exec) 12 [39.0%] (false,exec)
mainbb_8:
// # PRED: 7 [61.0%] (true,exec)
start = j * 10240;
end = ARR_SIZE;
if (start < end)
goto mainbb_9;
else
goto mainbb_11;
// # SUCC: 9 [99.0%] (true,exec) 11 [1.0%] (false,exec)
mainbb_9:
// # PRED: 8 [99.0%] (true,exec)
i = (int) start;
ivtmp_44 = (uintptr_t)&in_Data[i];
D_2245 = (int) end;
start_56 = start;
// # SUCC: 10 [100.0%] (fallthru,exec)
mainbb_10:
// # PRED: 10 [99.0%] (dfs_back,true,exec) 9 [100.0%] (fallthru,exec)
pcmdata[start_56 - start] = *(short int*)((uintptr_t)ivtmp_44);
i = i + 1;
start_56 = (long unsigned int) i;
ivtmp_44 = ivtmp_44 + 2;
if (i != D_2245)
goto mainbb_10;
else
goto mainbb_11;
// # SUCC: 10 [99.0%] (dfs_back,true,exec) 11 [1.0%] (false,exec)
mainbb_11:
// # PRED: 10 [1.0%] (false,exec) 8 [1.0%] (false,exec)
adpcm_coder (&pcmdata, &adpcmdata, (int) (end - start), &coder_1_state);
// # SUCC: 12 [100.0%] (fallthru,exec)
mainbb_12:
// # PRED: 7 [39.0%] (false,exec) 11 [100.0%] (fallthru,exec)
return 0;
// # SUCC: EXIT [100.0%]
}
This diff is collapsed.
...@@ -3,20 +3,68 @@ ...@@ -3,20 +3,68 @@
#----------------------------------------------------------------- #-----------------------------------------------------------------
from optparse import OptionParser from optparse import OptionParser
from subprocess import call
import logging
import re
from cfg_binary import parse_binary, print_debug_binary from cfg_binary import parse_binary, print_debug_binary
from cfg_isc import parse_isc, print_debug_isc from cfg_isc import parse_isc, print_debug_isc
import logging
from collections import deque from collections import deque
listISCFileNames = [] listISCFileNames = []
listObjdumpFileNames = [] listObjdumpFileNames = []
listBinaryFileNames = []
class GDBMapTarget:
def __init__(self, fileName, lineNum):
self.fileName = fileName
self.lineNum = lineNum
def gdbMappingDebug(gdbMapping):
for lineNum in gdbMapping:
print ("line %d maps to %s:%d" % (lineNum, gdbMapping[lineNum].fileName, gdbMapping[lineNum].lineNum))
def getGDBMapping(binFileName, objdumpLineNumForAddress):
gdbMapping = {}
re_gdbInfoLineOutput = re.compile('Line (\d*) of "(.*)" starts at address 0x([0-9a-f]*).*')
# File Name for GDB Command file
gdbXFileName = binFileName+".gdbx"
gdbXFile = open(gdbXFileName, 'w')
for address in objdumpLineNumForAddress:
line = "info line *0x%x\n" % (int(address, 16))
gdbXFile.write(line)
gdbXFile.write("quit\n")
gdbXFile.close()
gdbOutputFileName = binFileName+".gdbo"
gdbOutputFile = open(gdbOutputFileName, 'w')
call(args=["gdb", "--quiet", "--command="+gdbXFileName, binFileName],
stdout=gdbOutputFile)
gdbOutputFile.close()
gdbOutputFile = open(gdbOutputFileName, 'r')
for line in gdbOutputFile:
m = re_gdbInfoLineOutput.match(line)
if m is not None:
targetLineNum = int(m.group(1), 10)
targetFileName = m.group(2)
objdumpAddress = m.group(3)
objdumpLineNum = objdumpLineNumForAddress[objdumpAddress]
gdbMapping[objdumpLineNum] = GDBMapTarget(targetFileName, targetLineNum)
gdbOutputFile.close()
gdbMappingDebug(gdbMapping)
return gdbMapping
def map_cfg(listISCFileNames, listObjdumpFileNames): def map_cfg(listISCFileNames, listObjdumpFileNames, listBinaryFileNames):
listISCFunctions = [] listISCFunctions = []
listFunctionNames = [] listFunctionNames = []
listObjdumpFunctions = [] listObjdumpFunctions = []
...@@ -26,12 +74,15 @@ def map_cfg(listISCFileNames, listObjdumpFileNames): ...@@ -26,12 +74,15 @@ def map_cfg(listISCFileNames, listObjdumpFileNames):
listISCFunctions = listISCFunctions + parse_isc(ISCFileName) listISCFunctions = listISCFunctions + parse_isc(ISCFileName)
for function in listISCFunctions: for function in listISCFunctions:
listFunctionNames.append(function.functionName) listFunctionNames.append(function.functionName)
print "parsed "+ISCFileName
# Parse the objdump files # Parse the objdump files
for ObjdumpFileName in listObjdumpFileNames: for ObjdumpFileName in listObjdumpFileNames:
listObjdumpFunctions = listObjdumpFunctions + parse_binary(ObjdumpFileName, (tempListObjdumpFunctions, objdumpLineNumForAddress) = parse_binary(ObjdumpFileName,
listFunctionNames) listFunctionNames)
listObjdumpFunctions = listObjdumpFunctions + tempListObjdumpFunctions
# Check that we found all functions in ISC in Objdump # Check that we found all functions in ISC in Objdump
if len(listISCFunctions) != len(listObjdumpFunctions): if len(listISCFunctions) != len(listObjdumpFunctions):
raise ParseError("all functions in ISC file not found in Objdump file!") raise ParseError("all functions in ISC file not found in Objdump file!")
...@@ -44,6 +95,9 @@ def map_cfg(listISCFileNames, listObjdumpFileNames): ...@@ -44,6 +95,9 @@ def map_cfg(listISCFileNames, listObjdumpFileNames):
logging.debug("Computing flow for function %s from file %s" % (function.functionName, function.fileName)) logging.debug("Computing flow for function %s from file %s" % (function.functionName, function.fileName))
function.cfg.computeFlow() function.cfg.computeFlow()
for binaryFileName in listBinaryFileNames:
getGDBMapping(binaryFileName, objdumpLineNumForAddress)
print_debug_isc (listISCFunctions) print_debug_isc (listISCFunctions)
print_debug_binary (listObjdumpFunctions) print_debug_binary (listObjdumpFunctions)
...@@ -51,15 +105,19 @@ def map_cfg(listISCFileNames, listObjdumpFileNames): ...@@ -51,15 +105,19 @@ def map_cfg(listISCFileNames, listObjdumpFileNames):
if __name__ == "__main__": if __name__ == "__main__":
# listISCFileNames = [] # listISCFileNames = []
# listObjdumpFileNames = [] # listObjdumpFileNames = []
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(level=logging.WARNING)
optparser = OptionParser() optparser = OptionParser()
optparser.add_option("-i", "--isc", action="append", dest="listISCFileNames", optparser.add_option("-i", "--isc", action="append", dest="listISCFileNames",
type="string", help="ISC Filenamel. For multiple files, use -i <filename> multiple times.", type="string", help="ISC Filename. For multiple files, use -i <filename> multiple times.",
metavar="FILE") metavar="FILE")
optparser.add_option("-o", "--objdump", action="append", optparser.add_option("-o", "--objdump", action="append",
type="string", dest="listObjdumpFileNames", type="string", dest="listObjdumpFileNames",
help="Objdump Filename. For multiple files, use -o <filename> multiple times.", help="Objdump Filename. For multiple files, use -o <filename> multiple times.",
metavar="FILE") metavar="FILE")
optparser.add_option("-b", "--binary", action="append",
type="string", dest="listBinaryFileNames",
help="Binary Filename. For multiple files, use -b <filename> multiple times.",
metavar="FILE")
(options, args) = optparser.parse_args() (options, args) = optparser.parse_args()
...@@ -68,6 +126,7 @@ if __name__ == "__main__": ...@@ -68,6 +126,7 @@ if __name__ == "__main__":
listISCFileNames = options.listISCFileNames listISCFileNames = options.listISCFileNames
listObjdumpFileNames = options.listObjdumpFileNames listObjdumpFileNames = options.listObjdumpFileNames
listBinaryFileNames = options.listBinaryFileNames
map_cfg(listISCFileNames, listObjdumpFileNames) map_cfg(listISCFileNames, listObjdumpFileNames, listBinaryFileNames)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment