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

Categories

0 votes
252 views
in Technique[技术] by (71.8m points)

c++ - Layout of compiled objects

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

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

1 Answer

0 votes
by (71.8m points)

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)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...