DynamoRIO / DynamoRIO/drmemory
update libc identification on Mac
- Dominant language
- C
- Stars
- 2.7k
- Forks
- 290
- PR merge metrics
- No merged PRs in 30d
Description
_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on February 23, 2014 18:35:55_
Need to review why we care on Linux or Mac to decide what we should update "libc.*" to
on Mac. Earlier I updated alloc.c to look for libSystem, but we may want to know
what holds malloc instead.
malloc on 10.9 is in libsystem_malloc.dylib while on 10.7 it's in
libsystem_c.dylib:
> grep malloc logs/symcache/\* | grep -v ',0x0$'
logs/symcache/dyld.txt:malloc,0x1437b
logs/symcache/libdrmemory.1.6.179.dylib.txt:malloc_usable_size,0x2dce18
logs/symcache/libsystem_kernel.dylib.txt:malloc,0x590
logs/symcache/libsystem_malloc.dylib.txt:malloc,0x10f10
$ grep malloc drmemory/logs/symcache/\* | grep -v ',0x0$'
drmemory/logs/symcache/dyld.txt:malloc,0x133fb
drmemory/logs/symcache/libdrmemory.1.6.1.dylib.txt:malloc_usable_size,0xf1660
drmemory/logs/symcache/libsystem_c.dylib.txt:malloc,0xb2850
Also, drmem code has 3 different pieces of code for this!
1) drmemory.c sets libc_base -- but nobody uses that anymore except
replace.c which can use get_libc_base() instead => remove
2) alloc.c has module_is_libc() => seems should share w/ heap.c
3) heap.c has get_libc_base()
_Original issue: http://code.google.com/p/drmemory/issues/detail?id=1450_
Contributor guide
Assessment
This issue has not been assessed yet.