From 83728effa9f3c4d6740ff8a5d5a66cfa2e62923d Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Fri, 12 Jul 2002 17:44:24 +0000 Subject: [PATCH] Fix C++ exception handling. GCC was using the older BSD DBX register numbers rather than the ELF ABI/SVR4 ones in its DWARF unwinding. Submitted by: Alexander Kabaev --- contrib/gcc/config/i386/freebsd.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/contrib/gcc/config/i386/freebsd.h b/contrib/gcc/config/i386/freebsd.h index 5adcac960ff8..f35e75583790 100644 --- a/contrib/gcc/config/i386/freebsd.h +++ b/contrib/gcc/config/i386/freebsd.h @@ -387,6 +387,14 @@ Boston, MA 02111-1307, USA. */ ? svr4_dbx_register_map[(n)] \ : dbx_register_map[(n)]) +/* The same functions are used to creating the DWARF2 debug info and C++ + unwind info (except.c). Regardless of the debug format requested, the + register numbers used in exception unwinding sections still have to be + DWARF compatible. IMO the GCC folks may be abusing the DBX_REGISTER_NUMBER + macro to mean too much. */ +#define DWARF_FRAME_REGNUM(n) (TARGET_64BIT ? dbx64_register_map[n] \ + : svr4_dbx_register_map[(n)]) + /* tag end of file in elf mode */ #undef DBX_OUTPUT_MAIN_SOURCE_FILE_END #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \