#include "common/array-view.h"
#include "common/gdb_optional.h"
-/* Enums for exception-handling support. */
-enum exception_event_kind
-{
- EX_EVENT_THROW,
- EX_EVENT_RETHROW,
- EX_EVENT_CATCH
-};
-
/* Prototypes for local functions. */
static void map_breakpoint_numbers (const char *,
xsnprintf (number, sizeof (number), "%d", b->number);
if (strncmp (number, text, len) == 0)
- {
- gdb::unique_xmalloc_ptr<char> copy (xstrdup (number));
- tracker.add_completion (std::move (copy));
- }
+ tracker.add_completion (make_unique_xstrdup (number));
}
return;
if (val)
bp_excpt = gdb_exception {RETURN_ERROR, GENERIC_ERROR};
}
- catch (const gdb_exception &e)
+ catch (gdb_exception &e)
{
- bp_excpt = e;
+ bp_excpt = std::move (e);
}
}
else
bp_excpt
= gdb_exception {RETURN_ERROR, GENERIC_ERROR};
}
- catch (const gdb_exception &e)
+ catch (gdb_exception &e)
{
- bp_excpt = e;
+ bp_excpt = std::move (e);
}
if (bp_excpt.reason != 0)
if (val)
bp_excpt = gdb_exception {RETURN_ERROR, GENERIC_ERROR};
}
- catch (const gdb_exception &e)
+ catch (gdb_exception &e)
{
- bp_excpt = e;
+ bp_excpt = std::move (e);
}
}
else
std::vector<probe *> exception_probes;
};
-static const struct objfile_data *breakpoint_objfile_key;
+static const struct objfile_key<breakpoint_objfile_data>
+ breakpoint_objfile_key;
/* Minimal symbol not found sentinel. */
static struct minimal_symbol msym_not_found;
{
struct breakpoint_objfile_data *bp_objfile_data;
- bp_objfile_data = ((struct breakpoint_objfile_data *)
- objfile_data (objfile, breakpoint_objfile_key));
+ bp_objfile_data = breakpoint_objfile_key.get (objfile);
if (bp_objfile_data == NULL)
- {
- bp_objfile_data = new breakpoint_objfile_data ();
- set_objfile_data (objfile, breakpoint_objfile_key, bp_objfile_data);
- }
+ bp_objfile_data = breakpoint_objfile_key.emplace (objfile);
return bp_objfile_data;
}
-static void
-free_breakpoint_objfile_data (struct objfile *obj, void *data)
-{
- struct breakpoint_objfile_data *bp_objfile_data
- = (struct breakpoint_objfile_data *) data;
-
- delete bp_objfile_data;
-}
-
static void
create_overlay_event_breakpoint (void)
{
}
}
+/* See breakpoint.h. */
+
+bool fix_multi_location_breakpoint_output_globally = false;
+
static void
print_one_breakpoint (struct breakpoint *b,
struct bp_location **last_loc,
int allflag)
{
struct ui_out *uiout = current_uiout;
- bool use_fixed_output = mi_multi_location_breakpoint_output_fixed (uiout);
+ bool use_fixed_output
+ = (uiout->test_flags (fix_multi_location_breakpoint_output)
+ || fix_multi_location_breakpoint_output_globally);
gdb::optional<ui_out_emit_tuple> bkpt_tuple_emitter (gdb::in_place, uiout, "bkpt");
print_one_breakpoint_location (b, NULL, 0, last_loc, allflag);
if (arg
&& (check_for_argument (&arg, "-location", sizeof ("-location") - 1)
|| check_for_argument (&arg, "-l", sizeof ("-l") - 1)))
- {
- arg = skip_spaces (arg);
- just_location = 1;
- }
+ just_location = 1;
watch_command_1 (arg, accessflag, from_tty, just_location, 0);
}
{
sals = b->ops->decode_location (b, location, search_pspace);
}
- catch (const gdb_exception_error &e)
+ catch (gdb_exception_error &e)
{
int not_found_and_ok = 0;
- exception = e;
-
/* For pending breakpoints, it's expected that parsing will
fail until the right shared library is loaded. User has
already told to create pending breakpoints and don't need
b->enable_state = bp_disabled;
throw;
}
+
+ exception = std::move (e);
}
if (exception.reason == 0 || exception.error != NOT_FOUND_ERROR)
classes. For Ada, this means in all packages. E.g., in C++,\n\
\"func()\" matches \"A::func()\", \"A::B::func()\", etc. The\n\
\"-qualified\" flag overrides this behavior, making GDB interpret the\n\
-specified name as a complete fully-qualified name instead.\n"
+specified name as a complete fully-qualified name instead."
/* This help string is used for the break, hbreak, tbreak and thbreak
commands. It is defined as a macro to prevent duplication.
\n\
THREADNUM is the number from \"info threads\".\n\
CONDITION is a boolean expression.\n\
-\n" LOCATION_HELP_STRING "\n\
+\n" LOCATION_HELP_STRING "\n\n\
Multiple breakpoints at one place are permitted, and useful if their\n\
conditions are different.\n\
\n\
gdb::observers::free_objfile.attach (disable_breakpoints_in_freed_objfile);
gdb::observers::memory_changed.attach (invalidate_bp_value_on_memory_change);
- breakpoint_objfile_key
- = register_objfile_data_with_cleanup (NULL, free_breakpoint_objfile_data);
-
breakpoint_chain = 0;
/* Don't bother to call set_breakpoint_count. $bpnum isn't useful
before a breakpoint is set. */
Enable some breakpoints.\n\
Give breakpoint numbers (separated by spaces) as arguments.\n\
This is used to cancel the effect of the \"disable\" command.\n\
-May be abbreviated to simply \"enable\".\n"),
+May be abbreviated to simply \"enable\"."),
&enablebreaklist, "enable breakpoints ", 1, &enablelist);
add_cmd ("once", no_class, enable_once_command, _("\
\n\
With no argument, clears all breakpoints in the line that the selected frame\n\
is executing in.\n"
-"\n" LOCATION_HELP_STRING "\n\
+"\n" LOCATION_HELP_STRING "\n\n\
See also the \"delete\" command which clears breakpoints by number."));
add_com_alias ("cl", "clear", class_breakpoint, 1);
by printing the $_sdata variable like any other convenience variable.\n\
\n\
CONDITION is a boolean expression.\n\
-\n" LOCATION_HELP_STRING "\n\
+\n" LOCATION_HELP_STRING "\n\n\
Multiple tracepoints at one place are permitted, and useful if their\n\
conditions are different.\n\
\n\