In windbg, we can use "!heap -p -a [address]" to show the stacktrace when the heap was allocated.

In gdb, especially for kernel debugging, there is any way to achieve the same thing in linux?

  • I really looked hard to find what you want but, i couldn't find any close thing to your question. I don't know how WinDBG support that feature, maybe because Windows NT specific kernel structure. Edit: I saw Igor's answer now. You must find another way. Mar 9 '17 at 15:18

AFAIK Windbg relies on the user-mode stack trace database provided by the kernel/ntdll. I think there is nothing similar built-in into Linux, but you can try some third-party tools, e.g. heaptrack

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.