Results 1 to 2 of 2

Thread: printing output of preprocessor macros

  1. #1
    Junior Member
    Join Date
    Oct 2010

    printing output of preprocessor macros

    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!

  2. #2

    Re: [david6477] printing output of preprocessor macros

    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, rather than in here. I can't guarantee a timely response in the forum, as the normal work stream usually keeps us busy enough.

    Pete Thompson
    TotalView Customer Services

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts