Thread overview
Wanted: buggy debug symbols
Aug 01, 2005
Thomas Kühne
Aug 01, 2005
John Demme
Aug 02, 2005
Thomas Kühne
August 01, 2005
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
August 01, 2005
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ühne wrote:
> 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

August 02, 2005
John Demme schrieb:

> On Mon, 2005-08-01 at 14:10 +0200, Thomas Kühne wrote:
> 
>>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.
>>
> 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.

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

Thomas