+/* Parse the backtrace command's qualifiers. Returns ARG advanced
+ past the qualifiers, if any. BT_CMD_OPTS, if not null, is used to
+ store the parsed qualifiers. */
+
+static const char *
+parse_backtrace_qualifiers (const char *arg,
+ backtrace_cmd_options *bt_cmd_opts = nullptr)
+{
+ while (true)
+ {
+ const char *save_arg = arg;
+ std::string this_arg = extract_arg (&arg);
+
+ if (this_arg.empty ())
+ return arg;
+
+ if (subset_compare (this_arg.c_str (), "no-filters"))
+ {
+ if (bt_cmd_opts != nullptr)
+ bt_cmd_opts->no_filters = true;
+ }
+ else if (subset_compare (this_arg.c_str (), "full"))
+ {
+ if (bt_cmd_opts != nullptr)
+ bt_cmd_opts->full = true;
+ }
+ else if (subset_compare (this_arg.c_str (), "hide"))
+ {
+ if (bt_cmd_opts != nullptr)
+ bt_cmd_opts->hide = true;
+ }
+ else
+ {
+ /* Not a recognized qualifier, so stop. */
+ return save_arg;
+ }
+ }
+}
+