diff options
author | Ryan Long <ryan.long@oarcorp.com> | 2021-07-28 15:39:17 -0400 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2021-08-03 15:56:53 -0500 |
commit | 7f7ad0391739ac277682e951d4e79d46a82a89bd (patch) | |
tree | f6a1f3f04297f4ae6f13c0c4593aa8ac16595a01 /tester/covoar/ObjdumpProcessor.cc | |
parent | Remove BranchInfoAvailable global variable (diff) | |
download | rtems-tools-7f7ad0391739ac277682e951d4e79d46a82a89bd.tar.bz2 |
Remove TargetInfo global variable
- Remove TargetInfo from app_common
- Created the targetInfo_m member variable in CoverageReaderBase,
TraceWriterBase, and ObjdumpProcessor
- Made functions to set the value of targetInfo_m
Diffstat (limited to 'tester/covoar/ObjdumpProcessor.cc')
-rw-r--r-- | tester/covoar/ObjdumpProcessor.cc | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/tester/covoar/ObjdumpProcessor.cc b/tester/covoar/ObjdumpProcessor.cc index f590ece..90620aa 100644 --- a/tester/covoar/ObjdumpProcessor.cc +++ b/tester/covoar/ObjdumpProcessor.cc @@ -124,8 +124,10 @@ namespace Coverage { } ObjdumpProcessor::ObjdumpProcessor( - DesiredSymbols& symbolsToAnalyze - ): symbolsToAnalyze_m( symbolsToAnalyze ) + DesiredSymbols& symbolsToAnalyze, + std::shared_ptr<Target::TargetBase>& targetInfo + ): symbolsToAnalyze_m( symbolsToAnalyze ), + targetInfo_m( targetInfo ) { } @@ -191,7 +193,7 @@ namespace Coverage { const char *instruction ) { - if ( !TargetInfo ) { + if ( !targetInfo_m ) { fprintf( stderr, "ERROR: ObjdumpProcessor::IsBranch - unknown architecture\n" @@ -200,14 +202,14 @@ namespace Coverage { return false; } - return TargetInfo->isBranch( instruction ); + return targetInfo_m->isBranch( instruction ); } bool ObjdumpProcessor::isBranchLine( const char* const line ) { - if ( !TargetInfo ) { + if ( !targetInfo_m ) { fprintf( stderr, "ERROR: ObjdumpProcessor::isBranchLine - unknown architecture\n" @@ -216,7 +218,7 @@ namespace Coverage { return false; } - return TargetInfo->isBranchLine( line ); + return targetInfo_m->isBranchLine( line ); } bool ObjdumpProcessor::isNop( @@ -224,7 +226,7 @@ namespace Coverage { int& size ) { - if ( !TargetInfo ){ + if ( !targetInfo_m ){ fprintf( stderr, "ERROR: ObjdumpProcessor::isNop - unknown architecture\n" @@ -233,7 +235,7 @@ namespace Coverage { return false; } - return TargetInfo->isNopLine( line, size ); + return targetInfo_m->isNopLine( line, size ); } void ObjdumpProcessor::getFile( @@ -243,12 +245,12 @@ namespace Coverage { ) { rld::process::status status; - rld::process::arg_container args = { TargetInfo->getObjdump(), + rld::process::arg_container args = { targetInfo_m->getObjdump(), "-Cda", "--section=.text", "--source", fileName }; try { - status = rld::process::execute( TargetInfo->getObjdump(), + status = rld::process::execute( targetInfo_m->getObjdump(), args, objdumpFile.name(), err.name() ); if ( (status.type != rld::process::status::normal) || (status.code != 0) ) { @@ -256,7 +258,7 @@ namespace Coverage { } } catch( rld::error& err ) { - std::cout << "Error while running " << TargetInfo->getObjdump() + std::cout << "Error while running " << targetInfo_m->getObjdump() << " on " << fileName << std::endl; std::cout << err.what << " in " << err.where << std::endl; return; @@ -497,4 +499,11 @@ namespace Coverage { } } } + + void ObjdumpProcessor::setTargetInfo( + std::shared_ptr<Target::TargetBase>& targetInfo + ) + { + targetInfo_m = targetInfo; + } } |