This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Locate end of function from within a UV2 debug function

I need to use a debug function to check the results of a function call. Is there any way to determine the address of the end of the function from within a debug function (or any other way to determine that the function has or is about to return)? I can get the start address easily by using \module\function, but the end seems to be more elusive. The SCOPE directive gets me close in that it will allow me to hard code the end address, but I would rather be able to determine it at runtime so I don't have to update the debug every time I compile.

Thanks

Parents
  • Is there any way to determine the address of the end of the function from within a debug function

    Not as far as I know.

    However, if this is just one or two functions you can create a simple assembler stub that calls the function. Then, you can set a breakpoint on the return to the assembler routine. For example, if your routine is named BOB...

    1. Rename the function BOB to BOB1.
    2. Create an assembler routine as follows:

    BOB:  LCALL BOB1
          RET
    

    3. Set a breakpoint on the RET in the assembler routine.

    Jon

Reply
  • Is there any way to determine the address of the end of the function from within a debug function

    Not as far as I know.

    However, if this is just one or two functions you can create a simple assembler stub that calls the function. Then, you can set a breakpoint on the return to the assembler routine. For example, if your routine is named BOB...

    1. Rename the function BOB to BOB1.
    2. Create an assembler routine as follows:

    BOB:  LCALL BOB1
          RET
    

    3. Set a breakpoint on the RET in the assembler routine.

    Jon

Children