Attn: Remove --defaultbreakpoint add --defaultti
In order to support breakpoint handling and TI handling on systems that
did not support the get TI info interface the --defaultbreakpoint
configuration option was added. This switch is no longer needed and
breakpoint handling is now the default action for available but invalid
TI info data. A new option --defaultti was added to force handling of
TI's when TI info is available but not valid.
Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: I4bdf90dcbbf20b3428a1cef6f1a71ec32b3ca238
diff --git a/attn/bp_handler.cpp b/attn/bp_handler.cpp
index e25a243..408fe58 100644
--- a/attn/bp_handler.cpp
+++ b/attn/bp_handler.cpp
@@ -1,3 +1,4 @@
+#include <attn/attn_handler.hpp>
#include <attn/attn_logging.hpp>
#include <sdbusplus/bus.hpp>
@@ -10,22 +11,34 @@
* When the special attention is due to a breakpoint condition we will notify
* Cronus over the dbus interface.
*/
-void bpHandler()
+int bpHandler()
{
+ int rc = RC_SUCCESS; // assume success
+
// trace message
trace<level::INFO>("Notify Cronus");
// notify Cronus over dbus
- auto bus = sdbusplus::bus::new_system();
- auto msg = bus.new_signal("/", "org.openbmc.cronus", "Brkpt");
+ try
+ {
+ auto bus = sdbusplus::bus::new_system();
+ auto msg = bus.new_signal("/", "org.openbmc.cronus", "Brkpt");
- // Cronus will figure out proc, core, thread so just send 0,0,0
- std::array<uint32_t, 3> params{0, 0, 0};
- msg.append(params);
+ // Cronus will figure out proc, core, thread so just send 0,0,0
+ std::array<uint32_t, 3> params{0, 0, 0};
+ msg.append(params);
- msg.signal_send();
+ msg.signal_send();
+ }
+ catch (const sdbusplus::exception::SdBusError& e)
+ {
+ trace<level::INFO>("bpHandler() exception");
+ std::string traceMsg = std::string(e.what(), maxTraceLen);
+ trace<level::ERROR>(traceMsg.c_str());
+ rc = RC_NOT_HANDLED;
+ }
- return;
+ return rc;
}
} // namespace attn