summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2025-07-17 14:12:02 -0400
committerPeter LaFosse <peter@vector35.com>2025-07-18 10:15:00 -0400
commit27a249c7938fe091d77d633129255327c8c6708e (patch)
treeec705a0c382ff810aeafcc886fe5340b0bf69e29
parentdab7de5b54b7bb0bae5b5cf20d8d4cc234f772c2 (diff)
Disable exception stack traces by default, except for unhandled exceptions during analysis
-rw-r--r--docs/guide/troubleshooting.md2
-rw-r--r--exceptions.cpp14
2 files changed, 11 insertions, 5 deletions
diff --git a/docs/guide/troubleshooting.md b/docs/guide/troubleshooting.md
index c746fbee..392010e2 100644
--- a/docs/guide/troubleshooting.md
+++ b/docs/guide/troubleshooting.md
@@ -222,7 +222,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 (Enabled by default, disabled if set to "0") | This variable includes stack traces when exceptions are handled (MacOS and Linux only). |
+| BN_DEBUG_EXCEPTION_TRACES | Flag (Disabled by default, enabled if set to "1") | This variable includes stack traces when exceptions are handled. |
| 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 f4557238..e57b8d09 100644
--- a/exceptions.cpp
+++ b/exceptions.cpp
@@ -32,8 +32,11 @@ BinaryNinja::ExceptionWithStackTrace::ExceptionWithStackTrace(const std::string&
if (stackTrace)
{
m_stackTrace = stackTrace;
- m_message += "\n";
- m_message += stackTrace;
+ if (var)
+ {
+ m_message += "\n";
+ m_message += stackTrace;
+ }
BNFreeString(stackTrace);
}
}
@@ -94,8 +97,11 @@ BinaryNinja::ExceptionWithStackTrace::ExceptionWithStackTrace(std::exception_ptr
if (stackTrace)
{
m_stackTrace = stackTrace;
- m_message += "\n";
- m_message += stackTrace;
+ if (var)
+ {
+ m_message += "\n";
+ m_message += stackTrace;
+ }
BNFreeString(stackTrace);
}
}