Re: Breakpoints
On Wed, 2012-06-20 at 12:04 -0700, Joel Madero wrote: > Thanks I'll look through those links. One thing I noticed on the wiki > is that it says to do this: ... > cd /opt/libreoffice/program :-) > when I install from source it never installs there so I was confused > for a second (or two). I think maybe updating the wiki to include a > couple examples or at least a link to the first site you provided > could be useful. Sure - perhaps better to use a generic install/program path - which then would match the 'make dev-install' location. Feel free to edit/improve the wiki :-) Another thing about gdb is that breakpoints on C++ functions have traditionally not work out that well for me; there is always some gotcha: two forms of object constructor, polymorphic methods, tab-completion not working / and/or taking forages. So typically I use what (I suspect) IDE's use, and appears to be well debugged, putting a break-point at a specific module & line number: break view.cxx:1234 then: thread apply all backtrace or t a a bt When the breakpoint is hit :-) HTH, Michael. -- michael.me...@suse.com <><, Pseudo Engineer, itinerant idiot ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Breakpoints
On 06/20/2012 02:04 PM, Joel Madero wrote: Thanks I'll look through those links. One thing I noticed on the wiki is that it says to do this: cd /opt/libreoffice/program when I install from source it never installs there so I was confused for a second (or two). I think maybe updating the wiki to include a couple examples or at least a link to the first site you provided could be useful. Thanks again, Joel I didn't notice that myself, but you should cd to whatever directory you make install to. If you use make dev-install, then you would mostly likely want to cd to LIBOROOT/install/program, where LIBOROOT is the root directory where ever you git cloned. Also make sure you are building with --enable-debug or at least with --enable-symbols. --Daniel ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Breakpoints
Thanks I'll look through those links. One thing I noticed on the wiki is that it says to do this: cd /opt/libreoffice/program when I install from source it never installs there so I was confused for a second (or two). I think maybe updating the wiki to include a couple examples or at least a link to the first site you provided could be useful. Thanks again, Joel On Wed, Jun 20, 2012 at 11:51 AM, Daniel Bankston < daniel.dev.libreoff...@gmail.com> wrote: > On 06/20/2012 01:45 PM, Daniel Bankston wrote: > > Also take a lot at this about gdb and libo if you haven't already: > https://wiki.documentfoundation.org/Development/How_to_debug > > Take a "look". :-) > ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Breakpoints
On 06/20/2012 01:45 PM, Daniel Bankston wrote: Also take a lot at this about gdb and libo if you haven't already: https://wiki.documentfoundation.org/Development/How_to_debug Take a "look". :-) ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Breakpoints
On 06/20/2012 01:42 PM, Daniel Bankston wrote: On 06/20/2012 12:55 PM, Joel Madero wrote: I think this is a basic question but how do I go about putting on breakpoints and then how do I "use" the breakpoints to determine things like what variables are being called on? This stems from a previous email where someone suggested doing the following to locate rotating text: /...Or maybe run around to the other side where the text actually gets drawn to screen in vcl/unx/generic/gdi/salgdi3.cxx and put breakpoints on the two cairo_matrix_rotate calls and examine the backtrace then to see where it all comes from./ / / Thanks in advance, learning as I go. Joel Hi, Joel, From RMS himself: http://www.unknownroad.com/rtfm/gdbtut/gdbbreak.html Markus let me know about this handy cheat sheet: http://darkdust.net/files/GDB%20Cheat%20Sheet.pdf --Daniel Bankston Also take a lot at this about gdb and libo if you haven't already: https://wiki.documentfoundation.org/Development/How_to_debug ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Breakpoints
On 06/20/2012 12:55 PM, Joel Madero wrote: I think this is a basic question but how do I go about putting on breakpoints and then how do I "use" the breakpoints to determine things like what variables are being called on? This stems from a previous email where someone suggested doing the following to locate rotating text: /...Or maybe run around to the other side where the text actually gets drawn to screen in vcl/unx/generic/gdi/salgdi3.cxx and put breakpoints on the two cairo_matrix_rotate calls and examine the backtrace then to see where it all comes from./ / / Thanks in advance, learning as I go. Joel Hi, Joel, From RMS himself: http://www.unknownroad.com/rtfm/gdbtut/gdbbreak.html Markus let me know about this handy cheat sheet: http://darkdust.net/files/GDB%20Cheat%20Sheet.pdf --Daniel Bankston ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Breakpoints
I think this is a basic question but how do I go about putting on breakpoints and then how do I "use" the breakpoints to determine things like what variables are being called on? This stems from a previous email where someone suggested doing the following to locate rotating text: *...Or maybe run around to the other side where the text actually gets drawn to screen in vcl/unx/generic/gdi/salgdi3.cxx and put breakpoints on the two cairo_matrix_rotate calls and examine the backtrace then to see where it all comes from.* * * Thanks in advance, learning as I go. Joel ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PUSHED][PATCH] Fix for dialog Manage Breakpoints crash
Hi Niklas, On Tuesday, 2011-11-29 09:50:26 +0100, Niklas Johansson wrote: > >- rList.reset(); > >+ rList.clear(); > > > >Please check if that fixes the problem. > > That fixes the problem, and definitely looks like a cleaner > solution. Do you create the patch or should I create a new one? I included that with your patch. > I created and attached a patch for the pass count. Great, thanks! Pushed to master: http://cgit.freedesktop.org/libreoffice/core/commit/?id=0083479a80de831b0ae90877aa4f5d6c4670eb49 I just mentioned fdo#42778 and the crash in the commit's summary. As this seems to be your first contribution to the code base please confirm with a blanket statement that you contribute this and further patches under LGPLv3+ and MPL 1.1 licenses. Thanks Eike -- LibreOffice Calc developer. Number formatter stricken i18n transpositionizer. GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3 9E96 2F1A D073 293C 05FD pgpLQjJudhEiP.pgp Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] Fix for dialog Manage Breakpoints crash
In worst case it makes the program crash. This fix, stores the values. I'm not that experienced with C++ so could someone have a second look at this there might very well be a "cleaner" way of writing it. Good find! I think I would do it slightly different, the patch fixes the symptom correctly by allocating new objects, but the underlying cause to me seems that the original intention was to transfer the pointers (hence the method's name) but that somehow got mangled with the transition from old List to ::std::vector --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -288,7 +288,7 @@ void BreakPointList::transfer(BreakPointList& rList) { reset(); for (size_t i = 0; i< rList.size(); ++i) -maBreakPoints.push_back( rList.at( i ) ); +maBreakPoints.push_back( new BreakPoint(*rList.at( i )) ); rList.reset(); } Instead of creating copies I'd do - rList.reset(); + rList.clear(); Please check if that fixes the problem. Eike That fixes the problem, and definitely looks like a cleaner solution. Do you create the patch or should I create a new one? I created and attached a patch for the pass count. Description: "Example: When entering pass count 2 it is expected that the breakpoint is passed two times before breaking not to break the second time." Thanks Niklas Johansson >From 5a7b0a951cd85f09d3de06e740e521f435d59b4d Mon Sep 17 00:00:00 2001 From: Niklas Johansson Date: Tue, 29 Nov 2011 09:32:14 +0100 Subject: [PATCH] Fixes pass count in Manage Breakpoints When entering pass count 2 it is expected that the breakpoint is passed two times before breaking not to break the second time. --- basctl/source/basicide/baside2.cxx |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index fb6ed3a..b826300 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -724,7 +724,7 @@ long ModulWindow::BasicBreakHdl( StarBASIC* pBasic ) if ( pBrk ) { pBrk->nHitCount++; -if ( pBrk->nHitCount < pBrk->nStopAfter && GetBasic()->IsBreak() ) +if ( pBrk->nHitCount <= pBrk->nStopAfter && GetBasic()->IsBreak() ) return aStatus.nBasicFlags; // go on... } -- 1.7.5.4 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] Fix for dialog Manage Breakpoints crash
Hi Niklas, On Monday, 2011-11-28 12:27:16 +0100, Niklas Johansson wrote: > In worst case it makes the program crash. This fix, stores > the values. I'm not that experienced with C++ so could someone have > a second look at this there might very well be a "cleaner" way of > writing it. Good find! I think I would do it slightly different, the patch fixes the symptom correctly by allocating new objects, but the underlying cause to me seems that the original intention was to transfer the pointers (hence the method's name) but that somehow got mangled with the transition from old List to ::std::vector > --- a/basctl/source/basicide/bastypes.cxx > +++ b/basctl/source/basicide/bastypes.cxx > @@ -288,7 +288,7 @@ void BreakPointList::transfer(BreakPointList & rList) > { > reset(); > for (size_t i = 0; i < rList.size(); ++i) > -maBreakPoints.push_back( rList.at( i ) ); > +maBreakPoints.push_back( new BreakPoint(*rList.at( i )) ); > rList.reset(); > } Instead of creating copies I'd do - rList.reset(); + rList.clear(); Please check if that fixes the problem. Eike -- LibreOffice Calc developer. Number formatter stricken i18n transpositionizer. GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3 9E96 2F1A D073 293C 05FD pgpffxBcuhXLL.pgp Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] Fix for dialog Manage Breakpoints crash
I started out trying to fix fdo 42778 and noticed that my initial description of the problem was a bit to narrow. It wasn't just the pass count that wasn't stored correctly but the breakpoints all together. In worst case it makes the program crash. This fix, stores the values. I'm not that experienced with C++ so could someone have a second look at this there might very well be a "cleaner" way of writing it. After building it with the fix, Manage Breakpoints works almost as expected on my machine. If you set the pass count to 1 it stops at the first 2 stops at the second. 1 should pass one and stop the second time. I'll try to fix this in another patch though. -- Niklas Johansson >From b8a0ad0320fb0e36276afae1e861b5da189153b6 Mon Sep 17 00:00:00 2001 From: Niklas Johansson Date: Mon, 28 Nov 2011 11:40:30 +0100 Subject: [PATCH] Fixes BreakPointManager Earlier when pressing ok in the breakpoint manager the breakpoints wasn't getting stored. The pointer address was stored but the breakpoint object was destroyed, leaving you with random values. --- basctl/source/basicide/bastypes.cxx |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index 10310ec..058e6ba 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -288,7 +288,7 @@ void BreakPointList::transfer(BreakPointList & rList) { reset(); for (size_t i = 0; i < rList.size(); ++i) -maBreakPoints.push_back( rList.at( i ) ); +maBreakPoints.push_back( new BreakPoint(*rList.at( i )) ); rList.reset(); } -- 1.7.5.4 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice