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: Kevin Buettner <kevinb at cygnus dot com>
- Subject: Re: [RFA] rs6000-nat.c fix for large symtabs.
- From: gkm at cygnus dot com (glen mccready)
- Date: Fri, 07 Apr 2000 17:44:00 -0700
- Cc: gdb-patches at sourceware dot cygnus dot 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) ?
26 bytes, I believe.
>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.)
I did, too, but given how infrequently this problem is run across
I'd be surprised if the loop ever went through more than twice.
glen