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: RFC: lazily call save_current_space_and_thread


On Fri, 04 Mar 2011 20:52:41 +0100, Tom Tromey wrote:
> +  /* We lazily save the current program space.  Saving the current
> +     program space is reasonably expensive in the multi-inferior case,
> +     and in many situations we don't need to do it.  Comparing a
> +     cleanup against NULL is usually forbidden, but in this case we
> +     have already made a cleanup, so we know it is safe.  */
> +  struct cleanup *current_space_cleanup = NULL;
> +
[...]
> +      if (current_space_cleanup == NULL)
> +	current_space_cleanup = save_current_space_and_thread ();

save_current_space_and_thread - like any make_cleanup derivation - may return
NULL even for successfully pushed cleanup function.  For example inside
TRY_CATCH, due to its save_cleanups.

GDB does need more C++.


Thanks,
Jan


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