yanqi27 / core_analyzer

A power tool to debug memory-related issues
376 stars 72 forks source link

can't use heap cmd in gdb which compiled by gdb-12.1 with core_analyzer src #92

Closed achilsh closed 1 year ago

achilsh commented 1 year ago

problem:

(gdb) heap Cannot get the "libc_version" from the debugee, read it from the host machine. This might not be accurate. Cannot get the "__libc_version" from the debugee, read it from the host machine. This might not be accurate. Cannot get the "libc_version" from the debugee, read it from the host machine. This might not be accurate. Failed to get the addresses of global variables mainarena & mp failed to init heap

my src: 1 #include 2 using namespace std; 3 4 void mem_leak_test() { 5 for (int i = 0; i < 10; i++) { 6 char *p = new char[10]; 7 } 8 } 10 int main() { 11 mem_leak_test(); 12 13 return 0; 14 }

yanqi27 commented 1 year ago

could you refer to the previous issue https://github.com/yanqi27/core_analyzer/issues/70 ? You may also check the unit test under test folder which shows the complete script of installation of all prerequisites.