HaxeFoundation / HaxeFoundation/hxcpp

stack trace has no line info (also how to get full stack trace?)

Open
#1,012 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
330
Forks
227
Avg merge
2d 16h
Merged PRs (30d)
18

Description

with debug build

```haxe
function loadHost()
{
try {
// ...
var source = File.getBytes(HOST_SCRIPT);
var module = Module.fromData(source.getData());
if (module != null) {
// ...
trace("calling createUI() for instance of " + HOST_SCRIPT);
host_ui = host.createUI();
trace("adding UI for " + HOST_SCRIPT);
host_ui_container.addChild(host_ui);
} else {
trace("ERROR: host script '" + HOST_SCRIPT + "' failed to load");
}
} catch (e:Exception) {
trace("ERROR: loadHost()");
showError(e);
}
}
```
```haxe
function showError(e:Exception) {
trace("!!!!!!!!!!!!!ERROR!!!!!!!!!!!!!");

var m = "exception: " + e;

if (e != null) {
m += "\n\nmessage: ";
m += Std.string(e.message);
m += "\n\nnative: ";
m += Std.string(e.native);
m += "\n\ndetails: ";
m += Std.string(e.details());
m += "\n\nstack: ";
m += Std.string(e.stack);
}

trace(m);

// show the contents of `m` on-screen via Label gui component
```

![image](https://user-images.githubusercontent.com/26642847/198837191-580a2297-283d-4ae0-be3b-deb6ac710c05.png)

![image](https://user-images.githubusercontent.com/26642847/198838219-a29b2716-d2a8-4fef-a7a3-7938f8d7f5ca.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.