Hi list !
I'm trying to set a breakpoint in the function cssReader::parseFile() using gdb.
I've tried several’s ways to do that in gdb, including:
"break cssReader::parseFile"
then I read this ( http://stackoverflow.com/questions/6892395/set-breakpoint-for-class-member-f...) and tried:
"break org::w3c::dom::css::parseFile"
I also attempted to use the "file:line" method trying:
"break cssreader.cpp:1591" "break dom/cssreader.cpp:1591"
In the gdb documentation I was not able to find anything related to debugging class methods in C++. I didn't find any useful info in the inkscape debugging wiki page.
So anyone can point me the right way to do this ? Thank you.
On 25-9-2013 23:49, Guiu Rocafort wrote:
Hi list !
I'm trying to set a breakpoint in the function cssReader::parseFile() using gdb.
I've tried several’s ways to do that in gdb, including:
"break cssReader::parseFile"
then I read this ( http://stackoverflow.com/questions/6892395/set-breakpoint-for-class-member-f... ) and tried:
"break org::w3c::dom::css::parseFile"
I also attempted to use the "file:line" method trying:
"break cssreader.cpp:1591" "break dom/cssreader.cpp:1591"
In the gdb documentation I was not able to find anything related to debugging class methods in C++. I didn't find any useful info in the inkscape debugging wiki page.
So anyone can point me the right way to do this ? Thank you.
This may be completely wrong, but I remember vaguely that you have to put the method name between "", like:
break "cssReader::parseFile"
Use <TAB> ! Hope that helps, Johan
Hi,
I'm trying to set a breakpoint in the function cssReader::parseFile() using gdb.
I've tried several's ways to do that in gdb, including:
"break cssReader::parseFile"
For me this works perfectly:
markus@...3046...:~/Inkscape/cppify_build$ gdb src/inkscape GNU gdb (GDB) 7.5-ubuntu [...] Reading symbols from
/home/markus/Inkscape/cppify_build/src/inkscape...done.
(gdb) b dyna-draw-context.cpp:963 Breakpoint 1 at 0x4bd7e4: file ../../cppify/src/dyna-draw-context.cpp,
line 963.
(gdb) b SPRect::write Breakpoint 2 at 0x5d9a50: file ../../cppify/src/sp-rect.cpp, line 138. (gdb)
Does your inkscape executable contain debug symbols?
Regards, Markus
Hi,
I'm trying to set a breakpoint in the function cssReader::parseFile() using gdb.
I've tried several's ways to do that in gdb, including:
"break cssReader::parseFile"
For me this works perfectly:
markus@...3046...:~/Inkscape/cppify_build$ gdb src/inkscape GNU gdb (GDB) 7.5-ubuntu [...] Reading symbols from
/home/markus/Inkscape/cppify_build/src/inkscape...done.
(gdb) b dyna-draw-context.cpp:963 Breakpoint 1 at 0x4bd7e4: file ../../cppify/src/dyna-draw-context.cpp,
line 963.
(gdb) b SPRect::write Breakpoint 2 at 0x5d9a50: file ../../cppify/src/sp-rect.cpp, line 138. (gdb)
Does your inkscape executable contain debug symbols?
Regards, Markus
Try "objdump -t -C src/inkscape | less" and search for the cssreader. For me there are no symbols of it in the executable.
Hi !
The binary I'm using is a self-compiled Inkscape from the repository 0.49 trunk. I've checked the objdump ( thanks ! it's very useful ) command and I can see there are several symbols in the executable, but not the one I'm looking for. For instance the SPRect example works also for me.
But when I go to the compilation folder, I can see the cssreader.o file which means that it has been compiled. So I'm confused. Should I compile with some specific options or should the default ./configure and make approach work ?
Thank you guiu
On Thu, Sep 26, 2013 at 12:15 AM, Markus Engel <p637777@...1081...> wrote:
Hi,
I'm trying to set a breakpoint in the function cssReader::parseFile() using gdb.
I've tried several's ways to do that in gdb, including:
"break cssReader::parseFile"
For me this works perfectly:
markus@...3046...:~/Inkscape/cppify_build$ gdb src/inkscape GNU gdb (GDB) 7.5-ubuntu [...] Reading symbols from
/home/markus/Inkscape/cppify_build/src/inkscape...done.
(gdb) b dyna-draw-context.cpp:963 Breakpoint 1 at 0x4bd7e4: file ../../cppify/src/dyna-draw-context.cpp,
line 963.
(gdb) b SPRect::write Breakpoint 2 at 0x5d9a50: file ../../cppify/src/sp-rect.cpp, line 138. (gdb)
Does your inkscape executable contain debug symbols?
Regards, Markus
Try "objdump -t -C src/inkscape | less" and search for the cssreader. For me there are no symbols of it in the executable.
But when I go to the compilation folder, I can see the cssreader.o file which means that it has been compiled. So I'm confused. Should I compile with some specific options or should the default ./configure and make approach work ?
The object file is first stuffed into libdom.a in the same folder. If the function is never referenced, the linker won’t link it in. And Eclipse says there are no callers to this function, so this is probably the reason.
Regards,
Markus
On 09/25/2013 11:49 PM, Guiu Rocafort wrote:
Hi list !
I'm trying to set a breakpoint in the function cssReader::parseFile() using gdb.
I've tried several’s ways to do that in gdb, including:
"break cssReader::parseFile"
then I read this ( http://stackoverflow.com/questions/6892395/set-breakpoint-for-class-member-f...) and tried:
"break org::w3c::dom::css::parseFile"
I also attempted to use the "file:line" method trying:
"break cssreader.cpp:1591" "break dom/cssreader.cpp:1591"
In the gdb documentation I was not able to find anything related to debugging class methods in C++. I didn't find any useful info in the inkscape debugging wiki page.
So anyone can point me the right way to do this ? Thank you.
Two general debugging tips: 1) Disable optimization by changing all three occurrences of -O2 to -O0 and remove -DFORTIFY_SOURCE . 2) Use qtcreator. By creating a make-based project, you can use qtcreator as a very nice C++ debugging tool, including managing breakpoints and inspecting data via GUI.
Sebastian
On Thu, 2013-09-26 at 00:35 +0200, Sebastian Götte wrote:
- Use qtcreator. By creating a make-based project, you can use
qtcreator as a very nice C++ debugging tool, including managing breakpoints and inspecting data via GUI.
I was going to suggest using qtcreator as well. It's what I use when I need to actually do flow with gdb instead of just a backtrace which is quicker from the command line gdb.
I'm still not completely happy with it as it doesn't do yarning (and no tool I know of does, so I must have dreamed it) but it's decent for a basic debugger.
Martin,
On Sep 25, 2013, at 5:36 PM, Martin Owens wrote:
On Thu, 2013-09-26 at 00:35 +0200, Sebastian Götte wrote:
- Use qtcreator. By creating a make-based project, you can use
qtcreator as a very nice C++ debugging tool, including managing breakpoints and inspecting data via GUI.
I was going to suggest using qtcreator as well. It's what I use when I need to actually do flow with gdb instead of just a backtrace which is quicker from the command line gdb.
I'm still not completely happy with it as it doesn't do yarning (and no tool I know of does, so I must have dreamed it) but it's decent for a basic debugger.
Martin,
I'd also suggest looking into Emacs. It's a very good developer IDE.
To invoke the debugger in recent versions, I use M-x gud-gdb (the older bare 'gdb' might cause problems on Ubuntu, Debian, etc.).
Then to set a breakpoint I just have the cursor in the source file and hit Ctrl-x <space>. It also has a GUI toolbar if you like to use those, but the keyboard commands end up much quicker.
Eclipse for C++ is vastly more productive than emacs. And I was an emacs user for a decade before I switched.
njh
On Sun, Oct 13, 2013 at 01:17:53PM -0700, Jon Cruz wrote:
On Sep 25, 2013, at 5:36 PM, Martin Owens wrote:
On Thu, 2013-09-26 at 00:35 +0200, Sebastian G?tte wrote:
- Use qtcreator. By creating a make-based project, you can use
qtcreator as a very nice C++ debugging tool, including managing breakpoints and inspecting data via GUI.
I was going to suggest using qtcreator as well. It's what I use when I need to actually do flow with gdb instead of just a backtrace which is quicker from the command line gdb.
I'm still not completely happy with it as it doesn't do yarning (and no tool I know of does, so I must have dreamed it) but it's decent for a basic debugger.
Martin,
I'd also suggest looking into Emacs. It's a very good developer IDE.
To invoke the debugger in recent versions, I use M-x gud-gdb (the older bare 'gdb' might cause problems on Ubuntu, Debian, etc.).
Then to set a breakpoint I just have the cursor in the source file and hit Ctrl-x <space>. It also has a GUI toolbar if you like to use those, but the keyboard commands end up much quicker.
October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clk... _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Oct 13, 2013, at 2:39 PM, Nathan Hurst wrote:
Eclipse for C++ is vastly more productive than emacs. And I was an emacs user for a decade before I switched.
I use Eclipse heavily for Java and a few others for many years. But for C++ I've found Emacs to still be far more productive.
For ease of initial use Eclipse for C++ might not be bad. It's more when some of the more day-to-day in-depth use scenarios come up that i find it slows one down. I also had co-workers hit similar experiences last year.
So... for people looking out there, I'd say they should check out Emacs, Eclipse and QtCreator. Any one of those is probably better than bare gdb use.
participants (7)
-
Guiu Rocafort
-
Johan Engelen
-
Jon Cruz
-
Markus Engel
-
Martin Owens
-
Nathan Hurst
-
Sebastian Götte