http://d.puremagic.com/issues/show_bug.cgi?id=6218

           Summary: Stack trace possible improvement
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: druntime
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-06-27 13:44:30 PDT ---
This comes after the closed bug 4911 and a short discussion:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=27836
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=27840
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=27843


Assuming that the file "test.raw" is absent, this program:


import std.stdio: File;
void foo() {
    auto f = File("test.raw", "r");
    f.write("hello");
}
void bar() {
    foo();
}
void main() {
    bar();
}



with DMD 2.053 gives at runtime (using -g):

std.exception.ErrnoException@std\stdio.d(286): Cannot open file `test.raw' in
mode `r' (No such file or directory)
----------------
...\test.d(8): void test.bar()
...\test.d(10): _Dmain
----------------


While on OS X it's something like this, it shows the name of the function
("foo") where the File contructor is called too:

std.exception.ErrnoException@std/stdio.d(286): Cannot open file
`test.raw' in mode `r' (No such file or directory)
----------------
5   test                                0x000347fa @safe
shared(core.stdc.stdio._iobuf)*
std.exception.errnoEnforce!(shared(core.stdc.stdio._iobuf)*,
"std/stdio.d", 286).errnoEnforce(shared(core.stdc.stdio._iobuf)*, lazy
immutable(char)[]) + 90
6   test                                0x00033443 ref std.stdio.File
std.stdio.File.__ctor(immutable(char)[], const(char[])) + 87
7   test                                0x00002aea void test.foo() + 58
8   test                                0x00002b2f void test.bar() + 11
9   test                                0x00002aab _Dmain + 11
10  test                                0x000146bb extern (C) int
rt.dmain2.main(int, char**).void runMain() + 23
11  test                                0x00014265 extern (C) int
rt.dmain2.main(int, char**).void tryExec(scope void delegate()) + 29
12  test                                0x00014703 extern (C) int
rt.dmain2.main(int, char**).void runAll() + 59
13  test                                0x00014265 extern (C) int
rt.dmain2.main(int, char**).void tryExec(scope void delegate()) + 29
14  test                                0x000141ff main + 179
15  test                                0x00002a95 start + 53
----------------


Is is possible for the stack trace on Windows to show the "foo" function too?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to