Check the amd-dbgapi library version
authorLaurent Morichetti <laurent.morichetti@amd.com>
Sat, 18 Apr 2020 00:37:26 +0000 (17:37 -0700)
committerLaurent Morichetti <laurent.morichetti@amd.com>
Wed, 6 May 2020 20:49:32 +0000 (13:49 -0700)
Make sure the loaded debugger library version is greater than or
equal to the one used to build ROCgdb.

Change-Id: I6a651a721c1e3066a6f95a15caebbe1d207eda87

gdb/rocm-tdep.c

index 2cadca173020b9860d653ca353d775788bebcd75..1897a1ec378d65187b2b6403569d5a812e1a9654 100644 (file)
@@ -1716,9 +1716,20 @@ extern initialize_file_ftype _initialize_rocm_tdep;
 void
 _initialize_rocm_tdep (void)
 {
+  /* Make sure the loaded debugger library version is greater than or equal to
+     the one used to build ROCgdb.  */
+  uint32_t major, minor, patch;
+  amd_dbgapi_get_version (&major, &minor, &patch);
+  if (major != AMD_DBGAPI_VERSION_MAJOR || minor < AMD_DBGAPI_VERSION_MINOR)
+    error (
+        _ ("amd-dbgapi library version mismatch, got %d.%d.%d, need %d.%d+"),
+        major, minor, patch, AMD_DBGAPI_VERSION_MAJOR,
+        AMD_DBGAPI_VERSION_MINOR);
+
   /* Initialize the ROCm Debug API.  */
-  if (amd_dbgapi_initialize (&dbgapi_callbacks) != AMD_DBGAPI_STATUS_SUCCESS)
-    return;
+  amd_dbgapi_status_t status = amd_dbgapi_initialize (&dbgapi_callbacks);
+  if (status != AMD_DBGAPI_STATUS_SUCCESS)
+    error (_ ("amd-dbgapi failed to initialize (rc=%d)"), status);
 
   /* Set the initial log level.  */
   amd_dbgapi_set_log_level (get_debug_amd_dbgapi_log_level ());
This page took 0.024859 seconds and 4 git commands to generate.