gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

have gdb go until SIGSEGV including at the start/end?


From: Jay K
Subject: have gdb go until SIGSEGV including at the start/end?
Date: Mon, 26 Oct 2009 07:34:31 +0000

I have a program with a race condition.
On Windows it hits an access violation eventually if I run it in a loop (like 
very 400 runs).
I want to test it on a Unix system (e.g. GNU/Linux or MacOSX or Solaris or 
OpenBSD).
 
On Windows I use:
 
foo.cmd:
@echo off
setlocal
set a=1
:loop
echo %a%
\bin\x86\cdb -g -G foo.exe
set /a a=a + 1
goto :loop

 
this runs my program in a loop, in a debugger, until it hits an access 
violation.
It prints how many times it has run before each run.
 -g means go right away at the start of the process 
 -G means go past the end of the process 
 By default the debugger stops on access violation (SIGSEGV).
 set /a is for "arithmetic" (expression evaluation) 

 
What is the equivalent with gdb/sh? (Or at least gdb).
I've tried a bit with -x and -batch, no luck.
 
 
Thanks,
 - Jay                                    



reply via email to

[Prev in Thread] Current Thread [Next in Thread]