This is the mail archive of the gdb-patches@sourceware.org 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: [patch 04/12] entryval: Virtual tail call frames


On Tue, 19 Jul 2011 16:43:10 +0200, Tom Tromey wrote:
> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
...
> Jan> +/* Associated structure of the unwinder for call_site_chain.  */
> Jan> +
> Jan> +struct tailcall_cache
> Jan> +{
> Jan> +  /* It must be the first one of this struct.  It is the furthest callee.  */
> Jan> +  struct frame_info *next_bottom_frame;
> 
> It was not obvious to me that the caching all works out correctly so
> that it is ok to use a frame_info instead of a frame ID here.  I take
> your word for it, of course, but a comment about how one would recognize
> the correctness of this code would have been helpful.

There is dealloc_cache method used for any TAILCALL_FRAME and the reference
counting there is hopefully right so I do not see why there should be
a problem.

Once frame_info is created it can be ever destroyed only by
reinit_frame_cache, at that time everything gets deleted.  Maybe the code
could use frame_obstack_zalloc instead of xmalloc/xfree but that is only an
efficiency change.

Added there some comment.


> Jan> +++ b/gdb/dwarf2-frame-tailcall.h
> 
> Should go in HFILES_NO_SRCDIR.

done.


> Jan> +/* Cleanup helper to free VEC (call_sitep) **.  */
> Jan> +
> Jan> +static void
> Jan> +free_call_sitep_vecp (void *arg)
> 
> You can delete this function and just use 'VEC_cleanup (call_sitep)'.

done.


> Jan> +  add_setshow_zinteger_cmd ("tailcall", class_maintenance,
> Jan> +			    &tailcall_debug,
> Jan> +			    _("Set tail call frames debugging."),
> Jan> +			    _("Show tail call frames debugging."),
> Jan> +			    _("When non-zero, the process of determining tail "
> Jan> +			      "call frames will be printed.  You may also want "
> Jan> +			      "to `set verbose 1' for more info."),
> Jan> +			    NULL,
> Jan> +			    show_tailcall_debug,
> Jan> +			    &setdebuglist, &showdebuglist);
> 
> Needs a doc patch.

done.


> Jan> +  /* A virtual frame of a tail call - see dwarf2_tailcall_frame_unwind.  */
> Jan> +  TAILCALL_FRAME,
> 
> This needs a Python API update and a corresponding doc patch.

done.


It will be in a new patchset resubmit.


Thanks,
Jan


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