[rtems-tools commit] TraceConverter.cc: Add catch for exception

Joel Sherrill joel at rtems.org
Thu Nov 4 15:43:18 UTC 2021


Module:    rtems-tools
Branch:    master
Commit:    d1df4f6e02fe22d2cb542adbd6ba4248ee077892
Changeset: http://git.rtems.org/rtems-tools/commit/?id=d1df4f6e02fe22d2cb542adbd6ba4248ee077892

Author:    Ryan Long <ryan.long at oarcorp.com>
Date:      Thu Oct 28 12:54:06 2021 -0400

TraceConverter.cc: Add catch for exception

CID 1471639: Add catch for exception

Closes #4501

---

 tester/covoar/TraceConverter.cc | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/tester/covoar/TraceConverter.cc b/tester/covoar/TraceConverter.cc
index 4a24bd4..7770b11 100644
--- a/tester/covoar/TraceConverter.cc
+++ b/tester/covoar/TraceConverter.cc
@@ -174,10 +174,24 @@ int main(
   }
 
   // If a dynamic library was specified, determine the load address.
-  if ( !dynamicLibrary.empty() )
-    executableInfo->setLoadAddress(
-      objdumpProcessor.determineLoadAddress( executableInfo )
-    );
+  if ( !dynamicLibrary.empty() ) {
+    try
+    {
+      executableInfo->setLoadAddress(
+        objdumpProcessor.determineLoadAddress( executableInfo )
+      );
+    }
+    catch ( rld::error re )
+    {
+      std::cerr << "error: "
+                << re.where << ": " << re.what
+                << std::endl;
+      ec = 10;
+
+      return ec;
+    }
+  }
+
   objdumpProcessor.loadAddressTable( executableInfo, objdumpFile, err );
   log.processFile( logname, objdumpProcessor );
   trace.writeFile( tracefile, &log, verbose );



More information about the vc mailing list