www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Wanted: buggy debug symbols

reply =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= writes:
Wanted: buggy debug symbols

I currently try to incorporate debug symbol tests into DStress. The test
framework is quite simple:
	1) compile and link the code
	2) hand the executable and a gdb command sequence to GDB
	3) search for a defined regular pattern in GDB's output
	
A sample:

---source---
//  DSTRESS_DFLAGS  -g

void dummy(...){
}

int main(){
	int a=2;
	dummy(a);
	a=a/(a-2); /* line 9 */
	dummy(a);
	return 0;
}

---gdb-script---
run

---pattern---
sample\.d:9


If you can provide further test cases please post them to the
digitalmars.D.bugs newsgroup or send them to dstress kuehne.cn.

Thanks,
Thomas
Aug 01 2005
parent reply John Demme <me teqdruid.com> writes:
For that test, you may also want to add a pattern looking for your "line
9" comment, to make sure it actually breaks on that line, since gdb
outputs the line.  You're also missing the "b script.d:9" command in
your gdb-script, to tell gdb to break.

This is a great idea.  Will post more on the bugs NG.

-John Demme

On Mon, 2005-08-01 at 14:10 +0200, Thomas K=FChne wrote:
 Wanted: buggy debug symbols
=20
 I currently try to incorporate debug symbol tests into DStress. The test
 framework is quite simple:
 	1) compile and link the code
 	2) hand the executable and a gdb command sequence to GDB
 	3) search for a defined regular pattern in GDB's output
 =09
 A sample:
=20
 ---source---
 //  DSTRESS_DFLAGS  -g
=20
 void dummy(...){
 }
=20
 int main(){
 	int a=3D2;
 	dummy(a);
 	a=3Da/(a-2); /* line 9 */
 	dummy(a);
 	return 0;
 }
=20
 ---gdb-script---
 run
=20
 ---pattern---
 sample\.d:9
=20
=20
 If you can provide further test cases please post them to the
 digitalmars.D.bugs newsgroup or send them to dstress kuehne.cn.
=20
 Thanks,
 Thomas

Aug 01 2005
parent =?ISO-8859-1?Q?Thomas_K=FChne?= <thomas-dloop kuehne.THISISSPAM.cn> writes:
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

John Demme schrieb:

 On Mon, 2005-08-01 at 14:10 +0200, Thomas K=FChne wrote:
=20
Wanted: buggy debug symbols

I currently try to incorporate debug symbol tests into DStress. The tes=


framework is quite simple:
	1) compile and link the code
	2) hand the executable and a gdb command sequence to GDB
	3) search for a defined regular pattern in GDB's output
=09
A sample:

---source---
//  DSTRESS_DFLAGS  -g

void dummy(...){
}

int main(){
	int a=3D2;
	dummy(a);
	a=3Da/(a-2); /* line 9 */
	dummy(a);
	return 0;
}

---gdb-script---
run

---pattern---
sample\.d:9


If you can provide further test cases please post them to the
digitalmars.D.bugs newsgroup or send them to dstress kuehne.cn.

"line 9" comment, to make sure it actually breaks on that line, since gdb outputs the line. You're also missing the "b script.d:9" command in your gdb-script, to tell gdb to break.

There is no "break ..." required as line 9 is guaranteed to produce a Division-by-Zero exception. Thomas
Aug 02 2005