Update README file and use of updated ROCdbgapi header
authorTony <Tony.Tye@amd.com>
Thu, 30 Apr 2020 10:06:24 +0000 (06:06 -0400)
committerLaurent Morichetti <laurent.morichetti@amd.com>
Wed, 6 May 2020 20:50:57 +0000 (13:50 -0700)
- Add support for additional OS distributions to README.
- Allow ROCdbgapi to use incomplete struct types for client opaque
  types by adding reinterpret_cast.

Change-Id: I06b277cb46ee35c97467cc3a04abcc390d156d24

README-ROCM.md
gdb/rocm-tdep.c

index 38fc407d040844d1b38e4647d777d4a5e943b974..958c5d0ef537f5785c7fab5ed27c4bd306097bba 100644 (file)
@@ -41,7 +41,8 @@ in this folder or check the GNU Debugger (GDB) web site at:
 Build the ROCm Debugger
 -----------------------
 
-ROCgdb can be built on Ubuntu 16.04, Ubuntu 18.04, and Centos 7.6.
+ROCgdb can be built on Ubuntu 16.04, Ubuntu 18.04, Centos 8.1, RHEL 8.1, and SLES
+15 Service Pack 1.
 
 Building ROCgdb has the following prerequisites:
 
@@ -53,18 +54,24 @@ Building ROCgdb has the following prerequisites:
 3. For Ubuntu 16.04 and Ubuntu 18.04 the following adds the needed packages:
 
    ````shell
-   apt install bison flex gcc make ncurses-dev texinfo g++ \
-     zlib1g-dev libexpat-dev libpython2.7-dev python2.7-minimal liblzma-dev \
+   apt install bison flex gcc make ncurses-dev texinfo g++ zlib1g-dev \
+     libexpat-dev libpython2.7-dev python2.7-minimal liblzma-dev \
      libbabeltrace-dev libbabeltrace-ctf-dev
    ````
 
-4. For CentOS 7.6 the following adds the needed packages:
+4. For CentOS 8.1 and RHEL 8.1 the following adds the needed packages:
 
    ````shell
-   yum install -y epel-release centos-release-scl
-   yum install -y bison flex gcc make texinfo texinfo-tex gcc-c++ \
-     zlib-devel expat-devel python-devel xz-devel \
-     libbabeltrace-devel ncurses-devel
+   yum install -y epel-release centos-release-scl bison flex gcc make \
+     texinfo texinfo-tex gcc-c++ zlib-devel expat-devel python-devel \
+     xz-devel libbabeltrace-devel ncurses-devel
+   ````
+
+5. For SLES 15 Service Pack 1 the following adds the needed packages:
+
+   ````shell
+   zypper in bison flex gcc make texinfo gcc-c++ zlib-devel libexpat-devel \
+     python-devel xz-devel babeltrace-devel ncurses-devel
    ````
 
 An example command-line to build ROCgdb on Linux is:
index c4d740361a5dfe60994f2f4c3d0fa1aef2d684f4..18e6625c690e5b6502b1e2808aa53db68d5f4bf6 100644 (file)
@@ -299,8 +299,10 @@ rocm_breakpoint_check_status (struct bpstats *bs)
   amd_dbgapi_breakpoint_id_t breakpoint_id{ it->first };
   amd_dbgapi_breakpoint_action_t action;
 
-  status = amd_dbgapi_report_breakpoint_hit (process_id, breakpoint_id,
-                                             inferior_thread (), &action);
+  status = amd_dbgapi_report_breakpoint_hit (
+      process_id, breakpoint_id,
+      reinterpret_cast<amd_dbgapi_client_thread_id_t> (inferior_thread ()),
+      &action);
 
   if (status != AMD_DBGAPI_STATUS_SUCCESS)
     error (_ ("amd_dbgapi_report_breakpoint_hit failed: breakpoint_%ld "
@@ -1208,7 +1210,9 @@ rocm_target_inferior_created (struct target_ops *target, int from_tty)
 
   gdb_assert (info->wave_stop_events.empty ());
 
-  status = amd_dbgapi_process_attach (inf, &info->process_id);
+  status = amd_dbgapi_process_attach (
+               reinterpret_cast<amd_dbgapi_client_process_id_t> (inf),
+               &info->process_id);
 
   if (status == AMD_DBGAPI_STATUS_ERROR_VERSION_MISMATCH)
     warning (_ ("The version of the kernel driver does not match the version "
@@ -1288,7 +1292,7 @@ static amd_dbgapi_callbacks_t dbgapi_callbacks = {
   /* get_os_pid.  */
   .get_os_pid = [] (amd_dbgapi_client_process_id_t client_process_id,
                     pid_t *pid) -> amd_dbgapi_status_t {
-    inferior *inf = static_cast<inferior *> (client_process_id);
+    inferior *inf = reinterpret_cast<inferior *> (client_process_id);
     struct rocm_inferior_info *info = get_rocm_inferior_info (inf);
 
     if (info->has_exited)
@@ -1304,7 +1308,7 @@ static amd_dbgapi_callbacks_t dbgapi_callbacks = {
         const char *library_name, amd_dbgapi_shared_library_id_t library_id,
         amd_dbgapi_shared_library_state_t *library_state)
       -> amd_dbgapi_status_t {
-    inferior *inf = static_cast<inferior *> (client_process_id);
+    inferior *inf = reinterpret_cast<inferior *> (client_process_id);
     struct rocm_inferior_info *info = get_rocm_inferior_info (inf);
 
     if (!library_name || !library_state)
@@ -1353,7 +1357,7 @@ static amd_dbgapi_callbacks_t dbgapi_callbacks = {
   .disable_notify_shared_library
   = [] (amd_dbgapi_client_process_id_t client_process_id,
         amd_dbgapi_shared_library_id_t library_id) -> amd_dbgapi_status_t {
-    inferior *inf = static_cast<inferior *> (client_process_id);
+    inferior *inf = reinterpret_cast<inferior *> (client_process_id);
     struct rocm_inferior_info *info = get_rocm_inferior_info (inf);
 
     auto it = info->notify_solib_map.find (library_id.handle);
@@ -1369,7 +1373,7 @@ static amd_dbgapi_callbacks_t dbgapi_callbacks = {
       [] (amd_dbgapi_client_process_id_t client_process_id,
           amd_dbgapi_shared_library_id_t library_id, const char *symbol_name,
           amd_dbgapi_global_address_t *address) {
-        inferior *inf = static_cast<inferior *> (client_process_id);
+        inferior *inf = reinterpret_cast<inferior *> (client_process_id);
         struct rocm_inferior_info *info = get_rocm_inferior_info (inf);
 
         auto it = info->notify_solib_map.find (library_id.handle);
@@ -1399,7 +1403,7 @@ static amd_dbgapi_callbacks_t dbgapi_callbacks = {
           amd_dbgapi_shared_library_id_t shared_library_id,
           amd_dbgapi_global_address_t address,
           amd_dbgapi_breakpoint_id_t breakpoint_id) {
-        inferior *inf = static_cast<inferior *> (client_process_id);
+        inferior *inf = reinterpret_cast<inferior *> (client_process_id);
         struct rocm_inferior_info *info = get_rocm_inferior_info (inf);
 
         /* Initialize the breakpoint ops lazily since we depend on
@@ -1456,7 +1460,7 @@ static amd_dbgapi_callbacks_t dbgapi_callbacks = {
   .remove_breakpoint =
       [] (amd_dbgapi_client_process_id_t client_process_id,
           amd_dbgapi_breakpoint_id_t breakpoint_id) {
-        inferior *inf = static_cast<inferior *> (client_process_id);
+        inferior *inf = reinterpret_cast<inferior *> (client_process_id);
         struct rocm_inferior_info *info = get_rocm_inferior_info (inf);
 
         auto it = info->breakpoint_map.find (breakpoint_id.handle);
@@ -1474,7 +1478,7 @@ static amd_dbgapi_callbacks_t dbgapi_callbacks = {
       [] (amd_dbgapi_client_process_id_t client_process_id,
           amd_dbgapi_breakpoint_id_t breakpoint_id,
           amd_dbgapi_breakpoint_state_t breakpoint_state) {
-        inferior *inf = static_cast<inferior *> (client_process_id);
+        inferior *inf = reinterpret_cast<inferior *> (client_process_id);
         struct rocm_inferior_info *info = get_rocm_inferior_info (inf);
 
         auto it = info->breakpoint_map.find (breakpoint_id.handle);
This page took 0.026427 seconds and 4 git commands to generate.