[kmymoney] [Bug 499752] New: The debugger (gdb) cannot display values of instances of the MyMoneyMoney class
Ralf Habacker
bugzilla_noreply at kde.org
Mon Feb 10 11:13:49 GMT 2025
https://bugs.kde.org/show_bug.cgi?id=499752
Bug ID: 499752
Summary: The debugger (gdb) cannot display values of instances
of the MyMoneyMoney class
Classification: Applications
Product: kmymoney
Version: 5.1.92
Platform: Other
OS: All
Status: REPORTED
Severity: normal
Priority: NOR
Component: buildsystem
Assignee: kmymoney-devel at kde.org
Reporter: ralf.habacker at freenet.de
Target Milestone: ---
SUMMARY
The class MyMoneyMoney is an elementary class and is used very often in the
source code. Since the contained value is hidden inside, it cannot be displayed
directly in debuggers such as gdb, kdevelop or QtCreator, which makes debugging
more difficult. Outputs must therefore be generated manually by adding debug
outputs, e.g. with `qDebug() << instance.toDouble()` or in the gdb window with
`p instance.toDouble()`. It would speed up debugging if there is corresponding
support for debuggers.
STEPS TO REPRODUCE
1. build kmymoney from source (git master branch) with debug information
included
2. run
```
gdb <builddir>/bin/kmymoney
(gdb) b main
(gdb) r
(gdb) b MyMoneyMoney::One
```
3. inspect debugger output
OBSERVED RESULT
The debugger displays a lot of data, but not the relevant value:
```
(gdb) p MyMoneyMoney::ONE
$1 = {<AlkValue> = {d = {d = 0x87f300}}, _vptr.MyMoneyMoney = 0x7ffff78b18c0
<vtable for MyMoneyMoney+16>, static maxValue = {<AlkValue> = {d = {d =
0x8807e0}},
_vptr.MyMoneyMoney = 0x7ffff78b18c0 <vtable for MyMoneyMoney+16>, static
maxValue = <same as static member of an already seen type>, static minValue =
{<AlkValue> = {d = {d = 0x880810}},
_vptr.MyMoneyMoney = 0x7ffff78b18c0 <vtable for MyMoneyMoney+16>, static
maxValue = <same as static member of an already seen type>,
static minValue = <same as static member of an already seen type>, static
autoCalc = {<AlkValue> = {d = {d = 0x8807b0}}, _vptr.MyMoneyMoney =
0x7ffff78b18c0 <vtable for MyMoneyMoney+16>,
static maxValue = <same as static member of an already seen type>,
static minValue = <same as static member of an already seen type>,
static autoCalc = <same as static member of an already seen type>,
static ONE = {<AlkValue> = {d = {d = 0x87f300}}, _vptr.MyMoneyMoney =
0x7ffff78b18c0 <vtable for MyMoneyMoney+16>,
static maxValue = <same as static member of an already seen type>,
static minValue = <same as static member of an already seen type>,
static autoCalc = <same as static member of an already seen type>,
static ONE = <same as static member of an already seen type>, static MINUS_ONE
= {<AlkValue> = {d = {d = 0x87f3f0}},
_vptr.MyMoneyMoney = 0x7ffff78b18c0 <vtable for MyMoneyMoney+16>,
static maxValue = <same as static member of an already seen type>,
static minValue = <same as static member of an already seen type>,
static autoCalc = <same as static member of an already seen type>,
static ONE = <same as static member of an already seen type>,
static MINUS_ONE = <same as static member of an already seen type>}},
static MINUS_ONE = <same as static member of an already seen type>},
static ONE = <same as static member of an already seen type>,
static MINUS_ONE = <same as static member of an already seen type>},
static autoCalc = <same as static member of an already seen type>,
static ONE = <same as static member of an already seen type>, static
MINUS_ONE = <same as static member of an already seen type>},
static minValue = <same as static member of an already seen type>, static
autoCalc = <same as static member of an already seen type>, static ONE = <same
as static member of an already seen type>,
static MINUS_ONE = <same as static member of an already seen type>}
```
EXPECTED RESULT
Instead, the debugger should display the value contained in the named instance
```
(gdb) p MyMoneyMoney::ONE
$1 = 1
```
SOFTWARE/OS VERSIONS
Operating System: openSUSE Leap 15.6
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.12
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the KMyMoney-devel
mailing list