-/* KLUDGE: There is strong family resemblance in the signal context
- * stuff in FreeBSD and OpenBSD, but in detail they're different in
- * almost every line of code. It would be nice to find some way to
- * factor out the commonality better; failing that, it might be best
- * just to split this generic-BSD code into one variant for each BSD. */
-
-int *
-os_context_register_addr(os_context_t *context, int offset)
-{
- switch(offset) {
- case 0:
- return CONTEXT_ADDR_FROM_STEM(eax);
- case 2:
- return CONTEXT_ADDR_FROM_STEM(ecx);
- case 4:
- return CONTEXT_ADDR_FROM_STEM(edx);
- case 6:
- return CONTEXT_ADDR_FROM_STEM(ebx);
- case 8:
- return CONTEXT_ADDR_FROM_STEM(esp);
- case 10:
- return CONTEXT_ADDR_FROM_STEM(ebp);
- case 12:
- return CONTEXT_ADDR_FROM_STEM(esi);
- case 14:
- return CONTEXT_ADDR_FROM_STEM(edi);
- default:
- return 0;
- }
-}
-
-int *
-os_context_pc_addr(os_context_t *context)
-{
-#if defined __FreeBSD__
- return CONTEXT_ADDR_FROM_STEM(eip);
-#elif defined __OpenBSD__
- return CONTEXT_ADDR_FROM_STEM(pc);
-#else
-#error unsupported BSD variant