[PATCH rtems-tools v1 2/2] rld-rapp.cpp: Add catch for exception

Ryan Long ryan.long at oarcorp.com
Thu Oct 7 13:40:38 UTC 2021


CID 1471643: Uncaught exception

Closes #4502
---
 rtemstoolkit/rld-rap.cpp | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/rtemstoolkit/rld-rap.cpp b/rtemstoolkit/rld-rap.cpp
index 235de27..93ffbdc 100644
--- a/rtemstoolkit/rld-rap.cpp
+++ b/rtemstoolkit/rld-rap.cpp
@@ -724,10 +724,19 @@ namespace rld
     section_merge::~section_merge ()
     {
       if (rld::verbose () >= RLD_VERBOSE_FULL_DEBUG)
-        std::cout << "rap:section-merge: " << sec.name
-                  << " size=" << sec.size ()
-                  << " offset=" << sec.offset
-                  << " " << obj.obj.name ().full ()  << std::endl;
+        try
+        {
+          std::cout << "rap:section-merge: " << sec.name
+                    << " size=" << sec.size ()
+                    << " offset=" << sec.offset
+                    << " " << obj.obj.name ().full ()  << std::endl;
+        }
+        catch ( rld::error re )
+        {
+          std::cerr << "error: "
+                    << re.where << ": " << re.what
+                    << std::endl;
+        }
     }
 
     void
-- 
1.8.3.1



More information about the devel mailing list