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: [RFAv2] Output the Ada task name in more messages, output task names between "".


>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:

Philippe> Also, task names are output between double quotes, similarly to what GDB
Philippe> does for thread names.

Philippe>       (gdb) info task
Philippe>          ID           TID P-ID Pri State                  Name
Philippe>       *   1  555555759030       48 Runnable               "main_task"

I am not sure about using the quoting here.  I had talked my way into
it, but then I saw the implementation...

Philippe> +static std::string
Philippe> +task_to_str (int taskno, const ada_task_info *task_info)
Philippe> +{
Philippe> +    if (task_info->name[0] == '\0')

Looks like this function has too much indentation.

Philippe> +	    const struct ada_task_info *const task_info =
Philippe> +	      &data->task_list[taskno - 1];

The "=" should be on the next line here.

Philippe> +      if (uiout->is_mi_like_p ())
Philippe> +	uiout->field_string ("name",
Philippe> +			     task_info->name[0] != '\0' ? task_info->name
Philippe> +			     : _("<no name>"));
Philippe> +      else
Philippe> +	{
Philippe> +	  uiout->field_fmt ("name",
Philippe> +			    "\"%s\"",
Philippe> +			    task_info->name[0] != '\0' ? task_info->name
Philippe> +			    : _("<no name>"));
Philippe> +	}

I'm not a big fan of using is_mi_like_p in general, and here it seems
especially ugly.

thanks,
Tom


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