Re: [RFA 2/8] Use counted_command_line everywhere

Tom Tromey
2018-04-24T23:11:34Z

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

>> - for (i = 0; i < action->body_count; ++i)
>> - trace_dump_actions (action->body_list[i],
>> - 1, stepping_frame, from_tty);
>> + trace_dump_actions (action->body_list_0.get (),
>> + 1, stepping_frame, from_tty);
>> + trace_dump_actions (action->body_list_1.get (),
>> + 1, stepping_frame, from_tty);

Pedro> Hmm, this looked suspicious. I'm not seeing why would a
Pedro> while-stepping action have two body lists. I guess this
Pedro> happens to work because trace_dump_actions does nothing
Pedro> if ACTION is NULL.

Yeah. If you prefer I can add an assert that body_list_1==nullptr,
which seems like it ought to always be true.

>> + gdb::unique_xmalloc_ptr<char> default_collect_line
>> + (xstrprintf ("collect %s", default_collect));

Pedro> string_printf ?

I'll do that.

Pedro> It's a shame that we can't use std::make_shared to avoid
Pedro> the separate control block allocation.

It could be done if we changed the representation a bit, but it looked
like a pain to me, so I didn't.

Tom