Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Matt Rice <ratmice@gmail.com>
To: Pedro Alves <palves@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,
	Trevor Saunders <tbsaunde@tbsaunde.org>,
		"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFA 1/5] Remove some ui_out-related cleanups from Python
Date: Thu, 09 Feb 2017 15:46:00 -0000	[thread overview]
Message-ID: <CACTLOFoYGFUGr5KA=ZzQe7_yu2C8LbzsYFKrK6bQ7dNJRozmLg@mail.gmail.com> (raw)
In-Reply-To: <86ddf1f5-a957-5a99-deac-936848b10190@redhat.com>

On Thu, Feb 9, 2017 at 4:51 AM, Pedro Alves <palves@redhat.com> wrote:
> On 02/09/2017 12:48 PM, Pedro Alves wrote:
>> Hi Matt,
>>
>> On 02/09/2017 04:34 AM, Matt Rice wrote:
>>
>>> Wondering if this would be a good opportunity to try and transition
>>> ui_out_list construction into a more type safe manner, e.g.
>>> result ==> variable "=" value
>>> list ==> "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"
>>>
>>> currently when building a list, it didn't specify whether you were
>>> declaring a list of results or a list of values, unless/until the
>>> first value or result was added, and IIRC this | property wasn't
>>> really explicitly enforced.
>>
>> More type-safety sounds good to me.  :-)
>>
>> Can you give an example of a command that outputs a result list,
>> and an example of a command that outputs a value list?
>>

There is a good example of a command which outputs both in the
documentation (in the example below "The -break-insert command")

interpreter-exec mi -break-insert main
interpreter-exec mi -break-insert -t foo
interpreter-exec mi -break-list

in the output of the -break-list command there is a list of results of the form:
body=[bkpt=... , bkpt=...]

https://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html#g_t_002dbreak_002dinsert

I picked that one specifically because it shows the duplicate "bkpt" keys.
inside those bkpt={... thread-groups=["i1"] ... } should be a list of values.

interpreter-exec mi -list-thread-groups is a slightly easier to read
one that returns a list of values (tuples)
^done,groups=[tuple, ...]

Additionally of note is:
https://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI-Output-Syntax.html#GDB_002fMI-Output-Syntax
* New gdb/mi commands should only output lists containing values.

So, i suppose result_list should be some variation on
compat_only_result_list or some such...

>>> it'd be nice to migrate this to something like:
>>> result_list, value_list, deprecated_unspecified_list, It would be nice
>>> to know if/when you guys think it would be a convenient time to
>>> introduce such a change so I could get back up to speed...
>>
>> Simon has already C++-fyed ui_out in master, so this seems like
>> a good time to me.
>
> Though, to be clear, IIUC, you're talking about changing
> GDB internals without affecting the resulting MI output, right?

Yes, internals change only,


  reply	other threads:[~2017-02-09 15:46 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-15 13:43 [RFA 0/5] more cleanup removal in Python Tom Tromey
2017-01-15 13:43 ` [RFA 5/5] Remove some gotos from Python Tom Tromey
2017-02-09 13:03   ` Pedro Alves
2017-01-15 13:43 ` [RFA 2/5] Introduce ui_file_up and use it to remove cleanups Tom Tromey
2017-01-16  9:59   ` Trevor Saunders
2017-01-16 17:58   ` Pedro Alves
2017-01-16 19:08     ` Tom Tromey
2017-01-17  1:40       ` Pedro Alves
2017-01-17 19:05         ` Tom Tromey
2017-01-15 13:43 ` [RFA 3/5] Introduce gdbpy_subclass and use it to simplify some logic Tom Tromey
2017-01-24 20:21   ` Simon Marchi
2017-02-09 11:44     ` Pedro Alves
2017-02-09 18:52       ` Tom Tromey
2017-02-09 13:00   ` Pedro Alves
2017-01-15 13:43 ` [RFA 1/5] Remove some ui_out-related cleanups from Python Tom Tromey
2017-01-15 21:52   ` Simon Marchi
2017-01-16 16:13     ` Tom Tromey
2017-01-16 11:19   ` Trevor Saunders
2017-02-08 17:28     ` Pedro Alves
2017-02-08 22:27       ` Pedro Alves
2017-02-08 23:05       ` Tom Tromey
2017-02-08 23:52         ` Pedro Alves
2017-02-09  4:34           ` Matt Rice
2017-02-09 12:48             ` Pedro Alves
2017-02-09 12:51               ` Pedro Alves
2017-02-09 15:46                 ` Matt Rice [this message]
2017-02-09 16:04                   ` Simon Marchi
2017-02-10  6:47       ` Trevor Saunders
2017-01-15 13:43 ` [RFA 4/5] Change one more spot to use gdbpy_ref Tom Tromey
2017-02-09 12:52   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACTLOFoYGFUGr5KA=ZzQe7_yu2C8LbzsYFKrK6bQ7dNJRozmLg@mail.gmail.com' \
    --to=ratmice@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=tbsaunde@tbsaunde.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox