<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Am 02.08.21 um 18:23 schrieb Da Viper:<br>
</div>
<blockquote type="cite"
cite="mid:CAEtKUfhuA21yuu9yDXTRMWBg9pu575yW3JpkhitLUeHWuj4Ppw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">Hello there I am currently do so,
<div dir="auto"><br>
</div>
<div dir="auto">But I have a problem with using python2,</div>
<div dir="auto"><br>
</div>
<div dir="auto">It does not work for some classes in an ide but
I cannot figure out why,</div>
<div dir="auto"><br>
</div>
<div dir="auto">I have updated the read me to add python 2</div>
<div dir="auto"><br>
</div>
<div dir="auto">You have to import qtprinters_py2 to use python2</div>
</div>
</blockquote>
Comparing this new file with printer.py, I see that one major
difference is the usage of the brand new python 3.6 feature named
f-string, <br>
<br>
def to_string(self) -> str:<br>
ucs = self.val['ucs']<br>
<p> return f"{ucs} '{chr(ucs)}'"</p>
<p>where the python 2 style</p>
<p> def to_string(self):<br>
ucs = self.val['ucs']<br>
return "%d '%s'" % (ucs, chr(ucs))<br>
<br>
also works with python3.</p>
<p>Another difference is the int()/long() differences, for which a
major version independent recipe is available:<br>
</p>
<p>if sys.version_info[0] > 2:<br>
# int subsumes long<br>
long = int<br>
</p>
<p>...</p>
<p>in code the use long() regardless of major version <br>
</p>
<p>See
<a class="moz-txt-link-freetext" href="https://github.com/gcc-mirror/gcc/blob/16e2427f50c208dfe07d07f18009969502c25dc8/libstdc%2B%2B-v3/python/libstdcxx/v6/printers.py#L46">https://github.com/gcc-mirror/gcc/blob/16e2427f50c208dfe07d07f18009969502c25dc8/libstdc%2B%2B-v3/python/libstdcxx/v6/printers.py#L46</a>
for further compatibility hints.</p>
<p><a class="moz-txt-link-freetext" href="https://python-future.org/compatible_idioms.html">https://python-future.org/compatible_idioms.html</a> also provides
hints for how to write python 2 and 3 compatible code.<br>
</p>
<p>
</p>
<p> <br>
</p>
<blockquote type="cite"
cite="mid:CAEtKUfhuA21yuu9yDXTRMWBg9pu575yW3JpkhitLUeHWuj4Ppw@mail.gmail.com">
<div dir="auto">
<div dir="auto">SCENARIO: </div>
<div dir="auto"><br>
</div>
<div dir="auto">For example we have a qfile </div>
<div dir="auto"><br>
</div>
<div dir="auto">`QFile file("/some/file/path");`</div>
<div dir="auto"><br>
</div>
<div dir="auto">if I go to the command line gdb to print it, it
works correctly, <br>
</div>
</div>
</blockquote>
you used the version from the mentioned kmymoney snapshots ? <br>
<blockquote type="cite"
cite="mid:CAEtKUfhuA21yuu9yDXTRMWBg9pu575yW3JpkhitLUeHWuj4Ppw@mail.gmail.com">
<div dir="auto">
<div dir="auto"><br>
but when I try it within the IDE it crashes.<br>
</div>
</div>
</blockquote>
<blockquote type="cite"
cite="mid:CAEtKUfhuA21yuu9yDXTRMWBg9pu575yW3JpkhitLUeHWuj4Ppw@mail.gmail.com">
<div dir="auto">
<div dir="auto">I think it has to do with the long type when
reading the memory of the QFile in python2 but I am not sure.
I tried using int() for the address. But It is too large.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Is there a way to know what the actual problem
is because it just crashes without any traceback.<br>
</div>
</div>
</blockquote>
<p>
Many applications on Windows uses the windows debug port, which
can be inspected by dbgview (search on google), which needs to be
started in front of the application in question.</p>
<p>If that does not help, running the IDE from command line gdb or
attaching gdb to the running IDE after it has been started should
give you at least tracebacks in case an exception or segment
violation occured.<br>
</p>
<p>If that does not help adding print statements to your python code
to see which line is working and which not, may give you some
insights. Printing the value of variables can also help. Also
installing a trace function may help, see for
<a class="moz-txt-link-freetext" href="https://pymotw.com/2/sys/tracing.html">https://pymotw.com/2/sys/tracing.html</a>, which may give detailled
output, but I haven't tried yet. <br>
</p>
<p>Debugging the IDE application may also be an option, but this
needs some investigation, how the IDE implemented the debugging
(does it call an external debugger or it that provided by the same
process) and where the issue happens (inside the debugger or
inside the IDE). It also requires debug symbols for the IDE
application.<br>
</p>
<p>Regards</p>
<p>Ralf</p>
<blockquote type="cite"
cite="mid:CAEtKUfhuA21yuu9yDXTRMWBg9pu575yW3JpkhitLUeHWuj4Ppw@mail.gmail.com"><br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, 2 Aug 2021, 09:15 Ralf
Habacker via Kde-finance-apps, <<a
href="mailto:kde-finance-apps@kde.org"
moz-do-not-send="true">kde-finance-apps@kde.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div> Am 20.07.21 um 10:23 schrieb Ralf Habacker via
Kde-finance-apps:<br>
> Hi Ebuka,<br>
><br>
> I remembered you mentioning the long loading time of
gdb when debug<br>
> symbols are installed.<br>
><br>
I recognized that the recent gdb version 10.2 speeds up
symbol loading on Windows, see<a
href="https://lists.gnu.org/archive/html/info-gnu/2021-04/msg00006.html"
target="_blank" rel="noreferrer" moz-do-not-send="true"><br>
<br>
https://lists.gnu.org/archive/html/info-gnu/2021-04/msg00006.html</a><br>
* Improved performance during startup through the use of
threading<br>
during symbol table loading (an optional feature in GDB 9,
now<br>
enabled by default in GDB 10).<br>
<br>
You may verify this with a recent kmymoney snapshot from <a
href="https://kmymoney.org/snapshots.php#kmymoney5-aq6"
target="_blank" rel="noreferrer" moz-do-not-send="true">https://kmymoney.org/snapshots.php#kmymoney5-aq6</a>,
which now contains gdb 10.2.
<p>If you want a standalone gdb package that is independent
of kmymoney and better suited for testing with your gdb
printer GSOC project, you can check <a
href="https://kmymoney.org/snapshots.php#gdb-snapshot"
target="_blank" rel="noreferrer" moz-do-not-send="true">https://kmymoney.org/snapshots.php#gdb-snapshot</a>.</p>
Regards<br>
Ralf </div>
</blockquote>
</div>
</blockquote>
</body>
</html>