From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2257 invoked by alias); 4 Feb 2002 01:54:39 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 2157 invoked from network); 4 Feb 2002 01:54:37 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by sources.redhat.com with SMTP; 4 Feb 2002 01:54:37 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id 3804E5E9DE; Sun, 3 Feb 2002 20:56:11 -0500 (EST) From: Jim Blandy To: gdb-patches@sources.redhat.com Subject: RFA: mi: correct loop printing args or locals Message-Id: <20020204015611.3804E5E9DE@zwingli.cygnus.com> Date: Sun, 03 Feb 2002 17:54:00 -0000 X-SW-Source: 2002-02/txt/msg00052.txt.bz2 Without this patch, on platforms using STABS, MI's -stack-list-arguments command describes frames for `callee1' in `gdb/testsuite/gdb.mi/basics.c' like this: frame={level="3",args=[name="intarg",name="strarg",name="fltarg",name="fltarg"]} Note that `fltarg' appears twice. This is because there is both a PSYM (parameter symbol) stab and an LSYM (local symbol) stab for `fltarg', which I'm pretty sure is the standard (and correct) STABS way to describe such functions. Anyway, the loop is clearly incorrect for blocks that contain a mix of arguments and non-arguments. 2002-02-03 Jim Blandy * mi-cmd-stack.c (list_args_or_locals): Move declaration of print_me inside the loop body, so it gets re-initialized every iteration. The cases for the different symbol kinds leave print_me unchanged if they don't want the symbol printed. Index: gdb/mi/mi-cmd-stack.c =================================================================== RCS file: /cvs/cvsfiles/devo/gdb/mi/mi-cmd-stack.c,v retrieving revision 1.11 diff -c -r1.11 mi-cmd-stack.c *** gdb/mi/mi-cmd-stack.c 2001/10/15 22:15:56 1.11 --- gdb/mi/mi-cmd-stack.c 2002/02/04 01:43:35 *************** *** 216,222 **** struct block *block; struct symbol *sym; int i, nsyms; - int print_me = 0; static struct ui_stream *stb = NULL; stb = ui_out_stream_new (uiout); --- 216,221 ---- *************** *** 229,234 **** --- 228,235 ---- { ALL_BLOCK_SYMBOLS (block, i, sym) { + int print_me = 0; + switch (SYMBOL_CLASS (sym)) { default: