Re: [Inkscape-devel] How debug you under windows?

Are there any way for debug inkscape under WinXP with a IDE integrated debugger (e.g. DevC++, Code::Blocks, Eclipse/CDT or MS Visual C++)? How debug you under windows?
Today I was working on getting set up for my SoC bug fixes, and I wanted to figure out the same thing. So far, Eclipse/CDT is looking promising. I can get it to build within in Eclipse, as well as run/debug. There is an error when the program starts in debug, but I continued and it seemed to start ok. Will be testing now whether debugging actually works. Using Eclipse requires a bit of massaging which I can hopefully help you figure out once I have it all working.
Gail

For the last two weeks now, I have been uploading the builds here with full debug:
http://inkscape.modevia.com/win32
Notice that for each *.7z there is a separate *-dbg.7z with the corresponding symbol file. This will avoid the backtrace lines with only () as the line info that you have been seeing. If you run it with command-line gdb, the command would be:
gdb inkscape.exe -symbols=inkscape.dbg or gdb inkscape.exe -s inkscape.dbg
bob
Gail Banaszkiewicz wrote:
Are there any way for debug inkscape under WinXP with a IDE integrated debugger (e.g. DevC++, Code::Blocks, Eclipse/CDT or MS Visual C++)? How debug you under windows?
Today I was working on getting set up for my SoC bug fixes, and I wanted to figure out the same thing. So far, Eclipse/CDT is looking promising. I can get it to build within in Eclipse, as well as run/debug. There is an error when the program starts in debug, but I continued and it seemed to start ok. Will be testing now whether debugging actually works. Using Eclipse requires a bit of massaging which I can hopefully help you figure out once I have it all working.
Gail

Bob Jamison wrote:
Notice that for each *.7z there is a separate *-dbg.7z with the corresponding symbol file.
Looks like the inkscape.dbg file is built anyway with everything else (this is good). However, I was not making any use of it - I will need to add to the gbd arguments. Thanks for the tip!
Gail

Gail Banaszkiewicz wrote:
corresponding symbol file.
Looks like the inkscape.dbg file is built anyway with everything else (this is good). However, I was not making any use of it - I will need to add to the gbd arguments.
Yes, but the build.xml file in SVN does not have -g set, for compile speed. So the .dbg is likely empty.
If building yourself, you will need to add the flag to <flags> and to a clean build.
bob

Saturday, March 24, 2007, 12:18:41 AM, Gail wrote:
Today I was working on getting set up for my SoC bug fixes, and I wanted to figure out the same thing. So far, Eclipse/CDT is looking promising. I can get it to build within in Eclipse, as well as run/debug.
I follow you, and install Eclipse/CDT. After a sleepless night, I cannot report a success :-(. At the moment, my goal is only the debugging. The bulid come later. So I use the build snapshot from http://inkscape.modevia.com/win32. Thanks to Bob Jamison!
---------------------------------------------------------------------- @Bob: I wonder that the link from http://wiki.inkscape.org/wiki/index.php/Win32Port to the gtk libraries no longer work. I use now gtk210-070110.7z.
By the way, the link from http://inkscape.modevia.com/win32libs/ labeled "here" to http://inkscape.org/win32/win32buildnotes.html is broken (maybe temporarily or outdated).
@? Another trivia: The build.xml has on line 391 two syntax errors (wrong blanks): < include name="inkviewres.o"/ > ^ ^ The btool.exe tolerated this, but all my XML editors and the browser (e.g. Firefox) show only the errors.
--------------------------------------------------------------------- @all, return to the subject: Here is what I did: - Unpack Inkscape0703232054.7z and Inkscape0703232054-dbg.7z into the same directory (R:\a\svn\inkscape). - In Eclipse File|Import... -- Select site choose C/C++ | Executable click Next Button -- Import Executable site Select binary parser: PE Windows Parser Select executable: R:\a\svn\inkscape\inkscape.exe click Next Button -- Choose Project New project name: Debug inkscape.exe Create a Launch Configuration: C/C++ Local Application Name:Debug inkscape.exe click Finish Button - In Debug Dialog click Debug Button A error occurs: Error stopping at main. Reason: Target request failed: No symbol table is loaded. Use the "file" command.. Continue? I think this is the error what Gail see too. First I have try to add inkscape.dbg file to the project: - In Eclipse File|Import... -- Select site choose General | File System click Next Button -- Import site From Directory: R:\a\svn\inkscape file list: select inkscape.dbg
Inkscape.dbg is now in the project, but the error still occurs. Next, I go to Run|Debug...|Debug-tab |input field "GDB command file:" and change the text from ".gdbinit" to ".gdbinit -s inkscape.dbg". After that, the debugger start without a error message, but stop not at main. The option "Stop on startup at: main" is checked. I think that the symbol table is not set correct. If I expand the inkscape.dbg project entry, I see a long list of source files. Each has a "Expand Plus" [+], but this disappears if I click on it. All files that not in the working directory has a absolut path. These are wrong, e.g.: /home/rjamison/gcc/gcc-4.1.2/gcc/unwind-pe.h R:/libstdc++-v3/src/list.cc
The relativ paths are correct e.g.: src/desktop.h
Next, I did checkout from Subversion: svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape Revision 14596
Then I edit the build.xml, set FLAGS to -Wall -O0 -g -mms-bitfields
and build from the command line. The build works, but if I start the debugger in eclipse, the above error occurs once again.
Now I'm helpless, has someone a hint for me? Bernd

I intend to write a Wiki page about setting up Eclipse/CDT. It may be a few days because I am crunching at the end of my school semester.
The thing I had the hardest time with was debugging because I could not get gdb to load the symbol file. Having the symbols directly in the exe solved that. What did you do to get it to work? (Alternatives are always good for the Wiki page.)
To build, you can just have btool run inside eclipse. The console will capture the output. However, you cannot click the error and go to that place in the source. So you don't gain much as opposed to building on the command line. It's just a bit more automated. Did you manage to build on the command line?
Bernd Derer wrote:
I follow you, and install Eclipse/CDT. After a sleepless night, I cannot report a success :-(. At the moment, my goal is only the debugging. The bulid come later. So I use the build snapshot

Later in your email you said that you did manage to build... so for debugging, add -g for the flags, and change strip=true to strip=false...
Gail Banaszkiewicz wrote:
Did you manage to build on the command line?
Bernd Derer wrote:
I follow you, and install Eclipse/CDT. After a sleepless night, I cannot report a success :-(. At the moment, my goal is only the debugging. The bulid come later. So I use the build snapshot

I'm sorry, due to inattention I did send my last Email only to Gail.
Gail Banaszkiewicz wrote: The thing I had the hardest time with was debugging because I could not get gdb to load the symbol file. Having the symbols directly in the exe solved that. What did you do to get it to work? (Alternatives are always good for the Wiki page.)
I'm very far to bring it to work, yet :-(. But if I, then I will documented it for the community.
To build, you can just have btool run inside eclipse. The console will capture the output. However, you cannot click the error and go to that place in the source. So you don't gain much as opposed to building on the command line. It's just a bit more automated. Did you manage to build on the command line?
Yes, I have build on the command line. The project handling in eclipse looks very strange for me. I don't know how I can integrating btool into eclipse. But the command line build work fine, so I can live with it. My goal is that I can debug inkscape with full source code support.
Later in your email you said that you did manage to build... so for debugging, add -g for the flags, and change strip=true to strip=false...
I have change strip=true to strip=false in the build.xml. Now the size of inkscape.exe is 212.158.983Byte. The debugger run and stop at src\main.cpp:388. So far, so good. But where is the source code? The "Disassembly" window show only this:
<source line is not available> 0x00403f90 <main>: lea 0x4(%esp),%ecx 0x00403f94 <main+4>: and $0xfffffff0,%esp 0x00403f97 <main+7>: pushl 0xfffffffc(%ecx) 0x00403f9a <main+10>: push %ebp 0x00403f9b <main+11>: mov %esp,%ebp 0x00403f9d <main+13>: push %edi . . . Why "<source line is not available>"?????? And where is the source code editor? Damn it! Sorry, it's very frustrating for me and it's 01:30 in the night. I think, it's time to go sleep.
Gail Banaszkiewicz wrote: A message for when you wake up then :) (Also, I had a HECK of a time getting it all to work too, so I feel your pain - sorry I wasn't able to save you from it.)
Oh, you give me the feeling that I'm not alone. That is very nice. I must thank you. Your hints were helpfully for me.
Ok, so I think your problem probably has to do with setting up "search paths." In the debug configuration window (I'm using "C/C++ Local Application"), go to the "Source" tab. Add the inkscape\src folder. Hopefully that should do it.
Yes,I think too. I have try it. But if I enter e.g. R:\a\svn\inkscape\src I couldn't believe my eyes, Eclipse write out: --8<------------------------- Warning: /a/svn/eclipse/InkscapeDbg;R: No such file or directory. Warning: /a/svn/inkscape/src;R: No such file or directory. Warning: R:\svn\eclipse\InkscapeDbg/R: No such file or directory. --8<------------------------- Crazy, isn't it? "R:\a\svn\eclipse" is my workspace and "InkscapeDbg" the project name.
Sounds like I should write that Wiki page sooner rather than later :) Just have to get past crunch time since classes are over next week and there's lots to do.
I wish you a successful next week. Don't let me keep you. It's springtime and in my garden wait a great pile of work for me.
See you later Bernd

I get the exact same kind of thing! I haven't sorted out why yet, but it doesn't seem to actually matter (these messages are coming from gdb). Debugging does work despite these printouts.
Gail
Bernd Derer wrote:
Yes,I think too. I have try it. But if I enter e.g. R:\a\svn\inkscape\src I couldn't believe my eyes, Eclipse write out: --8<------------------------- Warning: /a/svn/eclipse/InkscapeDbg;R: No such file or directory. Warning: /a/svn/inkscape/src;R: No such file or directory. Warning: R:\svn\eclipse\InkscapeDbg/R: No such file or directory. --8<------------------------- Crazy, isn't it? "R:\a\svn\eclipse" is my workspace and "InkscapeDbg" the project name.

Hello Gail,
I get the exact same kind of thing! I haven't sorted out why yet, but it doesn't seem to actually matter (these messages are coming from gdb). Debugging does work despite these printouts.
Here I can debug without source code only. This is not practicable for me. Maybe I'm too wimpy, it seems that everybody else here hacking on the command line.
I have make screen shots: http://www.aha-poster.de/download/eclipse.html It is for information only, don't think that I await your reply. I know you are busy. I have still a few ideas that I can try out, but less time too. Next, I will try out the Code::Blocks C++ IDE http://www.codeblocks.org/. I hope with more success.
Bernd

On Mar 28, 2007, at 12:00 PM, Gail Banaszkiewicz wrote:
To build, you can just have btool run inside eclipse. The console will capture the output. However, you cannot click the error and go to that place in the source. So you don't gain much as opposed to building on the command line. It's just a bit more automated. Did you manage to build on the command line?
I think this might be a general Emacs issue that has known solutions.
First, instead of clicking did you try using the keyboard to move the cursor to the error and then hit <enter> or Did you hit Ctrl-X ` (control-x and then the backwards single slash usually under the tilde) to have emacs find the first error/warning?
In general those will only fail if Emacs is not sure of the base source location. To fix that you can either configure Emacs to look in the src directory, *or* you can just start the build by basing it on src/Makefile. (that's usually what I do)
participants (4)
-
Bernd Derer
-
Bob Jamison
-
Gail Banaszkiewicz
-
Jon A. Cruz