From 54a01e885b23df89e7e1e1585e896e0b7c53cf1d Mon Sep 17 00:00:00 2001 From: Laurent Morichetti Date: Tue, 14 Jan 2020 21:10:27 -0800 Subject: [PATCH] Use malloc/free in the dbgapi callbacks Replace xmalloc/xfree with malloc/free for the allocate_memory/ deallocate_memory callbacks. The dbgapi requires nullptr to be returned if the memory cannot be allocated, but xmalloc throws an internal gdb error in such cases. gdb/ChangeLog: * gdb/rocm-tdep.c: Adjust callbacks. Depends-On: Id4af9dcd08b66acb6a9e9997c28a2807a5e0652e Change-Id: I1cf6a4f6e96d8b86b716291f03a22dfbd5d83262 --- gdb/rocm-tdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/rocm-tdep.c b/gdb/rocm-tdep.c index 55b4c79d45..da98d7c08f 100644 --- a/gdb/rocm-tdep.c +++ b/gdb/rocm-tdep.c @@ -1236,10 +1236,10 @@ static cli_style_option verbose_style ("rocm_verbose", ui_file_style::BLUE); static amd_dbgapi_callbacks_t dbgapi_callbacks = { /* allocate_memory. */ - .allocate_memory = xmalloc, + .allocate_memory = malloc, /* deallocate_memory. */ - .deallocate_memory = xfree, + .deallocate_memory = free, /* get_os_pid. */ .get_os_pid = [] (amd_dbgapi_client_process_id_t client_process_id, -- 2.34.1