Commit Graph
50 Commits
Author SHA1 Message Date
Shauren cbcd149ce5 Core/Misc: Explicitly include required headers instead of relying on them to be included by other headers 2022-02-11 14:33:35 +01:00
jackpoz 35755ba343 Core/Misc: Fix Windows 32 bits build
Close #25789

(cherry picked from commit 1cafd4ef74350cb3656917e8e033a5e21dcce193)
2022-01-26 18:48:08 +01:00
Shauren fbcf269207 Core/CrashHandler: Skip logging stack trace of the thread writing the crash log, it was launched by windows with same context as crashing thread
(cherry picked from commit dd34651f4d42ca598b2f1b2ed32e27b4742f4be7)
2022-01-26 18:47:44 +01:00
Shauren cc0affa523 Core/CrashHandler: Remove logging function variation depending on crash reason and print directly to file, not to temporary buffer
(cherry picked from commit c5e1b49e8c02386a0e9edf682692dc6d46cc862f)
2022-01-26 18:47:16 +01:00
Shauren 259bbf1e04 Core/CrashHandler: NULL -> nullptr
(cherry picked from commit 68fdfcaa507d06ce8e823e7848f4c58ef1e62732)
2022-01-26 18:46:56 +01:00
Shauren 473f3db0ab Core/CrashHandler: #ifdef cleanup to make VS not choke when parsing, fixed file being all red in editor
(cherry picked from commit 39c5e03b749d44df346b8f37aed3eb898526365a)
2022-01-26 18:46:43 +01:00
Shauren 7893ac94a0 Core/CrashHandler: Attempt to extract C++ exception object in uncaught exception hander
(cherry picked from commit 83ed35fe62c16f5697f253a9a44bba7dcb83e80d)
2022-01-26 18:43:31 +01:00
Shauren 58d199db48 Core/Misc: Fix compile errors found with msvc /permissive-
(cherry picked from commit b3db50a3b41b2db209327387f59afa1c40532773)
2022-01-26 14:20:13 +01:00
jackpoz f7c1ae01f8 Core/Common: Add macro ASSERT_WITH_SIDE_EFFECTS to be used when asserting conditions that have side effects
(cherry picked from commit 49da3533cd4a0fcd8b2ac7ae0bf4b105f40f8c77)
2022-01-19 21:18:39 +01:00
jackpoz 1fa4403b8c Core/Common: Allow to show a message when aborting
Add a new ABORT_MSG macro that allows to show a formatted message before stopping the executable

(cherry picked from commit 0ddee8a4a03fb5c7ee8d18144ca21cd2baad6f01)
2021-12-22 22:54:18 +01:00
jackpoz 49414acaef Core/CrashHandler: Remove sensitive data from crashlogs
(cherry picked from commit 25bcb1a0b2d9326519d9226dfe968caf26bb4e2d)
(cherry picked from commit 37478c5ac1efb8e4f19ffc94f444e160600c7b27)
2021-12-02 00:39:28 +01:00
jackpoz 9dcbccce26 Core/Misc: Fix vsnprintf usage in ASSERT()
Fix vsnprintf to follow standard definition and not some old VC++ behavior, not requiring to include the '\0' character in the count parameter

(cherry picked from commit eee1f2cadf8174caca4849c22ba1fb8f12fc9e08)
2021-11-16 20:37:27 +01:00
Giacomo Pozzoni d5c41d23e6 Core/Misc: Log more information in asserts (#22783)
* Core/Misc: Log more information in asserts

Add a new function GetDebugInfos() to types that could trigger an ASSERT() to easily include more useful information in crashlogs.
This is an initial commit that requires many more commits to implement the new GetDebugInfos() function in all required types.
If the type doesn't have the function, the global default one is picked which doesn't log anything.

* Core/Misc: Fix dynamic build

Add missing attribute for dynamic build

* Core/Misc: Fix gcc/clang build

* Core/Misc: Rename GetDebugInfos() to GetDebugInfo()

* Core/Misc: Fix FormatAssertionMessage() adding an extra '\0'

* Core/Misc: Add GetDebugInfo support to Unit

* Core/Misc: Add GetDebugInfo support to Creature

* Core/Misc: Add more info to GetDebugInfo for Creature

* Core/Misc: Add GetDebugInfo support to GameObject

* Core/Misc: Add GetDebugInfo support to Player

* Core/Misc: Add more GetDebugInfo info

* Core/Misc: Add GetDebugInfo support to Item

* Core/Misc: Add GetDebugInfo support to Bag

* Core/Misc: Add GetDebugInfo support to Transport

* Core/Misc: Add GetDebugInfo support to TempSummon, Minion, Guardian, Pet

* Core/Misc: Add GetDebugInfo support to Map, InstanceMap

* Core/Misc: Add GetDebugInfo support to Spell

* Core/Misc: Fix build warning

* Core/Misc: Add GetDebugInfo support to Aura

* Core/Misc: Add GetDebugInfo support to UnitAI

(cherry picked from commit 9a924fb9d557434c5a2e4020c80db6e6bfe466ad)
2021-11-16 20:36:58 +01:00
Warpten 1d4efe2986 Fix invalid arguments to string format in Trinity::Fatal
Isn't whatever is used nowadays to make this stuff safe supposed to prevent this sort of stuff?

(cherry picked from commit 9bf69b3849a9d78f3e8d174ed6367a259aaf876f)
2021-11-15 21:34:44 +01:00
Treeston 12e76f085f Core/Misc: Add a missing include of Windows.h to Errors.cpp
(that last one wasn't me!)

(cherry picked from commit 1dc675f0a17d9c7d1b6e9a07d5c25cdd79bb8788)
2021-11-12 00:16:29 +01:00
Shauren 8866065117 Core/Misc: FIx a GCC warning 2021-10-31 01:39:10 +02:00
Shauren d181c1da75 Core/CrashHandler: Include assertion messages in crash reports
(cherry picked from commit 62db1fb683c13b8dde0cc359564e090e0594658f)
2021-10-23 16:02:44 +02:00
jackpoz 89a232de3a Core/Misc: Add PERFORMANCE_PROFILING CMake option
Add a new CMake option called PERFORMANCE_PROFILING that should be used only when profiling the performance.
This option is unsupported, do not report any issue happening when enabling this option.

(cherry picked from commit db5c9867e2ffde3657f53bc155b474c5d46884dd)
2021-08-08 21:21:34 +02:00
jackpoz 5b4f61d915 Core/Crash reporting: Add support to char* arrays
Add support to char* array showing the string value instead of the pointer address

(cherry picked from commit 4c0c4ab271ddc2d200cd9ccda98e16553dcaf391)
2021-04-16 21:03:23 +02:00
jackpoz 96406e3408 Core/Crash reporting: Fix buffer overflow
(cherry picked from commit c7043b25f659eddd75fecd916235e524223c7f05)
2021-02-25 18:50:55 +01:00
Shauren b231903932 Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port 2020-09-04 13:38:24 +02:00
Shauren 1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00
jackpoz bfcb276781 Core/Crash: Refactor and fixes
Code cleanup.
Fix buffer overflow crash.
Fix type being truncated to 199 characters.

(cherry picked from commit 9226e212053ef8ec10eeb9509f2ce6ec002d8e3b)
2020-04-24 17:18:48 +02:00
Aokromes b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
vincent-michael 5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
Shauren abdf6479dd Core/CrashHandler: Fixed generating crash logs from CRT debug assertions 2018-03-10 15:15:41 +01:00
vincent-michael 7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Aokromes 90badf9d7e Misc: More cleanup 2017-11-25 02:50:29 +01:00
Shauren d184768bbc Core/Misc: Improved error message reported by ASSERT_NOTNULL 2017-09-24 23:53:33 +02:00
jackpoz fc6b488620 Core/Misc: Fix static analysis issues
# Conflicts:
#	src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
#	src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/scripts/Commands/cs_ban.cpp
#	src/server/scripts/Commands/cs_disable.cpp
2017-07-16 21:14:22 +02:00
Shauren 3a418a0bbc Core/Common: Include cleanup 2017-05-11 22:29:51 +02:00
Shauren b8db320bf1 Core/Misc: Prefix all preprocessor defines from CompilerDefs with TRINITY_ to avoid conflicts (PLATFORM_WINDOWS is used/defined by CascLib) 2017-03-04 18:46:18 +01:00
vincent-michael 86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Shauren 9633c8c2b7 Core/Debugging: Partially revert e0fb4445cd, the cmake hack to build wheaty directly into executable is still needed as it is impossible to have it initialize before every other static variable when it resides in dll (dynamic linking only) 2016-11-28 20:21:21 +01:00
Shauren e0fb4445cd Core/Debugging: Added wheaty everywhere and modified it to always reliably report issues during static initialization 2016-11-28 18:37:51 +01:00
jackpoz bceb385773 Core/Crash reporting: Better handle max nesting level setting
Fix wheaty exception report counting reference symbols as 2 nesting levels, not logging child objects in some cases, i.e. spell id in SpellEvent crash.

(cherry picked from commit 284dd6b80d79f5691c82eda848c7474c5b87cfd9)
2016-08-04 17:05:24 +02:00
Naios 501fd9b502 Core/Common: Converted the common library to a shared library.
* There is still the possibility to static link against common.
2016-03-24 01:28:58 +01:00
MitchesD ce5def332f Core/Misc: fix build 2016-03-03 19:58:28 +01:00
Shauren dea7d429ab Core/Debugging: Make abort() less bad on windows by forcing crash log generation 2016-03-03 17:29:48 +01:00
Vincent-Michael 478cc756eb Update copyright note for 2016
Happy new year (Again new year with idiots ...)
2016-01-01 00:34:25 +01:00
Vincent-Michael b5329d8a03 Core: Revert fail 2015-11-15 16:49:17 +01:00
Vincent-Michael 5d584116fe Core: Added missing overrides 2015-11-15 16:48:12 +01:00
Shauren d31706b07e Core/DBLayer: Improve error message from 0a27f8bce2 2015-11-13 22:43:36 +01:00
Shauren 4c866a0af0 Core/Crash reporting: Fixed windows version detection for 8.1 and newer 2015-10-16 00:50:49 +02:00
Shauren e6e5f5c559 Partially revert "Core/Build: Added missing abort() calls on error handlers"
This reverts commit 8ea17647e6.
2015-09-21 17:18:55 +02:00
StormBytePP 8ea17647e6 Core/Build: Added missing abort() calls on error handlers 2015-09-21 15:52:34 +02:00
StormBytePP 958fd013e7 Core/Build: Add Trinity::Abort definition in header file 2015-09-21 15:31:49 +02:00
StormBytePP c1817dff37 Fix a typo 2015-09-21 15:21:09 +02:00
StormBytePP 0bed9d56cb Core: Added ABORT() macro to prevent the usage of ASSERT(false) as a quick hack to crash the core misusing assert 2015-09-21 15:17:05 +02:00
StormBytePP 1d2aafd39b Core/Build: Merge common library and move database out of shared 2015-08-21 17:52:42 +02:00