Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 04-26-2023, 11:48 PM   #1
darencainiao
Junior Member
darencainiao began at the beginning.
 
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?
darencainiao is offline   Reply With Quote
Old 04-27-2023, 12:03 AM   #2
darencainiao
Junior Member
darencainiao began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Apr 2023
Device: none
in windows
darencainiao is offline   Reply With Quote
Advert
Old 04-27-2023, 06:16 AM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
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.
DiapDealer is offline   Reply With Quote
Old 04-28-2023, 10:09 AM   #4
darencainiao
Junior Member
darencainiao began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Apr 2023
Device: none
Quote:
Originally Posted by DiapDealer View Post
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.
Thank you very much for your answer.
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?
darencainiao is offline   Reply With Quote
Old 04-28-2023, 10:59 AM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by darencainiao View Post
Is it using Qt's qDebug() function?
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:
Originally Posted by darencainiao View Post
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.
I personally find Visual Studio's IDE/debugger to be terribly confusing, bloated and nearly unusable. Plus, you need a Microsoft account to even open the IDE. So I don't use it.

Quote:
Originally Posted by darencainiao View Post
By the way, would it be better to debug sigil in Linux?
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.
DiapDealer is offline   Reply With Quote
Advert
Old 05-04-2023, 04:42 AM   #6
darencainiao
Junior Member
darencainiao began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Apr 2023
Device: none
Quote:
Originally Posted by DiapDealer View Post
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.


I personally find Visual Studio's IDE/debugger to be terribly confusing, bloated and nearly unusable. Plus, you need a Microsoft account to even open the IDE. So I don't use it.


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.
Thank you very much again for your reply.
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?
darencainiao is offline   Reply With Quote
Old 05-04-2023, 07:52 AM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
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.
DiapDealer is offline   Reply With Quote
Old 05-09-2023, 09:31 AM   #8
rkomar
Wizard
rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.
 
Posts: 2,986
Karma: 18343081
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.
rkomar is offline   Reply With Quote
Old 05-09-2023, 09:35 AM   #9
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
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.
DiapDealer is offline   Reply With Quote
Old 05-10-2023, 05:19 AM   #10
darencainiao
Junior Member
darencainiao began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Apr 2023
Device: none
Thank you for your answers
darencainiao is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 02:39 AM.


MobileRead.com is a privately owned, operated and funded community.