usage of debug (-d) command line option
Hi,
Running MusesScore with the debug option, does enable a logfile in any folder, or a trace? (Windows platform, 2.2.1)
Hi,
Running MusesScore with the debug option, does enable a logfile in any folder, or a trace? (Windows platform, 2.2.1)
Do you still have an unanswered question? Please log in first to post your question.
Comments
AFAIK on Windows it does nothing, unless it is a debug build, like all the development builds. On other platforms it writes to stdout/stderr, i.e. to the terminal that started the process
In reply to AFAIK on Windows it does… by Jojo-Schmitz
Ok. Thanks Jojo
In reply to Ok. Thanks Jojo by mdi1972
I've now mentioned this restriction in the handbook
In reply to I've now mentioned this… by Jojo-Schmitz
Ok thanks Jojo. I tested yesterday with the latest 2.2.1 nightly (https://ftp.osuosl.org/pub/musescore-nightlies/windows/MuseScoreNightly…) and unfortunately it did the same (no debug output in the command window from which I started musescore with the flag)
Peeking around, I've found a comment in a recent issue by lasconic (https://musescore.org/en/node/197716#comment-758636) related to the flag usage, then another comment by a user who tested the problem in the issue (https://musescore.org/en/node/197716#comment-781411) , so it appears to me that, anyway, unless a developer intentionally decides to include a debug output in dev builds for Windows, no message or output would appear (but maybe I'm wrong)
It's a pity for me, I would like to do a stress test on a computer with Windows & MuseScore opened (with a score) , leaving it opened for days (would like to reproduce by myself the issue about zero-filled scores). I don't have acces to a Linux right now
In reply to I tested yesterday with the… by mdi1972
It is only released versions (for Windows) that can't do this, for those development builds it should work though, try
debugMode.bat
in thespecial
folder.But indeed it only gives output if a developer put it there.
In reply to For those development builds… by Jojo-Schmitz
oh, thanks Jojo! I'll use that
In reply to oh, thanks Jojo! I'll use… by mdi1972
Actually, there is a way to see the debug output from the released version even under Windows: you could use DebugView https://docs.microsoft.com/en-us/sysinternals/downloads/debugview
Steps:
- unpack the debugview zip archive
- launch Dbgview.exe (and accept the agreement)
- launch "Musescore.exe -d" from a command line
The debug output is shown in DebugView window (not in Windows terminal).
Ciao,
ABL
In reply to Actually, there is a way to… by ABL
Good stuff! Worth being mentioned in the handbook?
Probably not, more something for the developers' handbook I guess
In reply to Good stuff! Worth being… by Jojo-Schmitz
For sure, if you can mention it in the Developer handbook, it would be great.
In reply to Actually, there is a way to… by ABL
Great many thanks, @ABL!
Jojo, I had to modify debugMode.bat this way, so that the cmd window don't closes when the UI of MuseScore starts:
@echo on
start /WAIT ../bin/nightly.exe -d
In reply to Great many thanks, @ABL!… by mdi1972
That
@echo on
is not really needed, right?Actually I can't get any output using your modifications to the bat file
I'm not sure anymore whether -d really adds more output or is just visible in the UI.
Do you see a difference with and without -d in that DebugView?
In reply to That @echo on is not really… by Jojo-Schmitz
Hi Jojo, sorry the delay..
-@echo on , no, that's not neccesary , your right. The start /wait keeps opened the cmd window , thats the real change.
I see no output at all in the DOS cmd window opened this way, using -d and (for the moment) the 2.2.1 nightly.
-No, I just started nightly.exe without -d , looked into DebugView, and for me it seems exactly the sames messages.
In reply to Hi Jojo, sorry the delay… by mdi1972
OK, so I've removed the remark that -d doesn't work for Windows from the handbook.
And no need to gat that bat file changed, as it doesn't produce output anyway
In reply to OK, so I've removed the… by Jojo-Schmitz
Yes, to summarize::
Running nightly.exe -d , the cmd window don't print nothing at any moment.
Running nightly.exe -d, and checking DebugView: we can see messages in DebugView (as the one attachment I put above), kinda internal or debug messages.
Running nightly.exe without -d , and checking DebugView: I see in DebugView exactly the same internal/debug messages as above (in DebugView)
But yes, In no case I can see any messages in the cmdline DOS window opened by debugMode.bat.
In reply to Yes, to summarize::… by mdi1972
-d should make the log more verbose.
In reply to -d should make the log more… by [DELETED] 5
Hi Nicholas, you're right. It's strange. I'm doing a debug in a Windows 8 computer (yesterday my tries were in a Windows 10) via DebugView now of the latest 2.2.1 nightly, and yes, executed without -d , there are no debug output at all.
Using -d, well, the output is very voluminous, even without doing absolutely nothing in the UI, the vast majority of messages captured are related to (I guess) measure calculations/redraws. I'm attaching here just for reference a capture. Just opened a score, moved one note up/down, the saved the score. The save score only emits for this debug one line... I was interested to see how it traversed savefile()->saveCompressedFile, etc...that level seems to be not debugged, it emits just a "MuseScore::cmd " line in DebugView.
That's via DebugView, the console (cmd window, I altered as said yesterday the .bat to do a start /WAIT) don't prints nothing.
Just curious. In the case of a crash, given this devel build MuseScore is running with -d so capturing the obove activity, a full stack walk would be captured (in DebugView)?
In reply to Hi Nicholas, you're right… by mdi1972
I don't think you'd get a stack trace that way, for this you'd need to run it in a debugger
In reply to I don't think you'd get a… by Jojo-Schmitz
Which debugger are you using? sorry the ignorance here. I used Visual Studio years ago, but for min-gw..??
In reply to Which debugger are you using… by mdi1972
Whatever comes with QtCreator, maybe gdb?
In reply to Whatever comes with… by Jojo-Schmitz
ah, ok. I didn't used QTcreator ... an old plain make/cmake. Well, OK
In reply to Actually, there is a way to… by ABL
DebugView works great, attached a sample!!! many thanks, again!