954,554 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Question about debugging .class file

Hello everyone,


When debugging a C or C++ binary file, the file is different from the release version of binary file (debug version binary file is larger). My question is, if we want to debug a Java binary file (.class file), is the version of file (which we use to debug) the same as the file (which we are going to release)? If they are different, shall we add some additional options to compiler in order to make debug version binary file be different from release version binary file?


thanks in advance,
George

George2
Junior Poster
189 posts since Nov 2004
Reputation Points: 11
Solved Threads: 0
 

By default the compiler includes debug information. You can add compiler flags to turn that off.
This is the reverse of how many C/C++ compilers work.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Thanks jwenting,

By default the compiler includes debug information. You can add compiler flags to turn that off. This is the reverse of how many C/C++ compilers work.

Suppose we compile .class file into debug status (so that we can use F6, F7 and F8 in Java IDE to debug .class file). Do you mean the .class file (which we use to debug as mentioned above) is different from the file which we are going to release?

What do you mean "reverse of how many C/C++ compilers work"? I think Java compiler is very similar to C/C++ complier. Why you say reverse?


regards,
George

George2
Junior Poster
189 posts since Nov 2004
Reputation Points: 11
Solved Threads: 0
 

Please try to understand what debug information actually is...

Of course the deliverable will be different between compilation with and without debug information. That's the whole point :)

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Thanks jwenting,

Please try to understand what debug information actually is...

Of course the deliverable will be different between compilation with and without debug information. That's the whole point :)

Your reply is very helpful. Do you know what debug information has been added?


regards,
George

George2
Junior Poster
189 posts since Nov 2004
Reputation Points: 11
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You