diff options
author | Ryan Long <ryan.long@oarcorp.com> | 2021-10-20 10:11:34 -0400 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2021-12-10 11:05:16 -0600 |
commit | 361e30450c5a6c8c3c18bac041ac1afc15f76d02 (patch) | |
tree | 0ed34757e7453aa74a80d01a56697630128827ac /tester/covoar/Target_arm.cc | |
parent | TargetFactory.cc: Convert to C++ (diff) | |
download | rtems-tools-361e30450c5a6c8c3c18bac041ac1afc15f76d02.tar.bz2 |
Target: Convert to C++
Diffstat (limited to 'tester/covoar/Target_arm.cc')
-rw-r--r-- | tester/covoar/Target_arm.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tester/covoar/Target_arm.cc b/tester/covoar/Target_arm.cc index 94d50bb..50c9ce3 100644 --- a/tester/covoar/Target_arm.cc +++ b/tester/covoar/Target_arm.cc @@ -82,26 +82,28 @@ namespace Target { } bool Target_arm::isNopLine( - const char* const line, - int& size + const std::string& line, + int& size ) { - if (!strcmp( &line[strlen(line)-3], "nop")) { + size_t stringLen = line.length(); + + if ( line.substr( stringLen - 3 ) == "nop" ) { size = 4; return true; } // On ARM, there are literal tables at the end of methods. // We need to avoid them. - if (!strncmp( &line[strlen(line)-10], ".byte", 5)) { + if ( line.substr( stringLen - 10, 5 ) == ".byte" ) { size = 1; return true; } - if (!strncmp( &line[strlen(line)-13], ".short", 6)) { + if ( line.substr( stringLen - 13, 6 ) == ".short" ) { size = 2; return true; } - if (!strncmp( &line[strlen(line)-16], ".word", 5)) { + if ( line.substr( stringLen - 16, 5 ) == ".word" ) { size = 4; return true; } @@ -111,7 +113,7 @@ namespace Target { } bool Target_arm::isBranch( - const char* instruction + const std::string& instruction ) { throw rld::error( |