From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18993 invoked by alias); 25 Jul 2005 14:24:50 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 18982 invoked by uid 22791); 25 Jul 2005 14:24:47 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 25 Jul 2005 14:24:47 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1Dx3sr-0001Ep-Cf; Mon, 25 Jul 2005 10:24:45 -0400 Date: Mon, 25 Jul 2005 14:24:00 -0000 From: Daniel Jacobowitz To: Konstantin Karganov Cc: gdb@sources.redhat.com Subject: Re: Debuggee cmd-line arguments bug Message-ID: <20050725142445.GA4525@nevyn.them.org> Mail-Followup-To: Konstantin Karganov , gdb@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-07/txt/msg00233.txt.bz2 On Mon, Jul 25, 2005 at 05:59:31PM +0400, Konstantin Karganov wrote: > Hello. > > Playing with the program startup arguments I've found the following > "feature" of gdb. I have a program that prints its argc/argv parameters. > > (gdb) set args a b c d > (gdb) run > Starting program: /home/kostik/Work/a.out a b c d > Argc=5, Argv=/home/kostik/Work/a.out,a,b,c,d > > Program exited normally. > (gdb) set args a b c d > (gdb) run >out > Starting program: /home/kostik/Work/a.out >out > > Program exited normally. > (gdb) > > In file out there are the folowing: > > Argc=1, Argv=/home/kostik/Work/a.out > > So when trying to redirect debuggee IO we've lost all cmd-line parameters. > The same of cource happens with MI (and breaks the debugging startup for > MPI program!). > > Is it a bug? No. If you provide any options on the "run" command line, you are replacing the arguments set by set args. I think the text in section 4.3, "Your program's arguments", is pretty clear; please let us know if it isn't. > And what is about my previous posts (still unanswered) on: Please don't reply to list messages to post to the list, by the way. It messes up threading; you can see the problem in the list archives. > - running out of source code (stepping past main) > http://sources.redhat.com/ml/gdb/2005-07/msg00152.html Your assumption that with step-mode set the PC will always be in user code is incorrect. For instance, you could be stopped by a signal, or by a user interrupt, or by a breakpoint in a function without source code available. > - incorrect breakpoint diagnostics in MI > http://sources.redhat.com/ml/gdb/2005-07/msg00175.html If someone knew the answer, they would have responded. Sorry, that just happens sometimes. > - vanishing stopping reason in MI > http://sources.redhat.com/ml/gdb/2005-07/msg00173.html > > "And there's no doing anything about it" ? You _got_ an answer. Bob agreed that there ought to be a reason. -- Daniel Jacobowitz CodeSourcery, LLC