View Full Version : printing output of preprocessor macros

10-04-2010, 11:25 AM
Hello All,

I am working on some code that relies heavily on the use of preprocessor macros to help deal with 2D- vs. 3D-specific code. I have compiled the program with the -g3 parameter. In gdb, I can have it print out the result of calling the macro by typing "print MACRO_NAME(some_var)" and it prints out the result. Gdb is not able to tell me where the macro is defined (such as using the list command), and using a graphical frontend like ddd is not able to find it either. That is kind of expected given how preprocessing works. However, getting the output of the macro is very helpful, so using the print command works ok for me.

Is there similar functionality in totalview? I have tried using the CLI and the dprint command, but it has not worked so far. Instead, I get an error about not being able to find the name "MACRO_NAME". While I can always look up these macros by hand (ctags helps a lot) and compute stuff manually, it would be a bit more convenient if I knew how to get totalview to do it for me!

Thank you very much for any and all help!

10-27-2010, 08:15 AM
At this point I don't know of a way of calling the pre-processor macro. However, if gdb can do it, it should theoretically be possible to do so in TotalView. I suspect the main issue is that we see no debug information for the macro and then refuse to call it. If you have a short example that would help a lot. However, it's probably best to send it to support@totalviewtech.com, rather than in here. I can't guarantee a timely response in the forum, as the normal work stream usually keeps us busy enough.