Re: QtCreator for LibreOffice : debugger integration
Le 07/10/2015 14:22, Michael Stahl a écrit : On 07.10.2015 13:12, Michel Renon wrote: > Hi Michael, > > Le 15/06/2015 15:30, Michael Stahl a écrit : >> On 15.06.2015 15:21, Michel Renon wrote: >>> Hi, >>> >>> Here is the next step of QtCreator integration : debugging of OUString >>> (and internal type rtl_uString) >>> >>> http://imgur.com/ZrvIZ2V,2G52CwW,2r2wVSP >>> >>> 1 : default view for OUString variable : just address and length >>> 2 : new view : you have the string (here with some specific french >>> characters and 'euro' symbol) >>> 3 : new view : you can have internals of OUString >> >> i don't quite understand - why not just display the content of the >> string by default using the python pretty printers in solenv/gdb, like >> Eclipse CDT and KDevelop do? > > Because QtCreator has its own api... > http://doc.qt.io/qtcreator/creator-debugging-helpers.html ... but evidently the gdb ones do work, for me, on Fedora 22: qt-creator-3.5.0-1.fc22.x86_64 Ah... I have Qt Creator 3.1.1 (with Ubuntu SDK) if i attach to soffice.bin and hover over an OUString variable the pop-up displays the content of the string properly; also the "variable" view on the right side of the window. iirc this didn't work out-of-the-box, i had to go to Tools->Options->Debugger->GDB and change something there, probably the "Load system GDB pretty printers" setting. Fyi, here is a screenshot of the popup display when I applied your settings http://imgur.com/z8o1F7G I'll ask that question to Qt support and keep you informed. Thanks for your feedback, Michel ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: QtCreator for LibreOffice : debugger integration
On 07.10.2015 13:12, Michel Renon wrote: > Hi Michael, > > Le 15/06/2015 15:30, Michael Stahl a écrit : >> On 15.06.2015 15:21, Michel Renon wrote: >>> Hi, >>> >>> Here is the next step of QtCreator integration : debugging of OUString >>> (and internal type rtl_uString) >>> >>> http://imgur.com/ZrvIZ2V,2G52CwW,2r2wVSP >>> >>> 1 : default view for OUString variable : just address and length >>> 2 : new view : you have the string (here with some specific french >>> characters and 'euro' symbol) >>> 3 : new view : you can have internals of OUString >> >> i don't quite understand - why not just display the content of the >> string by default using the python pretty printers in solenv/gdb, like >> Eclipse CDT and KDevelop do? > > Because QtCreator has its own api... > http://doc.qt.io/qtcreator/creator-debugging-helpers.html ... but evidently the gdb ones do work, for me, on Fedora 22: qt-creator-3.5.0-1.fc22.x86_64 if i attach to soffice.bin and hover over an OUString variable the pop-up displays the content of the string properly; also the "variable" view on the right side of the window. iirc this didn't work out-of-the-box, i had to go to Tools->Options->Debugger->GDB and change something there, probably the "Load system GDB pretty printers" setting. > It seems that there cannot be common/shared code between existing gdb helpers > and qtcreator's one [1]. > > So can i create a folder : solenv/gdb/qtcreator that will contain specific > qtcreator gdb helpers ? > I started with strings, and will continue with other basic LO types. well i still don't understand why the existing things don't work for you... the documentation you refer to claims that these Qt specific python helpers work with both gdb and lldb, so perhaps you could use them on MacOS X where there is no well working gdb? > Currently, I need to manually enter the path to those helpers in a QtCreator > dialog. > (qtcreator just execute in gdb "source path/to/helper.py") > Is there a way to predefine that command in gdb to avoid any manual > configuration ? > If possible, I plan to execute it at the end of "make > qtcreator-ide-integration" command. gdb can auto-load python files with a particular naming pattern like "libuno_sal.so.3-gdb.py" but we already use that for the gdb pretty-printers. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: QtCreator for LibreOffice : debugger integration
Hi Michael, Le 15/06/2015 15:30, Michael Stahl a écrit : On 15.06.2015 15:21, Michel Renon wrote: > Hi, > > Here is the next step of QtCreator integration : debugging of OUString > (and internal type rtl_uString) > > http://imgur.com/ZrvIZ2V,2G52CwW,2r2wVSP > > 1 : default view for OUString variable : just address and length > 2 : new view : you have the string (here with some specific french > characters and 'euro' symbol) > 3 : new view : you can have internals of OUString i don't quite understand - why not just display the content of the string by default using the python pretty printers in solenv/gdb, like Eclipse CDT and KDevelop do? Because QtCreator has its own api... http://doc.qt.io/qtcreator/creator-debugging-helpers.html It seems that there cannot be common/shared code between existing gdb helpers and qtcreator's one [1]. So can i create a folder : solenv/gdb/qtcreator that will contain specific qtcreator gdb helpers ? I started with strings, and will continue with other basic LO types. Currently, I need to manually enter the path to those helpers in a QtCreator dialog. (qtcreator just execute in gdb "source path/to/helper.py") Is there a way to predefine that command in gdb to avoid any manual configuration ? If possible, I plan to execute it at the end of "make qtcreator-ide-integration" command. Cheers, Michel [1] An example with OUString for QtCreator : --- def __get_rtl_ustring(d, pdata): """ """ charSize = 2 array = pdata["buffer"] length = pdata["length"] cutoff = min(length*charSize, d.stringCutOff) mem = d.readMemory(array, cutoff) encodingType = Hex4EncodedLittleEndian return mem, encodingType def qdump__rtl__OUString(d, value): """ class SAL_WARN_UNUSED SAL_DLLPUBLIC_RTTI OUString { public: /// @cond INTERNAL rtl_uString * pData; /// @endcond """ pdata = value["pData"] # show rtl_uString mem, encodingType = __get_rtl_ustring(d, pdata) d.putValue(mem, encodingType) d.putAddress(value.address) ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: QtCreator for LibreOffice : debugger integration
On 15.06.2015 15:21, Michel Renon wrote: > Hi, > > Here is the next step of QtCreator integration : debugging of OUString > (and internal type rtl_uString) > > http://imgur.com/ZrvIZ2V,2G52CwW,2r2wVSP > > 1 : default view for OUString variable : just address and length > 2 : new view : you have the string (here with some specific french > characters and 'euro' symbol) > 3 : new view : you can have internals of OUString i don't quite understand - why not just display the content of the string by default using the python pretty printers in solenv/gdb, like Eclipse CDT and KDevelop do? > And a noob question : > how to define an unicode string in c++ ? > I wrote : > rtl:OUString sTest = "éèà€"; > or > rtl:OUString sTest("éèà€"); the constructors from string literals require ASCII encoding. there is another constructor where you can give explicit text encoding so you can pass RTL_TEXTENCODING_UTF8. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice