We have an exception handler which needs some tweaking because when we
changed compilers, the embedded assembly didn't work. Ideally, we
would like a complete C++ solution, without assembly statements.
One assumption is that the stack pointer may be invalid. So, we attach
a VxWorks exception handler to a method which has no local data and
does not call other methods (and so does not generate code which uses
the stack pointer). This method counts how many times it has been
called to guard against recursive exceptions in the event the stack
pointer is invalid. After the guard code, the method branches (with
embedded assembly) to the address of the entry of another method to
generically handle PowerPC exceptions.
So, is there another way of doing this all in C++? If not, is there
another way of branching using assembly that would be more portable
than using the address of the method.
Thanks