Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla
Bug 65 - Debug info wrong for __modtest
Summary: Debug info wrong for __modtest
Status: RESOLVED FIXED
Alias: None
Product: GDC
Classification: Unclassified
Component: gdc (show other bugs)
Version: development
Hardware: All Linux
: --- minor
Assignee: Iain Buclaw
URL:
Depends on:
Blocks:
 
Reported: 2013-06-27 17:16 CEST by Johannes Pfau
Modified: 2014-02-19 18:34 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Pfau 2013-06-27 17:16:13 CEST
The debug info for this program is a little strange:
---------
//import std.stdio;
//import std.base64;
void main() {}

unittest 
{
    int* a = null;
    *a = 10;
}
---------

If both imports are commented the modtest function doesn't show up in stack traces at all.

If std.stdio is imported:
0x405cd2 test2._D5test29__modtestFZv
	/opt/gdc/include/d/4.8.1/std/conv.d:104

If std.base64 is imported instead:
0x405d52 test2._D5test29__modtestFZv
	/opt/gdc/include/d/4.8.1/std/format.d:1211

Probably produces similar results when importing any other random module as well.
Comment 1 Iain Buclaw 2013-06-27 17:40:31 CEST
A test for you that doesn't require importing modules:
---
void main() {}

unittest 
{
    int* a = null;
    *a = 10;
}

unittest 
{
    int* a = null;
    *a = 10;
}
---

See comment in d-objfile.cc(build_call_function):

// If there is only one function, just return that.
Comment 2 Johannes Pfau 2014-02-16 10:31:12 CET
Found it. The DECL line number is actually correct, but we build the function body outside of the ::toIR functions and therefore set_input_location / doLineNote is not updated correctly.