summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2025-03-10 16:43:01 -0400
committerBrian Potchik <brian@vector35.com>2025-03-10 16:43:01 -0400
commita9a002c520866f0c63fa33f52ba244213aa479ff (patch)
tree767f03c3761e9d1d57f2042f5595dbfc9712826d
parentf5ff6f5dd53dd4f812bffebbed8484655bcbc48c (diff)
Enable exception traces by default.
-rw-r--r--docs/guide/troubleshooting.md2
-rw-r--r--exceptions.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/docs/guide/troubleshooting.md b/docs/guide/troubleshooting.md
index f0c245a9..52d8bb90 100644
--- a/docs/guide/troubleshooting.md
+++ b/docs/guide/troubleshooting.md
@@ -209,7 +209,7 @@ The following environment variables may be helpful when troubleshooting issues:
| BN_DISABLE_USER_SETTINGS | Flag (True if exists) | This flag will cause Binary Ninja to ignore any [`settings.json`](https://docs.binary.ninja/guide/settings.html).|
| BN_SCREENSHOT | Flag (True if exists) | This flag removes some small UI clutter to enable cleaner screenshots. |
| BN_DEBUG_HTTP | Flag (True if exists) | This flag enables additional debug logging of HTTP activity. |
-| BN_DEBUG_EXCEPTION_TRACES | Flag (True if exists) | This variable includes stack traces when exceptions are handled (MacOS and Linux only). |
+| BN_DEBUG_EXCEPTION_TRACES | Flag (Enabled by default, disabled if set to "0") | This variable includes stack traces when exceptions are handled (MacOS and Linux only). |
| BN_DEBUG_CLANG | Flag (True if exists) | If set, this flag adds additional debugging information to stdout from clang type parsing. |
diff --git a/exceptions.cpp b/exceptions.cpp
index bdc1db2c..55a5e97f 100644
--- a/exceptions.cpp
+++ b/exceptions.cpp
@@ -26,7 +26,7 @@ BinaryNinja::ExceptionWithStackTrace::ExceptionWithStackTrace(const std::string&
{
m_originalMessage = message;
m_message = message;
- if (getenv("BN_DEBUG_EXCEPTION_TRACES"))
+ if (auto var = getenv("BN_DEBUG_EXCEPTION_TRACES"); !var || var[0] != '0')
{
char* stackTrace = BNGetCurrentStackTraceString();
if (stackTrace)
@@ -88,7 +88,7 @@ BinaryNinja::ExceptionWithStackTrace::ExceptionWithStackTrace(std::exception_ptr
m_message = "Some unknown exception";
}
}
- if (getenv("BN_DEBUG_EXCEPTION_TRACES"))
+ if (auto var = getenv("BN_DEBUG_EXCEPTION_TRACES"); !var || var[0] != '0')
{
char* stackTrace = BNGetCurrentStackTraceString();
if (stackTrace)