News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

How to debug macros

Started by mickagame, March 22, 2009, 11:20:10 AM

Previous topic - Next topic

mickagame

Does someone know how to set code::block to allow debug of macros?
I've tried to compile with -gdwarf-2 -g3 flags but no results ...

ollydbg

Quote from: mickagame on March 22, 2009, 11:20:10 AM
Does someone know how to set code::block to allow debug of macros?
I've tried to compile with -gdwarf-2 -g3 flags but no results ...
What do you mean by "debug macros"? Could you give a simple example?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

mickagame

Have the possibility to do "step by step" in macros defined in .h files.
Actually when the current step in debugger is a macro when you do step by step the debugger doesn't go in the macro.

ollydbg

#3
Really?
I don't think CB can do this :D
I haven't heard this function before.
Which IDE can do this? :shock:
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Ceniza

Macros are not compilable code, they are "generators". In other words, macros do not generate symbols or binary code at all, so there is no way you can step into them. What you can do, at most, is to preprocess a source file and see how macros were expanded... and that's it.

mickagame

Before i was using dev cpp and i m sure i could do that !!!

Seronis

are your macros simple enough that you could use an inline function instead?  do that and you can step into it.