+ struct exception_catchpoint *cp = (struct exception_catchpoint *) b;
+
+ return cp->kind;
+}
+
+/* Implement the 'check_status' method. */
+
+static void
+check_status_exception_catchpoint (struct bpstat *bs)
+{
+ struct exception_catchpoint *self
+ = (struct exception_catchpoint *) bs->breakpoint_at;
+ std::string type_name;
+
+ bkpt_breakpoint_ops.check_status (bs);
+ if (bs->stop == 0)
+ return;
+
+ if (self->pattern == NULL)
+ return;
+
+ const char *name = nullptr;
+ gdb::unique_xmalloc_ptr<char> canon;
+ try
+ {
+ struct value *typeinfo_arg;
+
+ fetch_probe_arguments (NULL, &typeinfo_arg);
+ type_name = cplus_typename_from_type_info (typeinfo_arg);
+
+ canon = cp_canonicalize_string (type_name.c_str ());
+ name = (canon != nullptr
+ ? canon.get ()
+ : type_name.c_str ());
+ }
+ catch (const gdb_exception_error &e)
+ {
+ exception_print (gdb_stderr, e);
+ }
+
+ if (name != nullptr)
+ {
+ if (self->pattern->exec (name, 0, NULL, 0) != 0)
+ bs->stop = 0;
+ }
+}
+
+/* Implement the 're_set' method. */
+
+static void
+re_set_exception_catchpoint (struct breakpoint *self)
+{
+ std::vector<symtab_and_line> sals;
+ enum exception_event_kind kind = classify_exception_breakpoint (self);
+ struct program_space *filter_pspace = current_program_space;
+
+ /* We first try to use the probe interface. */
+ try
+ {
+ event_location_up location
+ = new_probe_location (exception_functions[kind].probe);
+ sals = parse_probes (location.get (), filter_pspace, NULL);
+ }
+ catch (const gdb_exception_error &e)
+ {
+ /* Using the probe interface failed. Let's fallback to the normal
+ catchpoint mode. */
+ try
+ {
+ struct explicit_location explicit_loc;
+
+ initialize_explicit_location (&explicit_loc);
+ explicit_loc.function_name
+ = ASTRDUP (exception_functions[kind].function);
+ event_location_up location = new_explicit_location (&explicit_loc);
+ sals = self->ops->decode_location (self, location.get (),
+ filter_pspace);
+ }
+ catch (const gdb_exception_error &ex)
+ {
+ /* NOT_FOUND_ERROR just means the breakpoint will be
+ pending, so let it through. */
+ if (ex.error != NOT_FOUND_ERROR)
+ throw;
+ }
+ }
+
+ update_breakpoint_locations (self, filter_pspace, sals, {});