Skip to content

Custom stack traces#1220

Merged
Simn merged 3 commits intoHaxeFoundation:masterfrom
Aidan63:custom-stack-trace
Apr 26, 2025
Merged

Custom stack traces#1220
Simn merged 3 commits intoHaxeFoundation:masterfrom
Aidan63:custom-stack-trace

Conversation

@Aidan63
Copy link
Contributor

@Aidan63 Aidan63 commented Apr 26, 2025

See HaxeFoundation/haxe#12213

This updates hxcpp unhandled exceptions to only call __hx_dump_stack if the caught object does not have a __customStack field, in which case that is printed out instead.

@Simn
Copy link
Member

Simn commented Apr 26, 2025

Hmm... the HL implementation is stricter in the sense that it actually checks if we're looking at an instance of haxe.Exception. Though now I wonder if that's necessary. I'm generally wary of magic field names like this but if we add one I really think it should be something leading with _hx_. We don't really reserve anything like __customStack in general, so if someone had such a field with a different type we run into trouble here.

@Aidan63
Copy link
Contributor Author

Aidan63 commented Apr 26, 2025

Good point, I've changed it to _hx_customStack the field on the cpp haxe exception class will need updating. I'm going to bump up looking at revamping hxcpps exception stuff on my internal todo list, so hopefully it won't be around for too long.

@Simn Simn merged commit bee2492 into HaxeFoundation:master Apr 26, 2025
120 checks passed
@skial skial mentioned this pull request Apr 28, 2025
1 task
@Aidan63 Aidan63 deleted the custom-stack-trace branch June 5, 2025 17:39
singpolyma added a commit to singpolyma/hxcpp that referenced this pull request Jul 8, 2025
* ios-ssl:
  Stub in new SSL implemenation for Apple OS
  add millisecond resolution timer (HaxeFoundation#1234)
  update to Tracy 0.12.0 (HaxeFoundation#1231)
  Fix memory leaks in objects associated with thread creation.  For HaxeFoundation#1223
  Update StdLibs.h (HaxeFoundation#1221)
  Upgrade zlib to 1.3.1 (HaxeFoundation#1216)
  Custom stack traces (HaxeFoundation#1220)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants