baremetal: log memory mapping functions

This commit is contained in:
2026-03-08 13:42:07 +01:00
parent ca3a01d7fc
commit 82ef2ab072
2 changed files with 10 additions and 0 deletions

View File

@ -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")

View File

@ -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;
}