diff --git a/codeCoverage/Inst.C b/codeCoverage/Inst.C index 8b81be8..d129aac 100644 --- a/codeCoverage/Inst.C +++ b/codeCoverage/Inst.C @@ -78,7 +78,7 @@ void initCoverage(int totalFuncs, int totalBBs) { } // Populates a record for a function -void registerFunc(int id, char *name, char *modName) { +void registerFunc(int id, char const* name, char const* modName) { if (!enabled) return; funcs[id].funcName = name; @@ -87,7 +87,7 @@ void registerFunc(int id, char *name, char *modName) { } // Populates a record for a basic block -void registerBB(int id, char *name, char *modName, unsigned long addr) { +void registerBB(int id, char const* name, char const* modName, unsigned long addr) { if (!enabled) return; bbs[id].funcName = name; diff --git a/codeCoverage/Inst.h b/codeCoverage/Inst.h index 7c41410..6552929 100644 --- a/codeCoverage/Inst.h +++ b/codeCoverage/Inst.h @@ -9,8 +9,8 @@ #endif LIB_EXPORT void initCoverage(int, int); -LIB_EXPORT void registerFunc(int, char *, char *); -LIB_EXPORT void registerBB(int, char *, char *, unsigned long); +LIB_EXPORT void registerFunc(int, char const*, char const*); +LIB_EXPORT void registerBB(int, char const*, char const*, unsigned long); LIB_EXPORT void incFuncCoverage(int); LIB_EXPORT void incBBCoverage(int); LIB_EXPORT void exitCoverage(int, int, int); diff --git a/codeCoverage/code_coverage.C b/codeCoverage/code_coverage.C index 2acd45b..e27deba 100644 --- a/codeCoverage/code_coverage.C +++ b/codeCoverage/code_coverage.C @@ -42,8 +42,8 @@ static const char *USAGE = " [-bpsa] \n \ static const char *OPT_STR = "bpsa"; // configuration options -char *inBinary = NULL; -char *outBinary = NULL; +char const*inBinary = NULL; +char const*outBinary = NULL; bool includeSharedLib = false; int printAll = 0; bool bbCoverage = false; @@ -118,7 +118,7 @@ bool parseArgs(int argc, char *argv[]) { return true; } -BPatch_function *findFuncByName(BPatch_image *appImage, char *funcName) { +BPatch_function *findFuncByName(BPatch_image *appImage, char const*funcName) { /* fundFunctions returns a list of all functions with the name 'funcName' in * the binary */ BPatch_Vector funcs; @@ -132,7 +132,7 @@ BPatch_function *findFuncByName(BPatch_image *appImage, char *funcName) { } bool insertFuncEntry(BPatch_binaryEdit *appBin, BPatch_function *curFunc, - char *funcName, BPatch_function *instIncFunc, int funcId) { + char const*funcName, BPatch_function *instIncFunc, int funcId) { /* Find the instrumentation points */ vector *funcEntry = curFunc->findPoint(BPatch_entry); if (NULL == funcEntry) { @@ -160,7 +160,7 @@ bool insertFuncEntry(BPatch_binaryEdit *appBin, BPatch_function *curFunc, } bool insertBBEntry(BPatch_binaryEdit *appBin, BPatch_function *curFunc, - char *funcName, const char *moduleName, + char const*funcName, char const*moduleName, BPatch_function *instBBIncFunc, BPatch_function *registerBB, int *bbIndex, BPatch_Vector *registerCalls) { @@ -254,16 +254,16 @@ int main(int argc, char *argv[]) { BPatch_image *appImage = appBin->getImage(); /* Find code coverage functions in the instrumentation library */ BPatch_function *instInitFunc = - findFuncByName(appImage, (char *)"initCoverage"); + findFuncByName(appImage, "initCoverage"); BPatch_function *registerFunc = - findFuncByName(appImage, (char *)"registerFunc"); + findFuncByName(appImage, "registerFunc"); BPatch_function *instIncFunc = - findFuncByName(appImage, (char *)"incFuncCoverage"); - BPatch_function *registerBB = findFuncByName(appImage, (char *)"registerBB"); + findFuncByName(appImage, "incFuncCoverage"); + BPatch_function *registerBB = findFuncByName(appImage, "registerBB"); BPatch_function *instBBIncFunc = - findFuncByName(appImage, (char *)"incBBCoverage"); + findFuncByName(appImage, "incBBCoverage"); BPatch_function *instExitFunc = - findFuncByName(appImage, (char *)"exitCoverage"); + findFuncByName(appImage, "exitCoverage"); if (!instInitFunc || !instIncFunc || !instExitFunc || !instBBIncFunc || !registerFunc || !registerBB) {