From 7d43aaec9b7fbc1ee70cf4f4abe7d541a199b27d Mon Sep 17 00:00:00 2001 From: Tony Date: Thu, 30 Apr 2020 06:06:24 -0400 Subject: [PATCH] Update README file and use of updated ROCdbgapi header - 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 | 23 +++++++++++++++-------- gdb/rocm-tdep.c | 24 ++++++++++++++---------- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/README-ROCM.md b/README-ROCM.md index 38fc407d04..958c5d0ef5 100644 --- a/README-ROCM.md +++ b/README-ROCM.md @@ -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: diff --git a/gdb/rocm-tdep.c b/gdb/rocm-tdep.c index c4d740361a..18e6625c69 100644 --- a/gdb/rocm-tdep.c +++ b/gdb/rocm-tdep.c @@ -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 (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 (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 (client_process_id); + inferior *inf = reinterpret_cast (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 (client_process_id); + inferior *inf = reinterpret_cast (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 (client_process_id); + inferior *inf = reinterpret_cast (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 (client_process_id); + inferior *inf = reinterpret_cast (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 (client_process_id); + inferior *inf = reinterpret_cast (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 (client_process_id); + inferior *inf = reinterpret_cast (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 (client_process_id); + inferior *inf = reinterpret_cast (client_process_id); struct rocm_inferior_info *info = get_rocm_inferior_info (inf); auto it = info->breakpoint_map.find (breakpoint_id.handle); -- 2.34.1