Remove debug_stack_frames

This was unused with FLOG. We leave the option stubbed out for now, so
we don't error out for well-meaning calls.
This commit is contained in:
Fabian Homborg 2020-11-15 11:32:52 +01:00
parent 95e86cf2d2
commit 9c2d22e452
6 changed files with 4 additions and 38 deletions

View file

@ -41,8 +41,6 @@ The following options are available:
- ``-v`` or ``--version`` display version and exit
- ``-D`` or ``--debug-stack-frames=DEBUG_LEVEL`` specify how many stack frames to display when debug messages are written. The default is zero. A value of 3 or 4 is usually sufficient to gain insight into how a given debug call was reached but you can specify a value up to 128.
- ``-f`` or ``--features=FEATURES`` enables one or more :ref:`feature flags <featureflags>` (separated by a comma). These are how fish stages changes that might break scripts.
The fish exit status is generally the :ref:`exit status of the last foreground command <variables-status>`.

View file

@ -32,6 +32,4 @@ The following options are available:
- ``-d`` or ``--debug-level=DEBUG_LEVEL`` enables debug output and specifies a verbosity level. Defaults to 0.
- ``-D`` or ``--debug-stack-frames=DEBUG_LEVEL`` specify how many stack frames to display when debug messages are written. The default is zero. A value of 3 or 4 is usually sufficient to gain insight into how a given debug call was reached but you can specify a value up to 128.
- ``--dump-parse-tree`` dumps information about the parsed statements to stderr. This is likely to be of interest only to people working on the fish source code.

View file

@ -87,10 +87,6 @@ bool g_profiling_active = false;
const wchar_t *program_name;
std::atomic<int> debug_level{1}; // default maximum debug output level (errors and warnings)
static relaxed_atomic_t<int> debug_stack_frames{0};
void set_debug_stack_frames(int v) { debug_stack_frames = v; }
int get_debug_stack_frames() { return debug_stack_frames; }
/// Be able to restore the term's foreground process group.
/// This is set during startup and not modified after.
static relaxed_atomic_t<pid_t> initial_fg_process_group{-1};

View file

@ -187,10 +187,6 @@ int get_omitted_newline_width();
/// Character used for the silent mode of the read command
wchar_t get_obfuscation_read_char();
/// How many stack frames to show when a debug() call is made.
int get_debug_stack_frames();
void set_debug_stack_frames(int);
/// Profiling flag. True if commands should be profiled.
extern bool g_profiling_active;

View file

@ -366,19 +366,8 @@ static int fish_parse_opt(int argc, char **argv, fish_cmd_opts_t *opts) {
exit(0);
}
case 'D': {
char *end;
long tmp;
errno = 0;
tmp = strtol(optarg, &end, 10);
if (tmp > 0 && tmp <= 128 && !*end && !errno) {
set_debug_stack_frames(static_cast<int>(tmp));
} else {
std::fwprintf(stderr, _(L"Invalid value '%s' for debug-stack-frames flag"),
optarg);
exit(1);
}
// TODO: Option is currently useless.
// Either remove it or make it work with FLOG.
break;
}
default: {

View file

@ -928,19 +928,8 @@ int main(int argc, char *argv[]) {
break;
}
case 'D': {
char *end;
long tmp;
errno = 0;
tmp = strtol(optarg, &end, 10);
if (tmp > 0 && tmp <= 128 && !*end && !errno) {
set_debug_stack_frames(static_cast<int>(tmp));
} else {
std::fwprintf(stderr, _(L"Invalid value '%s' for debug-stack-frames flag"),
optarg);
exit(1);
}
// TODO: Option is currently useless.
// Either remove it or make it work with FLOG.
break;
}
default: {