Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Is there a way—much like viewing the result of preprocessing with gcc -E—to see what my objects look like once compiled into object files?

I am talking about GCC, but a solution including MSVC would be fine.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
262 views
Welcome To Ask or Share your Answers For Others

1 Answer

For Visual C++:

I finally managed to dig up the (well-hidden!) undocumented compiler flags that MSVC++ supports using information from here and here. Here they are:

/d1reportSingleClassLayoutXXX
/d1reportAllClassLayout

(replace XXX with the class name)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...