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: [patch] Use the string returned by pretty printer for MI varobjs instead of "{...}"


On 17/05/12 16:19, André Pönitz wrote:
On Wed, May 16, 2012 at 08:58:42AM -0600, Tom Tromey wrote:
<andre.poenitz@mathematik.tu-chemnitz.de> writes:

Tom> My recollection is that the code originally worked this way, but Tom> Vladimir asked for the "{...}" behavior specifically.

André>  It might affect frontends taking a "{...}" as indication that
André>  there are childrens. In fact, I just found some code using that
André>  as a shortcut.

That code is just plain broken, though.  The has_more field conveys
this information.

If you say so.


'git blame' thinks you added it in September 2009, so gdb 7.0 is
probably the first one that has it.  Calling code "broken" just
because it handles (also...) "legacy" setups is a bit of a stretch
in my opinion.

In any case, I was merely trying to convey the idea that an
unsuspecting frontend implementor might read the documentation
in a way that would be incompatible with the change.

I am personally not affected by any change in the -var-*
output, so maybe I should not have bothered to comment at all.

If you really want to read more into the comment than what was
actually written, then perhaps a friendly nudge to adapt the
documentation to existing practice.

I has been quite a while, but I think I was primarily concerned that GDB would abuse value string on varobj to show what GDB thinks is the right rendering of data. E.g. while "[5]" as top-level value might be a reasonable rendition for an array with 5 children, it's not entirely clear why GDB's machine interface should take liberties at telling frontend how to render that. Neither "[", nor 5, nor "]" is integral part of data, and as soon as GDB outputs that, frontend has no way of knowing whether this is GDB trying to be helpful, or really interesting data that cannot be obtained in any other way.

--
Vladimir Prus
CodeSourcery / Mentor Graphics
http://www.mentor.com/embedded-software/


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