mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
Add commandline option for disabling stdout redirection (#2144)
* Add option for disabling stdout and stderr redirection. * Add command line option description to documentation.
This commit is contained in:
parent
4d2ef58e6a
commit
b69dff0fcd
@ -16,7 +16,7 @@ Compilation error
|
|||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
r_core development package not found
|
r_core development package not found
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
If you installed radare2 and still encounter this error, it could be that your
|
If you installed radare2 and still encounter this error, it could be that your
|
||||||
``PATH`` environment variable is set improperly (doesn’t contain
|
``PATH`` environment variable is set improperly (doesn’t contain
|
||||||
|
@ -11,5 +11,6 @@ Cutter is an advanced reverse engineering platform that is powered by radare2. T
|
|||||||
:titlesonly:
|
:titlesonly:
|
||||||
:glob:
|
:glob:
|
||||||
|
|
||||||
|
user-docs/command-line
|
||||||
user-docs/menus
|
user-docs/menus
|
||||||
|
|
||||||
|
63
docs/source/user-docs/command-line.rst
Normal file
63
docs/source/user-docs/command-line.rst
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
Command line options
|
||||||
|
====================
|
||||||
|
|
||||||
|
Synopsis
|
||||||
|
--------
|
||||||
|
|
||||||
|
**Cutter** [*options*] [<*filename*>]
|
||||||
|
|
||||||
|
|
||||||
|
Options
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. option:: <filename>
|
||||||
|
|
||||||
|
Filename to open. If not specified file selection dialog will be shown.
|
||||||
|
|
||||||
|
.. option:: -h, --help
|
||||||
|
|
||||||
|
Displays help on commandline options.
|
||||||
|
|
||||||
|
.. option:: --help-all
|
||||||
|
|
||||||
|
Displays help including Qt specific options.
|
||||||
|
|
||||||
|
.. option:: -v, --version
|
||||||
|
|
||||||
|
Displays version information.
|
||||||
|
|
||||||
|
.. option:: -A, --anal <level>
|
||||||
|
|
||||||
|
When opening a file automatically perform analysis at given level. Requires
|
||||||
|
:option:`<filename>` to be specified. Following levels are available:
|
||||||
|
|
||||||
|
**0**
|
||||||
|
No analysis.
|
||||||
|
|
||||||
|
**1**
|
||||||
|
aaa
|
||||||
|
|
||||||
|
**2**
|
||||||
|
aaaa (experimental)
|
||||||
|
|
||||||
|
.. option:: -F, --format <name>
|
||||||
|
|
||||||
|
Force using a specific file format (bin plugin)
|
||||||
|
|
||||||
|
.. option:: -B, --base <base address>
|
||||||
|
|
||||||
|
Load binary at a specific base address
|
||||||
|
|
||||||
|
.. option:: -i <file>
|
||||||
|
|
||||||
|
Run script file
|
||||||
|
|
||||||
|
.. option:: --pythonhome <PYTHONHOME>
|
||||||
|
|
||||||
|
PYTHONHOME to use for embedded python interpreter
|
||||||
|
|
||||||
|
.. option:: --no-output-redirect
|
||||||
|
|
||||||
|
Disable output redirection. Some of the output in console widget will not
|
||||||
|
be visible. Use this option when debuging a crash or freeze and output
|
||||||
|
redirection is causing some messages to be lost.
|
@ -99,6 +99,13 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
|
|||||||
"PYTHONHOME");
|
"PYTHONHOME");
|
||||||
cmd_parser.addOption(pythonHomeOption);
|
cmd_parser.addOption(pythonHomeOption);
|
||||||
|
|
||||||
|
QCommandLineOption disableRedirectOption("no-output-redirect",
|
||||||
|
QObject::tr("Disable output redirection."
|
||||||
|
" Some of the output in console widget will not be visible."
|
||||||
|
" Use this option when debuging a crash or freeze and output "
|
||||||
|
" redirection is causing some messages to be lost."));
|
||||||
|
cmd_parser.addOption(disableRedirectOption);
|
||||||
|
|
||||||
cmd_parser.process(*this);
|
cmd_parser.process(*this);
|
||||||
|
|
||||||
QStringList args = cmd_parser.positionalArguments();
|
QStringList args = cmd_parser.positionalArguments();
|
||||||
@ -137,6 +144,10 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
|
|||||||
Config()->loadInitial();
|
Config()->loadInitial();
|
||||||
Core()->loadCutterRC();
|
Core()->loadCutterRC();
|
||||||
|
|
||||||
|
if (cmd_parser.isSet(disableRedirectOption)) {
|
||||||
|
Config()->setOutputRedirectionEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
if (R2DecDecompiler::isAvailable()) {
|
if (R2DecDecompiler::isAvailable()) {
|
||||||
Core()->registerDecompiler(new R2DecDecompiler(Core()));
|
Core()->registerDecompiler(new R2DecDecompiler(Core()));
|
||||||
}
|
}
|
||||||
@ -367,4 +378,3 @@ void CutterProxyStyle::polish(QWidget *widget)
|
|||||||
}
|
}
|
||||||
#endif // QT_VERSION_CHECK(5, 10, 0) < QT_VERSION
|
#endif // QT_VERSION_CHECK(5, 10, 0) < QT_VERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -728,3 +728,13 @@ void Configuration::setBitmapExportScaleFactor(double inputValueGraph)
|
|||||||
s.setValue("bitmapGraphExportScale", inputValueGraph);
|
s.setValue("bitmapGraphExportScale", inputValueGraph);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Configuration::setOutputRedirectionEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
this->outputRedirectEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Configuration::getOutputRedirectionEnabled() const
|
||||||
|
{
|
||||||
|
return outputRedirectEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ private:
|
|||||||
#ifdef CUTTER_ENABLE_KSYNTAXHIGHLIGHTING
|
#ifdef CUTTER_ENABLE_KSYNTAXHIGHLIGHTING
|
||||||
KSyntaxHighlighting::Repository *kSyntaxHighlightingRepository;
|
KSyntaxHighlighting::Repository *kSyntaxHighlightingRepository;
|
||||||
#endif
|
#endif
|
||||||
|
bool outputRedirectEnabled = true;
|
||||||
|
|
||||||
// Colors
|
// Colors
|
||||||
void loadBaseThemeNative();
|
void loadBaseThemeNative();
|
||||||
@ -181,6 +182,15 @@ public:
|
|||||||
void setBitmapTransparentState(bool inputValueGraph);
|
void setBitmapTransparentState(bool inputValueGraph);
|
||||||
void setBitmapExportScaleFactor(double inputValueGraph);
|
void setBitmapExportScaleFactor(double inputValueGraph);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable or disable Cutter output redirection.
|
||||||
|
* Output redirection state can only be changed early during Cutter initalization.
|
||||||
|
* Changing it later will have no effect
|
||||||
|
* @param enabled set this to false for disabling output redirection
|
||||||
|
*/
|
||||||
|
void setOutputRedirectionEnabled(bool enabled);
|
||||||
|
bool getOutputRedirectionEnabled() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void refreshFont();
|
void refreshFont();
|
||||||
signals:
|
signals:
|
||||||
|
@ -128,8 +128,10 @@ ConsoleWidget::ConsoleWidget(MainWindow *main, QAction *action) :
|
|||||||
|
|
||||||
completer->popup()->installEventFilter(this);
|
completer->popup()->installEventFilter(this);
|
||||||
|
|
||||||
|
if (Config()->getOutputRedirectionEnabled()) {
|
||||||
redirectOutput();
|
redirectOutput();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ConsoleWidget::~ConsoleWidget()
|
ConsoleWidget::~ConsoleWidget()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user