c - Problem debugging a macro in visual studio -
i having trouble debugging macro in c. when try set breakpoint, message: "breakpoint not hit. no executable code associated line..." funny thing can debug else in file, not macro. have correctly loaded symbol files, cleaned , rebuilt, , turned off optimizations. ideas why debugging macro not working?
not knowing enough context (it might helpful see definition, invocation , you're trying set breakpoint), here few guesses:
are setting breakpoint in macro definition or called? if set in definition, error see. definition telling preprocessor substitutions elsewhere in code, time code reaches compiler, line #define on has been replaced blank line.
if correctly setting breakpoint @ point it's used, sure you're using definition of macro think are, , macro isn't conditional compiled produce no code? common method of disabling things (e.g. debug output) , give no executable code on line calling (unless there other executable code around it). 1 way check put #error line right next macro definition - if being used compiler spit out error.
remember macros functions text substitutions, , calling them puts of code on 1 line of invocation (each , every invocation).. can't debug them (in sense of stepping 'multiline' macro function), can step past them comparing before , after state. 1 of major reasons why complicated macro functions can bad idea.
Comments
Post a Comment