This content has been marked as final. Show 3 replies
Is `libptmalloc2.so`malloc.c compiled with -g?
If not then malloc_state will not be accessible.
Is this perhaps on Linux (which on?/) and you expect .dbg files to be available for libptmalloc2.so?
Try "whereis malloc_state" and dbx may find a module which has the definition available.
You can include malloc_state in a dummy file, with a reference to it, compile that file with -g
and then include that dummy file in your application.
Thanks for replying. It was helpful. The problem was libptmalloc was not compiled with debug flag. It is on Solaris. Again if I get a core file from an application which was not compiled with debug flag (instead compiled with optimized flag on), can I get the arena info (main_arena) and print the malloc_state structure from the core file?
If you have access to the relevant .h you can use the technique described here: