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: [RFA 2/5] More uses of ui_out_emit_tuple


On 04/14/2017 03:23 AM, Tom Tromey wrote:

> -  do_cleanups (old_chain);
> +    uiout->field_stream ("value", stb);
> +  }
>  
>    annotate_arg_end ();

Looks like the reason that this needed a new scope was
this annotate_arg_end call.

How about instead adding something like this:

struct annotate_arg_emitter
{
  annotate_arg_emitter () { annotate_arg_begin (); }
  ~annotate_arg_emitter () { annotate_arg_end (); }
};

and using it in the function alongside the tuple emitter, like:

    annotate_arg_emitter annotate_arg;
    ui_out_emit_tuple tuple_emitter (uiout, NULL);

Thanks,
Pedro Alves


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