Menu

#549 show #define definition in tooltip while debugging

Undefined
open
nobody
Feature_Request
2018-10-12
2017-08-12
Jannick
No

While debugging, moving the mouse over a text item makes CB show the evaluation result of the text item in a tooltip - if selected so. #define's are expanded to 'No symbol <symbolname> in current context', whereas CB appears to know the definition of the #define as it shows it for less than a tiny second in the tooltip until it is overridden as described.

Expectation: If the definition of a #define is known to CB, then while debugging the tooltip shows the definition instead of the default text (no symbol ... in the current context).

Discussion

  • ollydbg

    ollydbg - 2017-08-12

    In-fact, we have discussed this issue already in our C::B forum. (If I remember correctly, some years ago) Because we have two different tooltips from two different plugins(the debugger plugin and the codecompletion plugin), a former tooltip will be overwritten by a new tip.

     
    • Teodor Petrov

      Teodor Petrov - 2017-08-12

      You are wrong. This has not been discussed.
      For the record this is probably possible with the info macro commands of gdb.
      This has nothing to do with CodeCompletion.

       
      • ollydbg

        ollydbg - 2017-08-18

        #define's are expanded to 'No symbol <symbolname> in current context', whereas CB appears to know the definition of the #define as it shows it for less than a tiny second in the tooltip until it is overridden as described.

        The text "No symbol <symbolname> in current context" comes from the GDB debugger plugin. While "CB appears to know the definition of the #define as it shows it for less than a tiny second in the tooltip" This tooltip is shown by the CC plugin.

        When debugging, for example:

        #define AAA 1+3
        
        int b=0;
        b = AAA;
        

        When the mouse hover on the "AAA" of the statement "b=AAA;", does GDB debugger plugin knows the "AAA" is a macro definition, then query some "macro info" command to GDB?

         
  • Teodor Petrov

    Teodor Petrov - 2017-08-18

    Not yet, but probably it could be done. I don't know why they do no print this information directly with the print command.

     
  • Jannick

    Jannick - 2018-10-11

    Issue still persisting in current version svn 11499 (Sep 30, 2018). Any chance that it will be solved or is there an easy workaround for this? Many thanks.

     
  • Teodor Petrov

    Teodor Petrov - 2018-10-11

    What do you mean by an easy work around? A workaround for the tooltip isn't really possible, probably if something could be done using the gdb's python apis, but I've not used it much...

    You can manually execute the commands listed in this page: https://sourceware.org/gdb/current/onlinedocs/gdb/Macros.html

     
    • Jannick

      Jannick - 2018-10-12

      Here something really light solving the issue: Compile with -gdwarf-2 -g3 to ensure the compiler includes information about preprocessor macros in the debugging information which then can be passed to CB for display (from the link above).

      Probably good to have these compiler flags in the default compiler flag list to avoid looking for it.

      Apparently this is not a CB issue, but rather a question about the compiled objects passed on to CB. This ticket could be closed from my side.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.