Re: [PATCH 14/40] fix two buglets in breakpoint.c

Tom Tromey
2013-05-13T14:58:34Z

>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

>> @@ -5814,7 +5814,10 @@ output_thread_groups (struct ui_out *uiout,
>> /* For backward compatibility, don't display inferiors in CLI unless
>> there are several. Always display them for MI. */
>> if (!is_mi && mi_only)
>> - return;
>> + {
>> + do_cleanups (back_to);
>> + return;
>> + }

Yao> A nit here, we may call 'make_cleanup_ui_out_list_begin_end' after
Yao> this condition checking, so we don't need 'do_cleanups' here.

That isn't what I see in trunk:

static void
output_thread_groups (struct ui_out *uiout,
const char *field_name,
VEC(int) *inf_num,
int mi_only)
{
struct cleanup *back_to = make_cleanup_ui_out_list_begin_end (uiout,
field_name);
int is_mi = ui_out_is_mi_like_p (uiout);
int inf;
int i;

/* For backward compatibility, don't display inferiors in CLI unless
there are several. Always display them for MI. */
if (!is_mi && mi_only)
return;

That "return" leaves a cleanup dangling.

Tom