146 – Wrong filename in DWARF debugging information for templates

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 146 - Wrong filename in DWARF debugging information for templates
Summary: Wrong filename in DWARF debugging information for templates
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Linux
: P2 critical
Assignee: Walter Bright
URL:
Keywords: diagnostic
Depends on:
Blocks:
Reported: 2006年05月18日 11:02 UTC by John Demme
Modified: 2014年02月15日 13:22 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description John Demme 2006年05月18日 11:02:15 UTC
When a template is used, DMD puts the filename in which the template was instianted into the DWARF debugging information, so one can't debug templated code, which makes me a sad panda. This might be a symptom of a large problem along with bug #107.
Example:
teqdruid@teqBook:~/workspace/test$ cat test1.d
import test2;
void main()
{
	t!().foo();
}teqdruid@teqBook:~/workspace/test$ cat test2.d
template t()
{
	void foo()
	{
		Object o = null;
		o.toString(); //Segfault
	}
}teqdruid@teqBook:~/workspace/test$ gdb test1
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) run
Starting program: /home/teqdruid/workspace/test/test1 
[Thread debugging using libthread_db enabled]
[New Thread -1210018112 (LWP 9605)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210018112 (LWP 9605)]
_D5test26__T1tZ3fooFZv () at test1.d:6
6	}Current language: auto; currently minimal
(gdb) bt
#0 _D5test26__T1tZ3fooFZv () at test1.d:6
#1 0x0804bb4c in _Dmain () at test1.d:5
#2 0x0804ccf3 in main ()
(gdb)
Comment 1 Thomas Kühne 2006年05月19日 11:45:43 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
d-bugmail@puremagic.com schrieb am 2006年05月18日:
> When a template is used, DMD puts the filename in which the template was
> instianted into the DWARF debugging information, so one can't debug templated
> code, which makes me a sad panda. This might be a symptom of a large problem
> along with bug #107.
Added to DStress as
http://dstress.kuehne.cn/norun/d/debug_info_09_A.d
(http://dstress.kuehne.cn/addon/debug_info_09_Z.d)
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFEbbPJ3w+/yD4P9tIRApW2AJ40H1o8PLLh8XY7tKmrR+FY0C4soACffiXO
i7hTKXLfMyh+dAxFwJV6GsI=
=73UH
-----END PGP SIGNATURE-----
Comment 2 John Demme 2007年01月31日 23:18:45 UTC
Re-reporting for latest version. It's been so long, I think I have to reconfirm that it's not working. I also bumped up the severity since I run into this issue often, and each time I do, I gnash my teeth and start dreaming of Java's debugger.
Comment 3 Brad Roberts 2007年01月31日 23:40:17 UTC
Please don't move versions forward. It's much more interesting / useful to know when a bug was introduced (not that you know for sure that it started with 0.157 but in this case you know it's _at least_ that old) than that it's still happening now. The the bug is still open is an indicator that it's still happening (though not 100% since sometimes bugs get fixed and are left open accidentally, it's certainly the base assumption).
Comment 4 Walter Bright 2007年03月19日 17:36:32 UTC
Fixed DMD 1.009


AltStyle によって変換されたページ (->オリジナル) /