goldshtn / msos

Command-line environment a-la WinDbg for executing SOS commands without having SOS available.
Other
96 stars 21 forks source link

.echo/comment command? #60

Closed stej closed 7 years ago

stej commented 7 years ago

I'm trying to create some file with commands for initiali analysis of a dump file. Right now everything is nice and clear, but I can imagine that after a month, I will have tough time to figure out what this "hq" command actually shows.

Did you consider to add .echo command? Or maybe better just a possibility to ignore a command in a file (when using -i switch)? Or anything that will help to document the script better for me or other person.

goldshtn commented 7 years ago

Sounds like a good idea, to add something like comments and echos. Would you like to try it and submit a PR? .echo would basically involve adding a very simple ICommand implementation, whereas comment lines would require a minor change in the parser.

stej commented 7 years ago

For now I think comments would be more useful. Single line might be quite easy I think. As for multiline - according to http://windbg.info/doc/1-common-cmds.html (yes, first link in google search), there is no multiline comment, so I would implement only single line comment. Is * characater ok? (as start of comment, ending with the line end)

stej commented 7 years ago

If there is possibility to comment, then .echo command doesn't make sense to me. In windbg it's possible to echo in for cycle, but msos doesn't support for, right? Also .echo in script is better to replace with comment..

stej commented 7 years ago

Ok, just found out that comments are already supported :) https://github.com/goldshtn/msos/blob/master/msos/CommandExecutionContext.cs#L90

goldshtn commented 7 years ago

Well there you go :)