This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: [RFA] rs6000-nat.c fix for large symtabs.
- To: gkm at cygnus dot com (glen mccready), gdb-patches at sourceware dot cygnus dot com
- Subject: Re: [RFA] rs6000-nat.c fix for large symtabs.
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Fri, 7 Apr 2000 15:25:50 -0700
- References: <200004072142.OAA09773@cygint.cygnus.com>
On Apr 7, 2:42pm, glen mccready wrote:
> Some processes have more than 64 load segments; in the past gdb
> would fail under these circumstances. This patch should alleviate
> that problem by expanding the buffer if the ld_info won't fit.
>
> Fri Apr 7 13:44:38 2000 glen mccready <gkm@pobox.com>
>
> * rs6000-nat.c (xcoff_relocate_symtab): Grow buffer if ptrace()
> fails due to lack of space.
[...]
> ! ldi = (void *) alloca (load_segs * sizeof (*ldi));
> ! if (ldi == 0)
> ! perror_with_name ("xcoff_relocate_symtab");
[...]
> ! if (errno == ENOMEM)
> ! load_segs *= 2;
What's the value of sizeof (*ldi) ?
I have concerns about growing the stack too large if we fail multiple
times. I would prefer to see us use xmalloc() and free() in this
situation. (Putting alloca() in a loop is generally not a good idea.)
Kevin