Skip to content

Commit 5feacdc

Browse files
authored
feat: Support local variables on Android (#334)
1 parent 24832d7 commit 5feacdc

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Features
6+
7+
- Support local variables on Android ([#334](https://github.com/getsentry/sentry-godot/pull/334))
8+
59
### Other changes
610

711
- Use threads interface for error reporting with Native SDK ([#350](https://github.com/getsentry/sentry-godot/pull/350))

android_lib/src/main/java/io/sentry/godotplugin/SentryAndroidGodotPlugin.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,10 @@ class SentryAndroidGodotPlugin(godot: Godot) : GodotPlugin(godot) {
442442
preContext = (frameData["pre_context"] as? Array<*>)?.map { it as String }
443443
postContext = (frameData["post_context"] as? Array<*>)?.map { it as String }
444444
}
445+
446+
if (frameData.containsKey("vars")) {
447+
vars = frameData["vars"] as? Dictionary
448+
}
445449
}
446450

447451
exception.stacktrace?.frames?.add(frame)

src/sentry/android/android_event.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,15 @@ void AndroidEvent::add_exception(const Exception &p_exception) {
124124
data["pre_context"] = frame.pre_context;
125125
data["post_context"] = frame.post_context;
126126
}
127+
128+
if (!frame.vars.is_empty()) {
129+
Dictionary variables;
130+
for (auto var : frame.vars) {
131+
variables[var.first] = var.second;
132+
}
133+
data["vars"] = variables;
134+
}
135+
127136
android_plugin->call(ANDROID_SN(exceptionAppendStackFrame), exception_handle, data);
128137
}
129138

0 commit comments

Comments
 (0)