From: j DOT aldrich6 AT genie DOT com Message-Id: <199605250547.AA135553230@relay1.geis.com> Date: Sat, 25 May 96 05:37:00 UTC 0000 To: djgpp AT delorie DOT com Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Subject: Re: GDB problem Reply to message 0027593 from MYSKIN AT INP DOT NS on 05/24/96 11:50AM >#incllude >void main() > { > printf("Hello World!\n"); > } Well, first, it's very bad form to declare main to return void, because it doesn't. You should always declare main as returning int. However, that shouldn't be causing your problem. Oh, and I hope that that misspelled "incllude" statement is just in your post. :) >The first time I run it with gdb 'run' command everything goes OK. But >if I exit gdb and try to launch it once more I get this: >--------- >Starting program c:/djgpp/test/hello > >Program received signal SIGSEGV, Segmentation fault. > in >--------- If you posted the exact stack trace that it gives you, we'd be better able to help... >After 3-5 'run' attempts (without exiting gdb) suddenly my 'Hello' >executes! If I reboot and try again, the result is the same - it works >for the first time and then causes errors. You can't run a program multiple times from gdb. It has to do with DOS's entry/exit code. Ordinarily, though, gdb should quit automatically after your program terminates. >And if I try to run gdb >immediately after compiling, I get theese segmentation faults from the >very beginning - not a single successful run! It looks as if CWSDPMI >leaves in memory something that causes GDB malfunction. It's strange. >I use 486DX, 4Mb, DJGPPv2, GDB 4.12, CWSDPMI not resident, tried >booting clean (only the needed environment and path set). Could you post what go32-v2 prints when invoked without arguments in each of your configurations? It might make a difference. >Is there any way to restart the debuggee without leaving gdb? Nope. See above. >Thanks in advance. hth, John