YNWA
YNWA

Reputation: 700

Looking for way to get a list of all class / struct from a C++ Windows program

I'm debugging some suspected memory leak issue, and I see in Windbg heap stats a large list of allocations of specific size. Traditionally - to find the source of the allocation I have used Gflags, reproduce the issue and looked at the stacks information.

But I'm wondering - the size of class / struct is known at compile time, isn't there a way to get the list of classes + their size from the symbols somehow ? Even just the list of class names - these I can feed to windbg to calculate their size: ?? sizeof(CLASS_NAME)

Anyone know of such way ? I'm not interested in 3rd party tools / profilers, just this specific task - as I'm usually given only a process dump after the issue had happened - so its too late to use this tools

Upvotes: 0

Views: 84

Answers (1)

YNWA
YNWA

Reputation: 700

@Andrey Turkin comment gave me a useful way,

dt -s SIZE MODULE!*

Does the trick.

If anyone knows of a quick global way for all modules - also useful (I feel there is a way with windbg scripting, but I'm not a fan of that method)

Update:

dt -s SIZE -n *!*

Seems to work

Upvotes: 0

Related Questions