This is the mail archive of the gdb-patches@sourceware.cygnus.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]

Re: [RFA] rs6000-nat.c fix for large symtabs.


>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

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