Menu

#345 Source code parser

Undefined
invalid
nobody
Bug_Report
2016-05-06
2016-05-01
GrWolf
No

Source code parser can't parse macrocalls.
For example:
#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
(Source: Vulkan API SDK, vulkan.h)
Or
#define DECLARE_HANDLE(name) struct name##__; typedef struct name##__ *name
(Source: Win32 API, winnt.h)

It can be used like:
VK_DEFINE_HANDLE(VkInstance)
Or
DECLARE_HANDLE(HWND)
But CodeComplition will not show VkInstance or HWND — there is no data about it.

Discussion

  • Teodor Petrov

    Teodor Petrov - 2016-05-03
    • labels: parser, macros --> macros, CodeCompletion
     
  • ollydbg

    ollydbg - 2016-05-04

    But CodeComplition will not show VkInstance or HWND — there is no data about it.

    Can you explain this? What is the error, what is the expected behaviour?

    Also, I would like to see a minimal code to demostrate the errors. The minimao code should not include any other header files, so that we can debug it easily.

     
  • GrWolf

    GrWolf - 2016-05-04

    Well,I don't know why, but it is already fixed in last version.

    #define MAKE_HANDLE(handle_name) typedef struct handle_name##_T * handle_name;
    MAKE_HANDLE(MyHandle)
    
    MyHandle mh1;
    

    CodeComplition normally show MyHandle in tokens list. So that what I want.

     
  • ollydbg

    ollydbg - 2016-05-06

    OK, I will close this ticket.

     
  • ollydbg

    ollydbg - 2016-05-06
    • status: open --> invalid
     

Log in to post a comment.

MongoDB Logo MongoDB