GDB (xrefs)

Classes | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/break-catch-throw.c File Reference
`#include "defs.h"`
`#include "arch-utils.h"`
`#include <ctype.h>`
`#include "breakpoint.h"`
`#include "gdbcmd.h"`
`#include "inferior.h"`
`#include "annotate.h"`
`#include "valprint.h"`
`#include "cli/cli-utils.h"`
`#include "completer.h"`
`#include "gdb_obstack.h"`
`#include "mi/mi-common.h"`
`#include "linespec.h"`
`#include "probe.h"`
`#include "objfiles.h"`
`#include "cp-abi.h"`
`#include "gdb_regex.h"`
`#include "cp-support.h"`
`#include "location.h"`

Go to the source code of this file.

## Classes
struct | exception_names
struct | exception_catchpoint

## Enumerations
enum | exception_event_kind { EX_EVENT_THROW, EX_EVENT_RETHROW, EX_EVENT_CATCH, EX_EVENT_THROW, EX_EVENT_RETHROW, EX_EVENT_CATCH }

## Functions
static void | fetch_probe_arguments (struct value **arg0, struct value **arg1)
static enum exception_event_kind | classify_exception_breakpoint (struct breakpoint *b)
static void | check_status_exception_catchpoint (struct bpstats *bs)
static void | re_set_exception_catchpoint (struct breakpoint *self)
static enum print_stop_action | print_it_exception_catchpoint (bpstat bs)
static void | print_one_exception_catchpoint (struct breakpoint *b, struct bp_location **last_loc)
static void | print_one_detail_exception_catchpoint (const struct breakpoint *b, struct ui_out *uiout)
static void | print_mention_exception_catchpoint (struct breakpoint *b)
static void | print_recreate_exception_catchpoint (struct breakpoint *b, struct ui_file *fp)
static void | handle_gnu_v3_exceptions (int tempflag, std::string &&except_rx, const char *cond_string, enum exception_event_kind ex_event, int from_tty)
static std::string | extract_exception_regexp (const char **string)
static void | catch_exception_command_1 (enum exception_event_kind ex_event, const char *arg, int tempflag, int from_tty)
static void | catch_catch_command (const char *arg, int from_tty, struct cmd_list_element *command)
static void | catch_throw_command (const char *arg, int from_tty, struct cmd_list_element *command)
static void | catch_rethrow_command (const char *arg, int from_tty, struct cmd_list_element *command)
static struct value * | compute_exception (struct gdbarch *argc, struct internalvar *var, void *ignore)
static void | initialize_throw_catchpoint_ops (void)
void | _initialize_break_catch_throw (void)

## Variables
static const struct exception_names | exception_functions []
static struct breakpoint_ops | gnu_v3_exception_catchpoint_ops
static const struct internalvar_funcs | exception_funcs

## Enumeration Type Documentation

## ◆ exception_event_kind

enum exception_event_kind

Enumerator
EX_EVENT_THROW |
EX_EVENT_RETHROW |
EX_EVENT_CATCH |
EX_EVENT_THROW |
EX_EVENT_RETHROW |
EX_EVENT_CATCH |

Definition at line 41 of file break-catch-throw.c.

## Function Documentation

## ◆ _initialize_break_catch_throw()

void _initialize_break_catch_throw | ( | void |  | ) |

Definition at line 542 of file break-catch-throw.c.

References _, add_catch_command(), catch_catch_command(), CATCH_PERMANENT, catch_rethrow_command(), CATCH_TEMPORARY, catch_throw_command(), create_internalvar_type_lazy(), exception_funcs, and initialize_throw_catchpoint_ops().

## ◆ catch_catch_command()

static void catch_catch_command | ( | const char * | arg,
|  | int | from_tty,
|  | struct cmd_list_element * | command
| ) |  |
| static

Definition at line 461 of file break-catch-throw.c.

References catch_exception_command_1(), CATCH_TEMPORARY, EX_EVENT_CATCH, and get_cmd_context().

Referenced by _initialize_break_catch_throw().

## ◆ catch_exception_command_1()

static void catch_exception_command_1 | ( | enum exception_event_kind | ex_event,
|  | const char * | arg,
|  | int | tempflag,
|  | int | from_tty
| ) |  |
| static

Definition at line 432 of file break-catch-throw.c.

References _, ep_parse_optional_if_clause(), error(), EX_EVENT_CATCH, EX_EVENT_RETHROW, EX_EVENT_THROW, extract_exception_regexp(), handle_gnu_v3_exceptions(), skip_spaces(), and string.

Referenced by catch_catch_command(), catch_rethrow_command(), and catch_throw_command().

## ◆ catch_rethrow_command()

static void catch_rethrow_command | ( | const char * | arg,
|  | int | from_tty,
|  | struct cmd_list_element * | command
| ) |  |
| static

Definition at line 483 of file break-catch-throw.c.

References catch_exception_command_1(), CATCH_TEMPORARY, EX_EVENT_RETHROW, and get_cmd_context().

Referenced by _initialize_break_catch_throw().

## ◆ catch_throw_command()

static void catch_throw_command | ( | const char * | arg,
|  | int | from_tty,
|  | struct cmd_list_element * | command
| ) |  |
| static

Definition at line 472 of file break-catch-throw.c.

References catch_exception_command_1(), CATCH_TEMPORARY, EX_EVENT_THROW, and get_cmd_context().

Referenced by _initialize_break_catch_throw().

## ◆ check_status_exception_catchpoint()

static void check_status_exception_catchpoint | ( | struct bpstats * | bs | ) |
| static

Definition at line 144 of file break-catch-throw.c.

References bkpt_breakpoint_ops, bpstats::breakpoint_at, CATCH, breakpoint_ops::check_status, cp_canonicalize_string(), cplus_typename_from_type_info(), END_CATCH, exception_print(), fetch_probe_arguments(), gdb_stderr, RETURN_MASK_ERROR, bpstats::stop, string, and TRY.

Referenced by initialize_throw_catchpoint_ops().

## ◆ classify_exception_breakpoint()

static enum exception_event_kind classify_exception_breakpoint | ( | struct breakpoint * | b | ) |
| static

Definition at line 134 of file break-catch-throw.c.

References exception_catchpoint::kind.

Referenced by print_it_exception_catchpoint(), print_mention_exception_catchpoint(), print_one_exception_catchpoint(), print_recreate_exception_catchpoint(), and re_set_exception_catchpoint().

## ◆ compute_exception()

static struct value* compute_exception | ( | struct gdbarch * | argc,
|  | struct internalvar * | var,
|  | void * | ignore
| ) |  |
| static

Definition at line 497 of file break-catch-throw.c.

References cplus_type_from_type_info(), fetch_probe_arguments(), make_pointer_type(), value_cast(), and value_ind().

## ◆ extract_exception_regexp()

static std::string extract_exception_regexp | ( | const char ** | string | ) |
| static

Definition at line 400 of file break-catch-throw.c.

References check_for_argument(), skip_spaces(), skip_to_space(), and string.

Referenced by catch_exception_command_1().

## ◆ fetch_probe_arguments()

static void fetch_probe_arguments | ( | struct value ** | arg0,
|  | struct value ** | arg1
| ) |  |
| static

Definition at line 101 of file break-catch-throw.c.

References _, error(), probe::evaluate_argument(), find_probe_by_pc(), probe::get_argument_count(), get_frame_pc(), probe::get_name(), probe::get_provider(), get_selected_frame(), and bound_probe::prob.

Referenced by check_status_exception_catchpoint(), and compute_exception().

## ◆ handle_gnu_v3_exceptions()

static void handle_gnu_v3_exceptions | ( | int | tempflag,
|  | std::string && | except_rx,
|  | const char * | cond_string,
|  | enum exception_event_kind | ex_event,
|  | int | from_tty
| ) |  |
| static

Definition at line 361 of file break-catch-throw.c.

References _, bp_breakpoint, get_current_arch(), gnu_v3_exception_catchpoint_ops, init_catchpoint(), install_breakpoint(), and re_set_exception_catchpoint().

Referenced by catch_exception_command_1().

## ◆ initialize_throw_catchpoint_ops()

static void initialize_throw_catchpoint_ops | ( | void |  | ) |
| static

Definition at line 523 of file break-catch-throw.c.

References bkpt_breakpoint_ops, breakpoint_ops::check_status, check_status_exception_catchpoint(), gnu_v3_exception_catchpoint_ops, initialize_breakpoint_ops(), breakpoint_ops::print_it, print_it_exception_catchpoint(), breakpoint_ops::print_mention, print_mention_exception_catchpoint(), breakpoint_ops::print_one, breakpoint_ops::print_one_detail, print_one_detail_exception_catchpoint(), print_one_exception_catchpoint(), breakpoint_ops::print_recreate, print_recreate_exception_catchpoint(), breakpoint_ops::re_set, and re_set_exception_catchpoint().

Referenced by _initialize_break_catch_throw().

## ◆ print_it_exception_catchpoint()

static enum print_stop_action print_it_exception_catchpoint | ( | bpstat | bs | ) |
| static

Definition at line 228 of file break-catch-throw.c.

References annotate_catchpoint(), async_reason_lookup(), bpdisp_text(), bpstats::breakpoint_at, classify_exception_breakpoint(), current_uiout, disp_del, breakpoint::disposition, EX_EVENT_CATCH, EX_EVENT_THROW, EXEC_ASYNC_BREAKPOINT_HIT, ui_out::field_int(), ui_out::field_string(), ui_out::is_mi_like_p(), maybe_print_thread_hit_breakpoint(), breakpoint::number, PRINT_SRC_AND_LOC, and ui_out::text().

Referenced by initialize_throw_catchpoint_ops().

## ◆ print_mention_exception_catchpoint()

static void print_mention_exception_catchpoint | ( | struct breakpoint * | b | ) |
| static

Definition at line 318 of file break-catch-throw.c.

References _, classify_exception_breakpoint(), current_uiout, disp_del, breakpoint::disposition, EX_EVENT_CATCH, EX_EVENT_THROW, ui_out::field_int(), breakpoint::number, and ui_out::text().

Referenced by initialize_throw_catchpoint_ops().

## ◆ print_one_detail_exception_catchpoint()

static void print_one_detail_exception_catchpoint | ( | const struct breakpoint * | b,
|  | struct ui_out * | uiout
| ) |  |
| static

Definition at line 303 of file break-catch-throw.c.

References _, exception_catchpoint::exception_rx, ui_out::field_string(), and ui_out::text().

Referenced by initialize_throw_catchpoint_ops().

## ◆ print_one_exception_catchpoint()

static void print_one_exception_catchpoint | ( | struct breakpoint * | b,
|  | struct bp_location ** | last_loc
| ) |  |
| static

Definition at line 257 of file break-catch-throw.c.

References bp_location::address, value_print_options::addressprint, annotate_field(), classify_exception_breakpoint(), current_uiout, EX_EVENT_CATCH, EX_EVENT_RETHROW, EX_EVENT_THROW, ui_out::field_core_addr(), ui_out::field_string(), bp_location::gdbarch, get_user_print_options(), ui_out::is_mi_like_p(), breakpoint::loc, and bp_location::shlib_disabled.

Referenced by initialize_throw_catchpoint_ops().

## ◆ print_recreate_exception_catchpoint()

static void print_recreate_exception_catchpoint | ( | struct breakpoint * | b,
|  | struct ui_file * | fp
| ) |  |
| static

Definition at line 337 of file break-catch-throw.c.

References classify_exception_breakpoint(), disp_del, breakpoint::disposition, EX_EVENT_CATCH, EX_EVENT_RETHROW, EX_EVENT_THROW, fprintf_unfiltered(), and print_recreate_thread().

Referenced by initialize_throw_catchpoint_ops().

## ◆ re_set_exception_catchpoint()

static void re_set_exception_catchpoint | ( | struct breakpoint * | self | ) |
| static

Definition at line 185 of file break-catch-throw.c.

References CATCH, classify_exception_breakpoint(), current_program_space, END_CATCH, exception_functions, explicit_location::function_name, initialize_explicit_location(), new_explicit_location(), new_probe_location(), NOT_FOUND_ERROR, parse_probes(), RETURN_MASK_ERROR, throw_exception(), TRY, and update_breakpoint_locations().

Referenced by handle_gnu_v3_exceptions(), and initialize_throw_catchpoint_ops().

## Variable Documentation

## ◆ exception_funcs

const struct internalvar_funcs exception_funcs
| static

Initial value:
=
{
compute_exception,
NULL,
NULL
}
compute_exception
static struct value * compute_exception(struct gdbarch *argc, struct internalvar *var, void *ignore)
Definition: break-catch-throw.c:497

Definition at line 513 of file break-catch-throw.c.

Referenced by _initialize_break_catch_throw().

## ◆ exception_functions

const struct exception_names exception_functions[]
| static

Initial value:
=
{
{ "-probe-stap libstdcxx:throw", "__cxa_throw" },
{ "-probe-stap libstdcxx:rethrow", "__cxa_rethrow" },
{ "-probe-stap libstdcxx:catch", "__cxa_begin_catch" }
}

Definition at line 66 of file break-catch-throw.c.

Referenced by re_set_exception_catchpoint().

## ◆ gnu_v3_exception_catchpoint_ops

struct breakpoint_ops gnu_v3_exception_catchpoint_ops
| static

Definition at line 73 of file break-catch-throw.c.

Referenced by handle_gnu_v3_exceptions(), and initialize_throw_catchpoint_ops().