[SOLVED] [Ozone] Setting a breakpoint callback function on function call when the source location is unknown

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

  • [SOLVED] [Ozone] Setting a breakpoint callback function on function call when the source location is unknown

    I can easily set a breakpoint on a function:

    Source Code

    1. Break.SetOnSrc ( "myFunction" );

    However, I cannot set a breakpoint callback function if I don't know the source location (the line number may change, so I need to consider it as "unknown").

    I can use Elf to get the address of the function and use that to set a breakpoint. I would like to use the following to set the callback:

    Source Code

    1. address = Elf.GetExprValue( "&myFunction" );
    2. Break.Set ( address );
    3. Break.SetCommand ( address, "callback" );
    However, that will fail as SetCommand expects the source location to be a string literal.

    Is there some way to convert 'address' to a string? I tried using an array of char, but passing 'array' to SetCommand gets "Expected a '['" and '&array[ 0 ]' gets "Expected a value or an identifier".
  • Hello,

    Thank you for your inquiry.
    Unfortunately currently there is no such functionality to use SetCommand with an address or to convert a number to a string.
    We will add a new function called SetCommandOnAddress or similar that will be able to work with numbers.
    It should be available with the next Ozone release version.

    Sorry for any inconveniences caused.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    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.