From mboxrd@z Thu Jan 1 00:00:00 1970 From: "William A. Gatliff" To: Shaun Jackman Cc: Ruedi Dummermuth , gdb@sources.redhat.com Subject: Re: gdb signal normal termination of program Date: Wed, 28 Nov 2001 08:39:00 -0000 Message-id: <20011128103905.A11148@saturn.billgatliff.com> References: X-SW-Source: 2001-11/msg00313.html Guys: I have a bdi2000, too! Just got it yesterday... :^) > I have an arm-elf target connected to a bdi2000 jtag debugger. Is > there any instruction I can compile that indicates to the debugger > or gdb that my program has reached normal termination. When main > returns exit() is called which then hangs the processor. I have to > interrupt it with ctrl-c. I'd like gdb to break to the prompt on its > own and display the message "Program terminated normally". Do you > know how I go about this? I don't know what runtime library you're using, but if you step through exit() most of the time it terminates in an infinite loop. What needs to happen instead is something like a BKGD instruction (I'm using cpu32, in case you couldn't tell), that forces the chip back into debug mode. The bdi2000 should catch that and tell gdb that the target has halted. As to the "program terminated normally" message, that's going to depend on how the bdi2000 interprets the occurrence of the BKGD event. And that, along with whatever they (don't seem to) provide for console output facilities, is up to Abatron. HTH, b.g. -- Bill Gatliff bgat@billgatliff.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14417 invoked by alias); 28 Nov 2001 16:39:09 -0000 Mailing-List: contact gdb-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 14395 invoked from network); 28 Nov 2001 16:39:06 -0000 Received: from unknown (HELO saturn.billgatliff.com) (209.251.101.200) by hostedprojects.ges.redhat.com with SMTP; 28 Nov 2001 16:39:06 -0000 Received: by saturn.billgatliff.com (Postfix, from userid 500) id AD19B14184B; Wed, 28 Nov 2001 10:39:05 -0600 (CST) Date: Wed, 21 Nov 2001 04:09:00 -0000 From: "William A. Gatliff" To: Shaun Jackman Cc: Ruedi Dummermuth , gdb@sources.redhat.com Subject: Re: gdb signal normal termination of program Message-ID: <20011128103905.A11148@saturn.billgatliff.com> Reply-To: bgat@billgatliff.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from sjackman@pathwayconnect.com on Wed, Nov 28, 2001 at 09:24:47AM -0700 X-SW-Source: 2001-11/txt/msg00206.txt.bz2 Message-ID: <20011121040900.VRfLdTU-_o84FElc8TvDODLd-OlfHcXOi8OkJ7_-KdI@z> Guys: I have a bdi2000, too! Just got it yesterday... :^) > I have an arm-elf target connected to a bdi2000 jtag debugger. Is > there any instruction I can compile that indicates to the debugger > or gdb that my program has reached normal termination. When main > returns exit() is called which then hangs the processor. I have to > interrupt it with ctrl-c. I'd like gdb to break to the prompt on its > own and display the message "Program terminated normally". Do you > know how I go about this? I don't know what runtime library you're using, but if you step through exit() most of the time it terminates in an infinite loop. What needs to happen instead is something like a BKGD instruction (I'm using cpu32, in case you couldn't tell), that forces the chip back into debug mode. The bdi2000 should catch that and tell gdb that the target has halted. As to the "program terminated normally" message, that's going to depend on how the bdi2000 interprets the occurrence of the BKGD event. And that, along with whatever they (don't seem to) provide for console output facilities, is up to Abatron. HTH, b.g. -- Bill Gatliff bgat@billgatliff.com