![]() |
#1 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Apr 2023
Device: none
|
How to debug or run Sigil's source code in VS2017
I am a graduate student.I want to learn the source code of sigil.
I have successfully built the installation package for sigil.Now,I want to debug sigil so that I can understand the source code in VS2017.But I failed. I download the source code of sigil from github and try to import it into VS2017 by import CMakeLists.But I don't know what to do next.What should I do afterwards? |
![]() |
![]() |
![]() |
#2 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Apr 2023
Device: none
|
in windows
|
![]() |
![]() |
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,340
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I don't use Visual Studio's IDE to build or debug Sigil's official Windows releases. I only use the command-line tools. I try to make sure that cmake can be used to generate VS IDE project files, but that's about it. Hopefully, someone who actually uses the IDE can offer some help.
|
![]() |
![]() |
![]() |
#4 | |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Apr 2023
Device: none
|
Quote:
I would also like to ask how do you debug sigil if you do not use Visual Studio's IDE? Is it using Qt's qDebug() function? As far as I know, references to classes in C++ is somewhat confusing, and it will be difficult to debug and find bug without step through in Visual Studio's IDE.By the way, would it be better to debug sigil in Linux? |
|
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,340
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
For quick stuff on Windows, yes. There's already a lot of debug information that that can output to a file (by putting a user-writable file path in the SIGIL_DEBUG_LOGFILE environment variable) and by setting any of the #define DBG if(0) directives found at the top of many files to #define DBG if(1). Any qDebug() statements you add will also be output to the log file defined by SIGIL_DEBUG_LOGFILE.
Quote:
For any kind breakpoint or backtrace work, yes. At least I find it to be better, anyway. Almost all of my development work on Sigil is done on Linux. I typically find that bugs/crashes in Windows Sigil will often be duplicated in Linux Sigil. The command-line debugging tools of Linux are infinitely more familiar/intuitive/simple for me. Another part of the problem is that Sigil on Windows will not run from its build location without a lot of extra wrangling. It needs to be installed because of its bundled Python dependencies. So running Sigil with the debugger and stepping in/out/through are problematic. Heck, just building a debug version of Sigil is difficult on Windows because of the embedded Python portions. It wants a debug version of Python as well. Last edited by DiapDealer; 04-28-2023 at 11:35 AM. |
|
![]() |
![]() |
![]() |
#6 | |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Apr 2023
Device: none
|
Quote:
A few days ago, I successfully built Sigil software in Ubuntu according to the method provided on Github.After successful built, I obtained a sigil software.But I still don't know how to debug sigil in linux right now.I see you mentioned earlier that The command line debugging tools of Linux.Can you explain this thing in detail?Forgive me for not being particularly familiar with Linux systems.Or is there a way to understand the source code of sigil without debugging it? |
|
![]() |
![]() |
![]() |
#7 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,340
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm not really the one for giving detailed instructions on using the Linux gdb command-line debugger. My teaching skills are not great. As for learning Sigil's code; everyone's different. There's no shortcut for getting your head wrapped around a million+ lines of code. You just need to dive in somewhere. I learned it in small chunks by studying the code in relation to a very particular aspect I wanted to change, or a very particular bug I wanted to locate/fix. Lots of individual little pictures, rather than trying to grasp the whole picture at once.
If you get lost looking for where something in particular happens in Sigil's code ... ask. Last edited by DiapDealer; 05-04-2023 at 03:58 PM. |
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,039
Karma: 18765433
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
ddd is a graphical front-end to gdb. I found it especially useful for visualizing the contents of structures. When you hover your mouse over a variable, it displays the value it contains in a popup. That really sped up visualizing the current state of the program for me. Of course, it also makes stepping, handling break points,... (the usual debugger stuff) more convenient than typing into the command line. It isn't an IDE, but it might be helpful to a linux debugging newbie.
|
![]() |
![]() |
![]() |
#9 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,340
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Thanks for the input! Not being a gdb guru myself, a graphical front-end might be useful to me as well. I'm OK with graphical "frontends" to individual tools. It's full-blown IDEs that I've learned to steer clear of.
|
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Apr 2023
Device: none
|
Thank you for your answers
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
source code of sigil | Aymen Boss | Sigil | 6 | 07-18-2018 11:51 PM |
Cannot run calibre-debug -g | Chaaang | Development | 6 | 05-26-2017 06:10 AM |
Run Calibre in Debug Mode Output to File | toomuchreading | Calibre | 1 | 03-07-2016 04:58 PM |
Preferences > Run in Debug Removed? | JimmXinu | Plugins | 3 | 09-07-2014 03:38 PM |
Let's create a source code repository for DR 800 related code? | jraf | iRex | 3 | 03-11-2010 12:26 PM |