diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b2ce554..29c0b39b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,6 +140,9 @@ if (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64") endif () endif () +# NOTE: Step through wamr in gdb +set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -ggdb") + # The following flags are to enhance security, but it may impact performance, # we disable them by default. #if (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64") diff --git a/core/shared/platform/baremetal/platform_init.c b/core/shared/platform/baremetal/platform_init.c index 996f6dcb..41e9d537 100644 --- a/core/shared/platform/baremetal/platform_init.c +++ b/core/shared/platform/baremetal/platform_init.c @@ -95,23 +95,30 @@ bh_log_proc_mem(const char *function, uint32 line) void * os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file) { + printf("os_mmap(size=%u, prot=%d, flags=%d)\n", (unsigned)size, prot, + flags); return NULL; } void * os_mremap(void *old_addr, size_t old_size, size_t new_size) { + printf("os_mremap(old=%p, old_size=%u, new_size=%u)\n", old_addr, + (unsigned)old_size, (unsigned)new_size); return NULL; } void os_munmap(void *addr, size_t size) { + printf("os_munmap(addr=%p, size=%u)\n", addr, (unsigned)size); } int os_mprotect(void *addr, size_t size, int prot) { + printf("os_mprotect(addr=%p, size=%u, prot=%d)\n", addr, (unsigned)size, + prot); return 0; }