Translating CPU exceptions into C++ exceptions
Posted: Tue Jan 13, 2015 4:59 pm
Hi all!
Im new to this forum, and didn’t really know where to post this, but felt like this was the best forum:
I currently have c++ exceptions working in my OS, but would now like to extend them so that I can “throw back” CPU exceptions into the code that caused the fault, for example:
Should be able to throw DivideByZeroException.
Should throw a NullReferenceException
My assumptions are that I can “forward” the control flow after an exception interrupt, to a function that would throw the relevant exception. From my understanding, this is what the .net framework does for generating NullReferenceExceptions (by intercepting GP faults)?
Before I start toying around with this idea any further, are there any examples of people doing something similar, or is my method simply not possible?
Any help is appreciated!
Im new to this forum, and didn’t really know where to post this, but felt like this was the best forum:
I currently have c++ exceptions working in my OS, but would now like to extend them so that I can “throw back” CPU exceptions into the code that caused the fault, for example:
Code: Select all
int result = x / 0;
Code: Select all
int value = *nullptr;
My assumptions are that I can “forward” the control flow after an exception interrupt, to a function that would throw the relevant exception. From my understanding, this is what the .net framework does for generating NullReferenceExceptions (by intercepting GP faults)?
Before I start toying around with this idea any further, are there any examples of people doing something similar, or is my method simply not possible?
Any help is appreciated!