PEL: move pdbg init function to sbe ffdc init

BMC reboot followed by BMC software update pdbg attribute read
api failure due to pdbg default device tree selection instead
of BMC specific device tree. Pdbg initialises default
device tree incase user is not configured correctly.

In this usecase DEVTREE links initialises as part of
obmc-flash-bios-init.service, and this runs after
phosphor logging service. Proposed fix is to do pdbg
init as part of PEL request from application. This requests
only triggered when host

Tested: SBE PEL is created after software code update
and verified.

Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
Change-Id: Ie04d65b2d295d72c0ea9fe7b374dbb74a80d7a41
diff --git a/extensions/openpower-pels/sbe_ffdc_handler.cpp b/extensions/openpower-pels/sbe_ffdc_handler.cpp
index 9e6a088..af445c3 100644
--- a/extensions/openpower-pels/sbe_ffdc_handler.cpp
+++ b/extensions/openpower-pels/sbe_ffdc_handler.cpp
@@ -14,10 +14,13 @@
  * limitations under the License.
  */
 
-#include "sbe_ffdc_handler.hpp"
+extern "C" {
+#include <libpdbg.h>
+}
 
 #include "fapi_data_process.hpp"
 #include "pel.hpp"
+#include "sbe_ffdc_handler.hpp"
 #include "temporary_file.hpp"
 
 #include <ekb/hwpf/fapi2/include/return_code_defs.H>
@@ -158,6 +161,12 @@
     // formated FFDC data structure after FFDC packet processing
     FFDC ffdc;
 
+    if (!pdbg_targets_init(NULL))
+    {
+        log<level::ERR>("pdbg_targets_init failed, skipping ffdc processing");
+        return;
+    }
+
     try
     {
         // libekb provided wrapper function to convert SBE FFDC