This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Handle stack underflow in dbxread.c


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  <kdienes@apple.com>

        * 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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]