internal_except.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /////////////////////////////////////////////////////////////////////////EA-V1
  19. // $File: //depot/GeneralsMD/Staging/code/Libraries/Source/debug/internal_except.h $
  20. // $Author: mhoffe $
  21. // $Revision: #1 $
  22. // $DateTime: 2003/07/03 11:55:26 $
  23. //
  24. // ©2003 Electronic Arts
  25. //
  26. // Unhandled exception handler
  27. //////////////////////////////////////////////////////////////////////////////
  28. #ifdef _MSC_VER
  29. # pragma once
  30. #endif
  31. #ifndef INTERNAL_EXCEPT_H // Include guard
  32. #define INTERNAL_EXCEPT_H
  33. /// \internal exception handler
  34. class DebugExceptionhandler
  35. {
  36. DebugExceptionhandler(const DebugExceptionhandler&);
  37. DebugExceptionhandler& operator=(const DebugExceptionhandler&);
  38. // nobody can instantiate us
  39. DebugExceptionhandler(void);
  40. /** \internal
  41. \brief Log exception location.
  42. \param dbg debug instance
  43. \param exptr exception pointers
  44. */
  45. static void LogExceptionLocation(Debug &dbg, struct _EXCEPTION_POINTERS *exptr);
  46. /** \internal
  47. \brief Log regular registers.
  48. \param dbg debug instance
  49. \param exptr exception pointers
  50. */
  51. static void LogRegisters(Debug &dbg, struct _EXCEPTION_POINTERS *exptr);
  52. /** \internal
  53. \brief Log FPU registers.
  54. \param dbg debug instance
  55. \param exptr exception pointers
  56. */
  57. static void LogFPURegisters(Debug &dbg, struct _EXCEPTION_POINTERS *exptr);
  58. public:
  59. /** \internal
  60. \brief Determine exception type.
  61. \param exptr exception pointers
  62. \param explanation exception explanation, buffer must be 512 chars
  63. \return exception type as string
  64. */
  65. static const char *GetExceptionType(struct _EXCEPTION_POINTERS *exptr, char *explanation);
  66. /** \internal
  67. \brief System exception filter
  68. */
  69. static long __stdcall ExceptionFilter(struct _EXCEPTION_POINTERS* pExPtrs);
  70. };
  71. #endif // INTERNAL_EXCEPT_H