Hi,
You have not mentioned type of the MCU, however I have one idea.
You should use FILL command in the for all unused memory in the prm file.
Example from a CodeWarrior IDE help
SEGMENTS
RAM_1 = READ_WRITE 0x800 TO 0x8FF
FILL 0xAA 0x55;
END
PLACEMENT
DUMMY INTO RAM_1
END
I suggest you to use filling value 0x3F which is code for assembler SWI instruction.
Then you should create interrupt routine to be able to service SWI.
When SWI then happens you can check stack and read from it an address from which you have jumped to SWI interrupt.
If you want to read stack you will have to use ASM instructions.
Best Regards, Ladislav