Can I use the stack info in Exception?
Dsby via digitalmars-d-ldc
digitalmars-d-ldc at puremagic.com
Sat Dec 3 07:34:37 PST 2016
I use the ldc1.1-b5.
when I tach the Exception, in ldc, it not printf the stack info.
in dmd ,it has.
import std.json;
import std.stdio;
string pjson(ref JSONValue js)
{
return js["hhh"].str;
}
void main()
{
JSONValue js;
js["hh"] = 10;
try{
pjson(js);
} catch(Exception e){
writeln(e.toString());
}
}
In ldc , only printf:
std.json.JSONException@/build/src/ldc/runtime/phobos/std/json.d(442): Key not found: hhh
----------------
In dmd , it printf:
std.json.JSONException at std/json.d(442): Key not found: hhh
----------------
??:? pure @safe void
std.exception.bailOut!(std.json.JSONException).bailOut(immutable(char)[], ulong, const(char[])) [0x452c66]
??:? pure @safe inout(std.json.JSONValue)*
std.exception.enforce!(std.json.JSONException,
inout(std.json.JSONValue)*).enforce(inout(std.json.JSONValue)*,
lazy const(char)[], immutable(char)[], ulong) [0x452cca]
??:? std.json.JSONValue.opIndexinout(pure ref
inout(std.json.JSONValue) function(immutable(char)[])) [0x448072]
??:? immutable(char)[] exception.pjson(ref std.json.JSONValue)
[0x442f0a]
??:? _Dmain [0x442f4f]
??:?
_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv
[0x445142]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).tryExec(scope void delegate()) [0x44508c]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).runAll() [0x4450fe]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).tryExec(scope void delegate()) [0x44508c]
??:? _d_run_main [0x444ffd]
??:? main [0x443715]
??:? __libc_start_main [0x604f7290]
Does has any parameter to enable cath the stack info?
More information about the digitalmars-d-ldc
mailing list