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 Reply Children
  • Why does it need to be assembler...

    Well, I guess it doesn't BUT it will be a lot simpler to do in assembly.

    If you write a the stub in C, then you'll probably have to deal with prototype mismatches and have to make the prototypes match and un-stack and re-stack the arguments to pass them to the final function. Writing this 2-line assembly stub is simpler, quick to do, requires no C machinations, and works 100% of the time (regardless of optimizer or any other settings).

    Jon

  • Ok, that makes sense, however do not forget that it may need a '_' if variables are involved.

    Erik