From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8062 invoked by alias); 8 Nov 2002 19:32:15 -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 8002 invoked from network); 8 Nov 2002 19:32:13 -0000 Received: from unknown (HELO zenia.red-bean.com) (66.244.67.22) by sources.redhat.com with SMTP; 8 Nov 2002 19:32:13 -0000 Received: (from jimb@localhost) by zenia.red-bean.com (8.11.6/8.11.6) id gA8JH8I08446; Fri, 8 Nov 2002 14:17:08 -0500 To: gdb-patches@sources.redhat.com Subject: PATCH: In dwarf2read, restore local_symbols and param_symbols From: Jim Blandy Date: Fri, 08 Nov 2002 11:32:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.90 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-11/txt/msg00231.txt.bz2 2002-11-08 Jim Blandy * dwarf2read.c (read_func_scope): Restore local_symbols and param_symbols after we finish the function context. (Based on a patch from David Edelsohn.) Index: gdb/dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.72 diff -c -r1.72 dwarf2read.c *** gdb/dwarf2read.c 25 Oct 2002 22:25:55 -0000 1.72 --- gdb/dwarf2read.c 8 Nov 2002 19:30:13 -0000 *************** *** 2013,2018 **** --- 2013,2026 ---- /* Make a block for the local symbols within. */ finish_block (new->name, &local_symbols, new->old_blocks, lowpc, highpc, objfile); + + /* In C++, we can have functions nested inside functions (e.g., when + a function declares a class that has methods). This means that + when we finish processing a function scope, we may need to go + back to building a containing block's symbol lists. */ + local_symbols = new->locals; + param_symbols = new->params; + list_in_scope = &file_symbols; }