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: your turn :-)


> oops, this should be deleted.  An earlier change modified set_reg_offset 
> to ignore NULL pointers.
> 
> >    -  this_cache = xrealloc (this_cache, SIZEOF_FRAME_SAVED_REGS);
> >    -  memset (this_cache, '\0', SIZEOF_FRAME_SAVED_REGS);
> 
> 
> >    +  this_cache->saved_regs = xrealloc (this_cache->saved_regs,
> >    +                                     SIZEOF_FRAME_SAVED_REGS);
> >    +  memset (this_cache->saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS);

Of course, this was OB - vious!

> >What should heuristic_proc_desc do if the cache given is NULL.
> >Create a temporary one while scaning the function, and then
> >trash it?
> 
> No, the code should survive a NULL this_cache.

OK.

> >Another question that's troubling me: I can't see how mips_frame_cache
> >structs are deallocated. I am guessing that this happens when the
> >obstack is reset, but then that would mean that we leak the save_regs
> >array. ???
> 
> Right.  The deallocate occures each time the frame cache is flushed and 
> that occures over and over.

I was confused by the saved_regs array re-allocation above. I thought
that was what you meant when I saw that code, so I was confused. Now,
with these lines gone, I see the code allocating this array and it
becomes obvious too. I shouldn't be doing things in a hurry...

Thanks,
-- 
Joel


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