Topic: build pretty-print of STL at the language level


Author: wm2015email@gmail.com
Date: Thu, 22 Dec 2016 08:45:17 -0800 (PST)
Raw View
------=_Part_262_314703510.1482425117101
Content-Type: multipart/alternative;
 boundary="----=_Part_263_2144381385.1482425117101"

------=_Part_263_2144381385.1482425117101
Content-Type: text/plain; charset=UTF-8

build pretty-print of STL at the language level rather than debugger
level...

Here's a worthy standard's improvement. adding  a special grammer to C++
classes for specifying the pretty-print STL format to the debugger before
compilation rather than after compilation with the "printers.py gdb
bandaid".

That's the real reason STL containers stink.   You can't see anything when
debugging because the
"pretty printers" is always broken or misconfigured for your compiler and
really its only a kludge where there are better ways to solve the
problem...  such as marking the fields to export to the debugger "pretty
printer".  if only they would just tag the "char*" buried 3 levels down in
the container as a "pretty printer" export to the debugger to show
first...before digging into the ugly details of the data structure.
Like some type of  syntax in the language to self-document how the date in
the underlying structure of the container should be presented to the
debugger and that has no real purpose in the code other than documenting.

Crude example:

class mycontainer {
public:
  int junk field1;
  int junk field2;
  string    fields3;
  objx      obj3[10];

pretty_printers:
   char* field3 : obj3[3]->obj4.mychar;
   char* field1 : obj3[1]->obj4->obj3423->mychar;
}


debugger watch window:
   mycontainer   char* x.field3
   mycontainer   char* x.field1
    <click to expand full ugliness>

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/6d1ca157-7bcf-4426-9493-405dcdb9e031%40isocpp.org.

------=_Part_263_2144381385.1482425117101
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">build pretty-print of STL at the language level rather tha=
n debugger level...<br><br>Here&#39;s a worthy standard&#39;s improvement. =
adding=C2=A0 a special grammer to C++ classes for specifying the pretty-pri=
nt STL format to the debugger before compilation rather than after compilat=
ion with the &quot;printers.py gdb bandaid&quot;.=C2=A0 <br><br>That&#39;s =
the real reason STL containers stink. =C2=A0 You can&#39;t see anything whe=
n debugging because the <br>&quot;pretty printers&quot; is always broken or=
 misconfigured for your compiler and really its only a kludge where there a=
re better ways to solve the problem...=C2=A0 such as marking the fields to =
export to the debugger &quot;pretty printer&quot;.=C2=A0 if only they would=
 just tag the &quot;char*&quot; buried 3 levels down in the container as a =
&quot;pretty printer&quot; export to the debugger to show first...before di=
gging into the ugly details of the data structure.<br>Like some type of=C2=
=A0 syntax in the language to self-document how the date in the underlying =
structure of the container should be presented to the debugger and that has=
 no real purpose in the code other than documenting.<br><br>Crude example:<=
br><br>class mycontainer {<br>public:<br>=C2=A0 int junk field1;<br>=C2=A0 =
int junk field2;=C2=A0=C2=A0 <br>=C2=A0 string=C2=A0=C2=A0=C2=A0 fields3;<b=
r>=C2=A0 objx=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 obj3[10];<br><br>pretty_printer=
s:<br>=C2=A0=C2=A0 char* field3 : obj3[3]-&gt;obj4.mychar;=C2=A0 <br>=C2=A0=
=C2=A0 char* field1 : obj3[1]-&gt;obj4-&gt;obj3423-&gt;mychar;=C2=A0 <br>}<=
br><br><br>debugger watch window:<br>=C2=A0=C2=A0 mycontainer=C2=A0=C2=A0 c=
har* x.field3 <br>=C2=A0=C2=A0 mycontainer=C2=A0=C2=A0 char* x.field1<br>=
=C2=A0=C2=A0=C2=A0 &lt;click to expand full ugliness&gt;</div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/6d1ca157-7bcf-4426-9493-405dcdb9e031%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/6d1ca157-7bcf-4426-9493-405dcdb9e031=
%40isocpp.org</a>.<br />

------=_Part_263_2144381385.1482425117101--

------=_Part_262_314703510.1482425117101--

.


Author: Nicol Bolas <jmckesson@gmail.com>
Date: Thu, 22 Dec 2016 09:25:54 -0800 (PST)
Raw View
------=_Part_753_662502121.1482427554833
Content-Type: multipart/alternative;
 boundary="----=_Part_754_897961525.1482427554833"

------=_Part_754_897961525.1482427554833
Content-Type: text/plain; charset=UTF-8

No. We should not add C++ syntax explicitly and *solely* for dealing with
compiler/debugger issues.

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c50eba52-8067-4f81-96f1-6d5d62aab228%40isocpp.org.

------=_Part_754_897961525.1482427554833
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">No. We should not add C++ syntax explicitly and <i>solely<=
/i> for dealing with compiler/debugger issues.<br></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/c50eba52-8067-4f81-96f1-6d5d62aab228%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/c50eba52-8067-4f81-96f1-6d5d62aab228=
%40isocpp.org</a>.<br />

------=_Part_754_897961525.1482427554833--

------=_Part_753_662502121.1482427554833--

.