GSoc GDB pretty printers: Automatic testing and printing class pointers

Da Viper yerimyah1 at gmail.com
Wed Jun 30 19:09:27 BST 2021


The problem is in the debugger for kdevelop if you are checking the pointer
value in kdevelop or any IDE

it does not show any other value except the pointer value  when viewing a
pointer

in contrast to `std::string*` it shows the fields of a std::string.
however i just realised that those value show without the standard printers


The current problem i am facing now is how to automate the test cases,
i am not sure how to go about that, it is to make sure that older classes
are not affected when new printer classes are created



On Tue, 29 Jun 2021 at 16:41, Thomas Baumgart <thb at net-bembel.de> wrote:

>
> On Samstag, 26. Juni 2021 17:35:59 CEST Thomas Baumgart wrote:
>
> > On Donnerstag, 17. Juni 2021 17:28:24 CEST Da Viper wrote:
> >
> > > Hello there,
> > >
> > > This is a continuation of the chat from the telegram group
> > >
> > > - Manual Test
> > > The way i perform manual test is that, I create a cpp file then
> instantiate
> > > the class with all possible constructors and input the set a break
> point at
> > > the bottom to compare all the output  to the given input
> > > i am not sure of a way to make this automatic as it would be easier to
> know
> > > when new changes affect existing code instead of performing all the
> test
> > > for the hundred of classes
> >
> > I am not sure if I understand the above so that I am able to duplicate
> it.
> > Also, where do you have your code available for duplication?
> >
> > > - Printing Classes instantiated as pointer
> > > for example if we have a qstring created like this
> > >
> > > `QString qsst("this is another string");`
> > >  `QString *thePtr = &qsst;`
> > >
> > > if i am to create a printer for qstring it does not apply the printer
> for
> > > the variable `thePtr`
> > > i am not sure how to fix the problem ( however the same also happens
> for
> > > `std::string` but it is also included the value later)
> >
> > Having access to your printers may certainly help us to make suggestions.
> > Otherwise, this is somewhat shooting in the dark.
>
> Now that I have access, I could try to duplicate this. To me this look like
> it is working:
>
> 7          QString qsst("this is another string");
> (gdb) n
> 8          QString *thePtr = &qsst;
> (gdb) p qsst
> $1 = "this is another string"
> (gdb) n
> 10         QString str("firstString");
> (gdb) p thePtr
> $2 = (QString *) 0x7fffffffd658
> (gdb) p *thePtr
> $3 = "this is another string"
>
> Does that make sense?
>
> --
>
> Regards
>
> Thomas Baumgart
>
> https://www.signal.org/       Signal, the better WhatsApp
> -------------------------------------------------------------
> There are two rules for success in life:
> Rule 1: Don't tell people everything you know.
> -------------------------------------------------------------
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-finance-apps/attachments/20210630/c5aadbe2/attachment.htm>


More information about the Kde-finance-apps mailing list