From fee2dc981cb15c54cacd63f778f106ff93a85796 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 19 Jan 2024 23:01:06 +0200 Subject: NSException test --- indra/newview/llappviewer.cpp | 7 ++++++ indra/newview/llappviewer.h | 1 + indra/newview/llappviewermacosx-objc.h | 2 ++ indra/newview/llappviewermacosx-objc.mm | 6 +++++ indra/newview/llappviewermacosx.cpp | 5 +++++ indra/newview/llappviewermacosx.h | 2 ++ indra/newview/llviewermenu.cpp | 26 ++++++++++++++++++++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 8 +++++++ 8 files changed, 57 insertions(+) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 08a6c20acf..30fb0be46c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -5445,6 +5445,13 @@ void LLAppViewer::forceErrorSoftwareException() LLTHROW(LLException("User selected Force Software Exception")); } +void LLAppViewer::forceErrorOSSpecificException() +{ + // Virtual, MacOS only + const std::string exception_text = "User selected Force OS Exception, Not implemented on this OS"; + throw std::runtime_error(exception_text); +} + void LLAppViewer::forceErrorDriverCrash() { LL_WARNS() << "Forcing a deliberate driver crash" << LL_ENDL; diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 6d1496d517..c5faa67120 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -156,6 +156,7 @@ public: virtual void forceErrorBadMemoryAccess(); virtual void forceErrorInfiniteLoop(); virtual void forceErrorSoftwareException(); + virtual void forceErrorOSSpecificException(); virtual void forceErrorDriverCrash(); virtual void forceErrorCoroutineCrash(); virtual void forceErrorThreadCrash(); diff --git a/indra/newview/llappviewermacosx-objc.h b/indra/newview/llappviewermacosx-objc.h index c6dcec8e34..3721151aba 100644 --- a/indra/newview/llappviewermacosx-objc.h +++ b/indra/newview/llappviewermacosx-objc.h @@ -33,4 +33,6 @@ //Why? Because BOOL void launchApplication(const std::string* app_name, const std::vector* args); +void force_ns_sxeption(); + #endif // LL_LLAPPVIEWERMACOSX_OBJC_H diff --git a/indra/newview/llappviewermacosx-objc.mm b/indra/newview/llappviewermacosx-objc.mm index 17301847e8..5d9ca24db2 100644 --- a/indra/newview/llappviewermacosx-objc.mm +++ b/indra/newview/llappviewermacosx-objc.mm @@ -71,3 +71,9 @@ void launchApplication(const std::string* app_name, const std::vectorisPathfindingEnabledForCurrentRegion() && LLSelectMgr::getInstance()->selectGetViewableCharacters(); } +bool enable_os_exception() +{ +#if LL_DARWIN + return true; +#else + return false; +#endif +} + class LLSelfRemoveAllAttachments : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8371,6 +8390,11 @@ void force_error_software_exception(void *) LLAppViewer::instance()->forceErrorSoftwareException(); } +void force_error_os_exception(void*) +{ + LLAppViewer::instance()->forceErrorOSSpecificException(); +} + void force_error_driver_crash(void *) { LLAppViewer::instance()->forceErrorDriverCrash(); @@ -9598,6 +9622,7 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedForceErrorBadMemoryAccessCoro(), "Advanced.ForceErrorBadMemoryAccessCoro"); view_listener_t::addMenu(new LLAdvancedForceErrorInfiniteLoop(), "Advanced.ForceErrorInfiniteLoop"); view_listener_t::addMenu(new LLAdvancedForceErrorSoftwareException(), "Advanced.ForceErrorSoftwareException"); + view_listener_t::addMenu(new LLAdvancedForceOSException(), "Advanced.ForceErrorOSException"); view_listener_t::addMenu(new LLAdvancedForceErrorSoftwareExceptionCoro(), "Advanced.ForceErrorSoftwareExceptionCoro"); view_listener_t::addMenu(new LLAdvancedForceErrorDriverCrash(), "Advanced.ForceErrorDriverCrash"); view_listener_t::addMenu(new LLAdvancedForceErrorCoroutineCrash(), "Advanced.ForceErrorCoroutineCrash"); @@ -9779,6 +9804,7 @@ void initialize_menus() enable.add("VisibleSelectInPathfindingLinksets", boost::bind(&visible_object_select_in_pathfinding_linksets)); commit.add("Pathfinding.Characters.Select", boost::bind(&LLFloaterPathfindingCharacters::openCharactersWithSelectedObjects)); enable.add("EnableSelectInPathfindingCharacters", boost::bind(&enable_object_select_in_pathfinding_characters)); + enable.add("Advanced.EnableErrorOSException", boost::bind(&enable_os_exception)); view_listener_t::addMenu(new LLFloaterVisible(), "FloaterVisible"); view_listener_t::addMenu(new LLShowSidetrayPanel(), "ShowSidetrayPanel"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 2c26296547..910c2a969c 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2754,6 +2754,14 @@ function="World.EnvPreset" + + + + -- cgit v1.2.3