Difference between revisions of "Debug generated C code"
(→Unix based platform) |
(→Windows) |
||
Line 12: | Line 12: | ||
== Windows == | == Windows == | ||
+ | After doing the changes below (depending on your C compiler), you can recompile your project from scratch and the debug information will be present. | ||
− | + | === MinGW === | |
+ | Edit $ISE_EIFFEL\studio\config\$ISE_PLATFORM\$ISE_C_COMPILER\config.eif and perform the following edits: | ||
+ | # Replace the content of ''optimize'' by '''-O0 -g'''. | ||
+ | # Replace the content of ''wkoptimize'' by '''-O0 -g'''. | ||
− | === | + | === Visual C++ === |
+ | Edit $ISE_EIFFEL\studio\config\$ISE_PLATFORM\$ISE_C_COMPILER\config.eif and perform the following edits: | ||
+ | # Replace the content of ''optimize' by '''-Od -Zi -MT'''. | ||
+ | # Search and replace all occurrences of '''-NODEFAULTLIB:libc''' by '''-NODEFAULTLIB:libc -DEBUG'''. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===Start debug C codes in Visual Studio=== | ===Start debug C codes in Visual Studio=== |
Revision as of 09:18, 8 June 2009
Sometimes you need debug Eiffel generated C codes, this is how to.
Unix
Edit $ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include/config.sh and
- To the value of wkoptimize add the -g option.
- Replace the value of optimize to disable the C optimization (usually -O0) and add -g.
Once you have done that, do in your W_code or F_code directory:
- make clobber
- finish_freezing
Windows
After doing the changes below (depending on your C compiler), you can recompile your project from scratch and the debug information will be present.
MinGW
Edit $ISE_EIFFEL\studio\config\$ISE_PLATFORM\$ISE_C_COMPILER\config.eif and perform the following edits:
- Replace the content of optimize by -O0 -g.
- Replace the content of wkoptimize by -O0 -g.
Visual C++
Edit $ISE_EIFFEL\studio\config\$ISE_PLATFORM\$ISE_C_COMPILER\config.eif and perform the following edits:
- Replace the content of optimize' by -Od -Zi -MT.
- Search and replace all occurrences of -NODEFAULTLIB:libc by -NODEFAULTLIB:libc -DEBUG.
Start debug C codes in Visual Studio
Now you can attach the Eiffel process in Visual Studio and debug. Don't forget to catch all exceptions in Visual Studio.
If you want to debug Eiffel generated DLL's C codes, when coping the DLL, you must copy the ".pdb" with the DLL together since ".pdb" file contains debugging information for Visual Studio.