Closed Celthi closed 2 years ago
Hi @yanqi27 This is the PR using the approach I discussed in https://github.com/yanqi27/core_analyzer/pull/58#issuecomment-1166311009
We should have the following layers:
This PR tries to address layer 3 by extracting all the common functions of pt malloc heap.
Can we keep the
src/heap_ptmalloc.cpp
file for older gdb versions, 7.11.1/8.1, until they are totally phased out? We may name the new common function file something likeheap_ptmalloc_common.cpp
.
gdb 7.11/8.1 is not using src/heap_ptmalloc.cpp
anymore: https://github.com/yanqi27/core_analyzer/blob/master/gdbplus/gdb-7.11.1/gdb/heap_ptmalloc.c
https://github.com/yanqi27/core_analyzer/blob/master/gdbplus/gdb-8.1/gdb/heap_ptmalloc.c
Yes. heap_ptmalloc_common.cpp
is a better name.
yeah, I forgot that. In which case, I am ok to do it either way, the old name or the xx_common.
In this PR, the
heap_pt_malloc.cpp
is added to the compiling process. It is aiming to contain all the common functions related to different pt malloc version. Now it only has theget_libc_version
. By adding this file into the compiling, we can progressively consolidate all the common functions into one place. The consolidating procedure iscommon_function
into the heap_pt_malloc.cpp under namespacept
pt::common_function
common_function
And when all the common functions are moved into heap_ptmalloc.cpp, we can consider removing the namespace
pt