projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
write_pieced_value: Notify memory_changed observers
[deliverable/binutils-gdb.git]
/
gdb
/
break-catch-sig.c
diff --git
a/gdb/break-catch-sig.c
b/gdb/break-catch-sig.c
index 419d226bfffbc5a60a17a5e09e23ffdcc608ee5b..3eede930e4a07ae7e5a668505bbac1b101cfce12 100644
(file)
--- a/
gdb/break-catch-sig.c
+++ b/
gdb/break-catch-sig.c
@@
-1,6
+1,6
@@
/* Everything about signal catchpoints, for GDB.
/* Everything about signal catchpoints, for GDB.
- Copyright (C) 2011-201
5
Free Software Foundation, Inc.
+ Copyright (C) 2011-201
7
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-28,7
+28,8
@@
#include "valprint.h"
#include "cli/cli-utils.h"
#include "completer.h"
#include "valprint.h"
#include "cli/cli-utils.h"
#include "completer.h"
-#include "gdb_obstack.h"
+
+#include <string>
#define INTERNAL_SIGNAL(x) ((x) == GDB_SIGNAL_TRAP || (x) == GDB_SIGNAL_INT)
#define INTERNAL_SIGNAL(x) ((x) == GDB_SIGNAL_TRAP || (x) == GDB_SIGNAL_INT)
@@
-37,16
+38,12
@@
typedef enum gdb_signal gdb_signal_type;
DEF_VEC_I (gdb_signal_type);
/* An instance of this type is used to represent a signal catchpoint.
DEF_VEC_I (gdb_signal_type);
/* An instance of this type is used to represent a signal catchpoint.
- It includes a "struct breakpoint" as a kind of base class; users
- downcast to "struct breakpoint *" when needed. A breakpoint is
- really of this type iff its ops pointer points to
+ A breakpoint is really of this type iff its ops pointer points to
SIGNAL_CATCHPOINT_OPS. */
SIGNAL_CATCHPOINT_OPS. */
-struct signal_catchpoint
+struct signal_catchpoint
: public breakpoint
{
{
- /* The base class. */
-
- struct breakpoint base;
+ ~signal_catchpoint () override;
/* Signal numbers used for the 'catch signal' feature. If no signal
has been specified for filtering, its value is NULL. Otherwise,
/* Signal numbers used for the 'catch signal' feature. If no signal
has been specified for filtering, its value is NULL. Otherwise,
@@
-88,17
+85,11
@@
signal_to_name_or_int (enum gdb_signal sig)
\f
\f
-/* Implement the "dtor" breakpoint_ops method for signal
- catchpoints. */
+/* signal_catchpoint destructor. */
-static void
-signal_catchpoint_dtor (struct breakpoint *b)
+signal_catchpoint::~signal_catchpoint ()
{
{
- struct signal_catchpoint *c = (struct signal_catchpoint *) b;
-
- VEC_free (gdb_signal_type, c->signals_to_be_caught);
-
- base_breakpoint_ops.dtor (b);
+ VEC_free (gdb_signal_type, this->signals_to_be_caught);
}
/* Implement the "insert_location" breakpoint_ops method for signal
}
/* Implement the "insert_location" breakpoint_ops method for signal
@@
-107,7
+98,7
@@
signal_catchpoint_dtor (struct breakpoint *b)
static int
signal_catchpoint_insert_location (struct bp_location *bl)
{
static int
signal_catchpoint_insert_location (struct bp_location *bl)
{
- struct signal_catchpoint *c = (
void
*) bl->owner;
+ struct signal_catchpoint *c = (
struct signal_catchpoint
*) bl->owner;
int i;
if (c->signals_to_be_caught != NULL)
int i;
if (c->signals_to_be_caught != NULL)
@@
-137,9
+128,10
@@
signal_catchpoint_insert_location (struct bp_location *bl)
catchpoints. */
static int
catchpoints. */
static int
-signal_catchpoint_remove_location (struct bp_location *bl)
+signal_catchpoint_remove_location (struct bp_location *bl,
+ enum remove_bp_reason reason)
{
{
- struct signal_catchpoint *c = (
void
*) bl->owner;
+ struct signal_catchpoint *c = (
struct signal_catchpoint
*) bl->owner;
int i;
if (c->signals_to_be_caught != NULL)
int i;
if (c->signals_to_be_caught != NULL)
@@
-180,7
+172,8
@@
signal_catchpoint_breakpoint_hit (const struct bp_location *bl,
CORE_ADDR bp_addr,
const struct target_waitstatus *ws)
{
CORE_ADDR bp_addr,
const struct target_waitstatus *ws)
{
- const struct signal_catchpoint *c = (void *) bl->owner;
+ const struct signal_catchpoint *c
+ = (const struct signal_catchpoint *) bl->owner;
gdb_signal_type signal_number;
if (ws->kind != TARGET_WAITKIND_STOPPED)
gdb_signal_type signal_number;
if (ws->kind != TARGET_WAITKIND_STOPPED)
@@
-219,14
+212,16
@@
signal_catchpoint_print_it (bpstat bs)
ptid_t ptid;
struct target_waitstatus last;
const char *signal_name;
ptid_t ptid;
struct target_waitstatus last;
const char *signal_name;
+ struct ui_out *uiout = current_uiout;
get_last_target_status (&ptid, &last);
signal_name = signal_to_name_or_int (last.value.sig);
annotate_catchpoint (b->number);
get_last_target_status (&ptid, &last);
signal_name = signal_to_name_or_int (last.value.sig);
annotate_catchpoint (b->number);
+ maybe_print_thread_hit_breakpoint (uiout);
- printf_filtered (_("
\n
Catchpoint %d (signal %s), "), b->number, signal_name);
+ printf_filtered (_("Catchpoint %d (signal %s), "), b->number, signal_name);
return PRINT_SRC_AND_LOC;
}
return PRINT_SRC_AND_LOC;
}
@@
-238,7
+233,7
@@
static void
signal_catchpoint_print_one (struct breakpoint *b,
struct bp_location **last_loc)
{
signal_catchpoint_print_one (struct breakpoint *b,
struct bp_location **last_loc)
{
- struct signal_catchpoint *c = (
void
*) b;
+ struct signal_catchpoint *c = (
struct signal_catchpoint
*) b;
struct value_print_options opts;
struct ui_out *uiout = current_uiout;
struct value_print_options opts;
struct ui_out *uiout = current_uiout;
@@
-248,24
+243,20
@@
signal_catchpoint_print_one (struct breakpoint *b,
not line up too nicely with the headers, but the effect
is relatively readable). */
if (opts.addressprint)
not line up too nicely with the headers, but the effect
is relatively readable). */
if (opts.addressprint)
- ui
_out_field_skip (uiout,
"addr");
+ ui
out->field_skip (
"addr");
annotate_field (5);
if (c->signals_to_be_caught
&& VEC_length (gdb_signal_type, c->signals_to_be_caught) > 1)
annotate_field (5);
if (c->signals_to_be_caught
&& VEC_length (gdb_signal_type, c->signals_to_be_caught) > 1)
- ui
_out_text (uiout,
"signals \"");
+ ui
out->text (
"signals \"");
else
else
- ui
_out_text (uiout,
"signal \"");
+ ui
out->text (
"signal \"");
if (c->signals_to_be_caught)
{
int i;
gdb_signal_type iter;
if (c->signals_to_be_caught)
{
int i;
gdb_signal_type iter;
- struct obstack text;
- struct cleanup *cleanup;
-
- obstack_init (&text);
- cleanup = make_cleanup_obstack_free (&text);
+ std::string text;
for (i = 0;
VEC_iterate (gdb_signal_type, c->signals_to_be_caught, i, iter);
for (i = 0;
VEC_iterate (gdb_signal_type, c->signals_to_be_caught, i, iter);
@@
-274,20
+265,18
@@
signal_catchpoint_print_one (struct breakpoint *b,
const char *name = signal_to_name_or_int (iter);
if (i > 0)
const char *name = signal_to_name_or_int (iter);
if (i > 0)
-
obstack_grow (&text, " ", 1)
;
-
obstack_grow (&text, name, strlen (name))
;
+
text += " "
;
+
text += name
;
}
}
- obstack_grow (&text, "", 1);
- ui_out_field_string (uiout, "what", obstack_base (&text));
- do_cleanups (cleanup);
+ uiout->field_string ("what", text.c_str ());
}
else
}
else
- ui
_out_field_string (uiout,
"what",
+ ui
out->field_string (
"what",
c->catch_all ? "<any signal>" : "<standard signals>");
c->catch_all ? "<any signal>" : "<standard signals>");
- ui
_out_text (uiout,
"\" ");
+ ui
out->text (
"\" ");
- if (ui
_out_is_mi_like_p (uiout
))
- ui
_out_field_string (uiout,
"catch-type", "signal");
+ if (ui
out->is_mi_like_p (
))
+ ui
out->field_string (
"catch-type", "signal");
}
/* Implement the "print_mention" breakpoint_ops method for signal
}
/* Implement the "print_mention" breakpoint_ops method for signal
@@
-296,7
+285,7
@@
signal_catchpoint_print_one (struct breakpoint *b,
static void
signal_catchpoint_print_mention (struct breakpoint *b)
{
static void
signal_catchpoint_print_mention (struct breakpoint *b)
{
- struct signal_catchpoint *c = (
void
*) b;
+ struct signal_catchpoint *c = (
struct signal_catchpoint
*) b;
if (c->signals_to_be_caught)
{
if (c->signals_to_be_caught)
{
@@
-330,7
+319,7
@@
signal_catchpoint_print_mention (struct breakpoint *b)
static void
signal_catchpoint_print_recreate (struct breakpoint *b, struct ui_file *fp)
{
static void
signal_catchpoint_print_recreate (struct breakpoint *b, struct ui_file *fp)
{
- struct signal_catchpoint *c = (
void
*) b;
+ struct signal_catchpoint *c = (
struct signal_catchpoint
*) b;
fprintf_unfiltered (fp, "catch signal");
fprintf_unfiltered (fp, "catch signal");
@@
-372,12
+361,12
@@
create_signal_catchpoint (int tempflag, VEC (gdb_signal_type) *filter,
struct signal_catchpoint *c;
struct gdbarch *gdbarch = get_current_arch ();
struct signal_catchpoint *c;
struct gdbarch *gdbarch = get_current_arch ();
- c =
XNEW (struct signal_catchpoint
);
- init_catchpoint (
&c->base
, gdbarch, tempflag, NULL, &signal_catchpoint_ops);
+ c =
new signal_catchpoint (
);
+ init_catchpoint (
c
, gdbarch, tempflag, NULL, &signal_catchpoint_ops);
c->signals_to_be_caught = filter;
c->catch_all = catch_all;
c->signals_to_be_caught = filter;
c->catch_all = catch_all;
- install_breakpoint (0,
&c->base
, 1);
+ install_breakpoint (0,
c
, 1);
}
}
@@
-474,7
+463,6
@@
initialize_signal_catchpoint_ops (void)
ops = &signal_catchpoint_ops;
*ops = base_breakpoint_ops;
ops = &signal_catchpoint_ops;
*ops = base_breakpoint_ops;
- ops->dtor = signal_catchpoint_dtor;
ops->insert_location = signal_catchpoint_insert_location;
ops->remove_location = signal_catchpoint_remove_location;
ops->breakpoint_hit = signal_catchpoint_breakpoint_hit;
ops->insert_location = signal_catchpoint_insert_location;
ops->remove_location = signal_catchpoint_remove_location;
ops->breakpoint_hit = signal_catchpoint_breakpoint_hit;
This page took
0.027348 seconds
and
4
git commands to generate.