From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17163 invoked by alias); 18 Nov 2002 20:42:49 -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 17152 invoked from network); 18 Nov 2002 20:42:46 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 18 Nov 2002 20:42:46 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 362913E39; Mon, 18 Nov 2002 15:42:42 -0500 (EST) Message-ID: <3DD950C1.6090405@redhat.com> Date: Mon, 18 Nov 2002 12:42:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Klee Dienes Cc: Jim Blandy , gdb-patches@sources.redhat.com Subject: Re: [RFA] Handle stack underflow in dbxread.c References: <3908551A-FB2A-11D6-84AF-00039396EEB8@apple.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-11/txt/msg00466.txt.bz2 > On Monday, November 18, 2002, at 12:40 PM, Jim Blandy wrote: > > > Okay, that looks like a good change to me --- please commit it. > > But rather than making pop_context a hairy macro, could you make it a > function in buildsym.c, right after push_context? > > > Gladly. Committed the following: > > > > 2002-11-18 Klee Dienes > > * buildsym.h (pop_context): Convert to function, defined in > buildsym.c. > * buildsym.c: Include gdb_assert.h. > (pop_context): Implement as C function. Add check for stack > underflow. > * dbxread.c (process_one_symbol): Complain and stop processing > that symbol if we are already at the top of the context stack for > a function-end N_FUN (this would imply an umatched RBRAC). Ditto > when processing N_RBRAC. BTW, can you please put some sort of equivalent comment back? > -/* Macro "function" for popping contexts from the stack. Pushing is > - done by a real function, push_context. This returns a pointer to a > - struct context_stack. */ > - > -#define pop_context() (&context_stack[--context_stack_depth]); Andrew