From 77904ffeb0ec4b7ed149ab7f360f93026295e50b Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Mon, 29 Jul 2019 21:16:47 -0700 Subject: [PATCH] [Pal/Linux-SGX] Fix incorrect "0x%p" format string for ocall_load_debug() Previously, setup_pal_map() instructed GDB to load symbols for the PAL shared library using incorrectly formatted string with "0x%p". This led to addresses of the form "0x0xdeadbeef" which could not be parsed by GDB. This commit fixes this via "%p" and thus enables SGX-GDB again. --- Pal/src/host/Linux-SGX/db_rtld.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Pal/src/host/Linux-SGX/db_rtld.c b/Pal/src/host/Linux-SGX/db_rtld.c index 19828339..7f0707d4 100644 --- a/Pal/src/host/Linux-SGX/db_rtld.c +++ b/Pal/src/host/Linux-SGX/db_rtld.c @@ -158,8 +158,8 @@ void setup_pal_map (struct link_map * pal_map) char buffer[BUFFER_LENGTH]; snprintf(buffer, BUFFER_LENGTH, - "add-symbol-file %s 0x%p -readnow -s .rodata 0x%p " - "-s .dynamic 0x%p -s .data 0x%p -s .bss 0x%p", + "add-symbol-file %s %p -readnow -s .rodata %p " + "-s .dynamic %p -s .data %p -s .bss %p", pal_map->l_name, §ion_text, §ion_rodata, §ion_dynamic, §ion_data, §ion_bss);