![]() |
Chapter 6 | ![]() |
> gcc -g autowiz.c -o autowiz |
CircleMUD's default setup includes this flag by default. If you want to make a potentially sleeker, smaller, build with a smaller memory footprint, you can remove this option. Personally speaking, I've only ever had this problem once, and I was doing some pretty tricky stuff. Normally compiler optimizations are pretty safe, and you shouldn't have to question them.
Note that sometimes including the optimization flags (-O# where # is 1 or 2 usually) can cause subtle inconsistencies while debugging; in rare cases, optimization can also cause crashes that cannot be duplicated without the optimization flags on! This can put you in a catch 22, if you cannot get accurate debugging results with optimization turned on, but cannot reproduce the error without it!
Use logging to locate your area of interest, and attempt to isolate or rewrite the code in a more 'normal' manner; if you're doing something tricky, you may end up confusing the optimizing compiler.
![]() |
Index | ![]() |
6 - Debugging Using gdb | 6.2 Starting Gdb |