[SOLVED] some defined phrase can't go to definition normally

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] some defined phrase can't go to definition normally

    Hi, I have just found that some defined phrase can't go to definition normally.
    For example, I can't go to the defined of the phrase "IS_GPIO_ALL_INSTANCE" normally while it actually existed in the file "stm32f767xx.h", I'm sure that I have added the address of "stm32f767xx.h" into users include directories in the preprocessor tag.
    I have tried another IDE and I can go to this definition normally in keil for mdk
  • Hello,

    Thank you for your inquiry.
    Such an issue is not known to us.
    What version of Embedded Studio are you using? Could you try the latest one?
    If the issue appears with the latest version as well, could you provide an example project for reproduction with reproduction steps?

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello,

    feel free to use any third party video hosting site you like.
    However it would be better if you could provide an example project for reproduction with reproduction steps so we can try to recreate the issue you are seeing in house.
    A video alone usually does not help much as we then still do not have the same setup like you where the issue appears.

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello,

    Thank you for providing the example project.
    We gave it a try but everything is working as expected. What you see here are no errors, but rather misunderstandings how the corresponding macros expand for that source line.
    e.g. when you select __HAL_RCC_GPIOB_CLK_ENABLE(); that macro expands to the definition in stm32f7xx_hal_rcc_ex.h
    Now if you select just the GPIOB in that line there is no symbol information for the definition of macro GPIOB as for that line the macro for __HAL_RCC_GPIOB_CLK_ENABLE has already expanded.
    The same with assert_param(IS_GPIO_ALL_INSTANCE(GPIOx)); here check what the macro assert_param expands to. It expands to (void)0U).

    So no matter what defines or macros are used after that, it got expanded to void, so no reference to IS_GPIO_ALL_INSTANCE is available in that line.


    So this is not a bug in Embedded Studio. For each source line the macros will expand as defined. Depending on how the macros are defined they might be omitted.

    So you have to check the context of each source line to see what is available and what not. Embedded Studio will only show what is actually defined in that specific context.


    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Nino, so thanks for your help, I have known how to figure it out now.
    I found that if I want to go to definition of a function which embedded into another function, I have to copy the embedded function and paste it to another new line, then I can go to definition successfully.
    By the way, even if I add the "//" symbol before the pasted function, it won't be able to go to definition successfully, so... I was just thinking that maybe it's just a little bit inconvenient for the users :P
  • Hi,

    Thank you for your feedback.
    We will check if Embedded Studio can be improved here so it is more obvious what happens in what line if macros are used.
    However generally Embedded Studio is behaving correctly when expanding macros and when the goto definition and declaration are used.

    We will consider this case as solved now.

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.