GDBserver

Classes | Macros | Enumerations | Functions | Variables
common-exceptions.h File Reference
`#include <setjmp.h>`
`#include <new>`

Go to the source code of this file.

## Classes
struct | gdb_exception
struct | exception_try_scope
struct | gdb_exception_RETURN_MASK_ALL
struct | gdb_exception_RETURN_MASK_ERROR
struct | gdb_exception_RETURN_MASK_QUIT
struct | gdb_quit_bad_alloc

## Macros
#define | RETURN_MASK(reason) (1 << (int)(-reason))
#define | GDB_XCPT_SJMP 1
#define | GDB_XCPT_TRY 2
#define | GDB_XCPT_RAW_TRY 3
#define | GDB_XCPT GDB_XCPT_TRY
#define | TRY_SJLJ
#define | CATCH_SJLJ(EXCEPTION, MASK)
#define | END_CATCH_SJLJ }
#define | TRY
#define | CATCH(EXCEPTION, MASK)
#define | END_CATCH

## Enumerations
enum | return_reason { RETURN_QUIT = -2, RETURN_ERROR }
enum | return_mask { RETURN_MASK_QUIT = RETURN_MASK (RETURN_QUIT), RETURN_MASK_ERROR = RETURN_MASK (RETURN_ERROR), RETURN_MASK_ALL = (RETURN_MASK_QUIT | RETURN_MASK_ERROR) }
enum | errors { GDB_NO_ERROR, GENERIC_ERROR, NOT_FOUND_ERROR, TLS_NO_LIBRARY_SUPPORT_ERROR, TLS_LOAD_MODULE_NOT_FOUND_ERROR, TLS_NOT_ALLOCATED_YET_ERROR, TLS_GENERIC_ERROR, XML_PARSE_ERROR, MEMORY_ERROR, NOT_AVAILABLE_ERROR, OPTIMIZED_OUT_ERROR, NO_ENTRY_VALUE_ERROR, TARGET_CLOSE_ERROR, UNDEFINED_COMMAND_ERROR, NOT_SUPPORTED_ERROR, MAX_COMPLETIONS_REACHED_ERROR, NR_ERRORS }

## Functions
jmp_buf * | exceptions_state_mc_init (void)
int | exceptions_state_mc_action_iter (void)
int | exceptions_state_mc_action_iter_1 (void)
int | exceptions_state_mc_catch (struct gdb_exception *, int)
void * | exception_try_scope_entry (void)
void | exception_try_scope_exit (void *saved_state)
void | exception_rethrow (void)
void | throw_exception (struct gdb_exception exception) ATTRIBUTE_NORETURN
void | throw_exception_sjlj (struct gdb_exception exception) ATTRIBUTE_NORETURN
void | throw_verror (enum errors, const char *fmt, va_list ap) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF(2
void void | throw_vquit (const char *fmt, va_list ap) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF(1
void void void | throw_error (enum errors error, const char *fmt,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF(2
void void void void | throw_quit (const char *fmt,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF(1

## Variables
void void void void const struct gdb_exception | exception_none

## Macro Definition Documentation

## ◆ CATCH

#define CATCH | ( |  | EXCEPTION,
|  |  | MASK
| ) |  |

Value:
} while (0); \
} \
catch (struct gdb_exception ## _ ## MASK &EXCEPTION)
_
#define _(String)
Definition: gdb_locale.h:35
gdb_exception
Definition: common-exceptions.h:111

Definition at line 254 of file common-exceptions.h.

Referenced by captured_main(), detach_or_kill_for_exit_cleanup(), linux_detach_one_lwp(), linux_resume_one_lwp(), main(), operator new(), and selftests::run_tests().

## ◆ CATCH_SJLJ

#define CATCH_SJLJ | ( |  | EXCEPTION,
|  |  | MASK
| ) |  |

Value:
{ \
struct gdb_exception EXCEPTION; \
if (exceptions_state_mc_catch (&(EXCEPTION), MASK))
exceptions_state_mc_catch
int exceptions_state_mc_catch(struct gdb_exception *, int)
Definition: common-exceptions.c:182
gdb_exception
Definition: common-exceptions.h:111

Definition at line 191 of file common-exceptions.h.

## ◆ END_CATCH

#define END_CATCH

Value:
catch (...) \
{ \
exception_rethrow (); \
} \
}

Definition at line 259 of file common-exceptions.h.

Referenced by captured_main(), detach_or_kill_for_exit_cleanup(), linux_detach_one_lwp(), linux_resume_one_lwp(), main(), operator new(), and selftests::run_tests().

## ◆ END_CATCH_SJLJ

#define END_CATCH_SJLJ }

Definition at line 196 of file common-exceptions.h.

## ◆ GDB_XCPT

#define GDB_XCPT GDB_XCPT_TRY

Definition at line 132 of file common-exceptions.h.

## ◆ GDB_XCPT_RAW_TRY

#define GDB_XCPT_RAW_TRY 3

Definition at line 130 of file common-exceptions.h.

## ◆ GDB_XCPT_SJMP

#define GDB_XCPT_SJMP 1

Definition at line 121 of file common-exceptions.h.

## ◆ GDB_XCPT_TRY

#define GDB_XCPT_TRY 2

Definition at line 124 of file common-exceptions.h.

## ◆ RETURN_MASK

#define RETURN_MASK | ( |  | reason | ) | (1 << (int)(-reason))

Definition at line 38 of file common-exceptions.h.

Referenced by exceptions_state_mc_catch().

## ◆ TRY

#define TRY

Value:
{ \
try \
{ \
exception_try_scope exception_try_scope_instance; \
do \
{

Definition at line 246 of file common-exceptions.h.

Referenced by captured_main(), detach_or_kill_for_exit_cleanup(), linux_detach_one_lwp(), linux_resume_one_lwp(), main(), operator new(), and selftests::run_tests().

## ◆ TRY_SJLJ

#define TRY_SJLJ

Value:
{ \
jmp_buf *buf = \
exceptions_state_mc_init (); \
setjmp (*buf); \
} \
while (exceptions_state_mc_action_iter ()) \
while (exceptions_state_mc_action_iter_1 ())
exceptions_state_mc_action_iter
int exceptions_state_mc_action_iter(void)
Definition: common-exceptions.c:207
exceptions_state_mc_action_iter_1
int exceptions_state_mc_action_iter_1(void)
Definition: common-exceptions.c:213

Definition at line 182 of file common-exceptions.h.

## Enumeration Type Documentation

## ◆ errors

enum errors

Enumerator
GDB_NO_ERROR |
GENERIC_ERROR |
NOT_FOUND_ERROR |
TLS_NO_LIBRARY_SUPPORT_ERROR |
TLS_LOAD_MODULE_NOT_FOUND_ERROR |
TLS_NOT_ALLOCATED_YET_ERROR |
TLS_GENERIC_ERROR |
XML_PARSE_ERROR |
MEMORY_ERROR |
NOT_AVAILABLE_ERROR |
OPTIMIZED_OUT_ERROR |
NO_ENTRY_VALUE_ERROR |
TARGET_CLOSE_ERROR |
UNDEFINED_COMMAND_ERROR |
NOT_SUPPORTED_ERROR |
MAX_COMPLETIONS_REACHED_ERROR |
NR_ERRORS |

Definition at line 49 of file common-exceptions.h.

## ◆ return_mask

enum return_mask

Enumerator
RETURN_MASK_QUIT |
RETURN_MASK_ERROR |
RETURN_MASK_ALL |

Definition at line 40 of file common-exceptions.h.

## ◆ return_reason

enum return_reason

Enumerator
RETURN_QUIT |
RETURN_ERROR |

Definition at line 30 of file common-exceptions.h.

## Function Documentation

## ◆ exception_rethrow()

void exception_rethrow | ( | void |  | ) |

Definition at line 249 of file common-exceptions.c.

References all_cleanups(), and do_cleanups().

## ◆ exception_try_scope_entry()

void* exception_try_scope_entry | ( | void |  | ) |

Definition at line 228 of file common-exceptions.c.

References save_cleanups(), and try_scope_depth.

Referenced by exception_try_scope::exception_try_scope().

## ◆ exception_try_scope_exit()

void exception_try_scope_exit | ( | void * | saved_state | ) |

Definition at line 238 of file common-exceptions.c.

References restore_cleanups(), and try_scope_depth.

Referenced by exception_try_scope::~exception_try_scope().

## ◆ exceptions_state_mc_action_iter()

int exceptions_state_mc_action_iter | ( | void |  | ) |

Definition at line 207 of file common-exceptions.c.

References CATCH_ITER, and exceptions_state_mc().

## ◆ exceptions_state_mc_action_iter_1()

int exceptions_state_mc_action_iter_1 | ( | void |  | ) |

Definition at line 213 of file common-exceptions.c.

References CATCH_ITER_1, and exceptions_state_mc().

## ◆ exceptions_state_mc_catch()

int exceptions_state_mc_catch | ( | struct gdb_exception * | ,
|  | int |
| ) |  |

Definition at line 182 of file common-exceptions.c.

References catcher_pop(), current_catcher, catcher::exception, gdb_exception::reason, RETURN_MASK, and throw_exception_sjlj().

## ◆ exceptions_state_mc_init()

jmp_buf* exceptions_state_mc_init | ( | void |  | ) |

Definition at line 79 of file common-exceptions.c.

References catcher::buf, CATCHER_CREATED, current_catcher, catcher::exception, exception_none, catcher::prev, save_cleanups(), catcher::saved_cleanup_chain, catcher::state, and XCNEW.

## ◆ throw_error()

void void void throw_error | ( | enum errors | error,
|  | const char * | fmt,
|  |  | ...
| ) |  |

## ◆ throw_exception()

void throw_exception | ( | struct gdb_exception | exception | ) |

Definition at line 312 of file common-exceptions.c.

References catcher::exception, throw_exception_cxx(), and throw_exception_sjlj().

Referenced by ATTRIBUTE_PRINTF(), linux_detach_one_lwp(), and linux_resume_one_lwp().

## ◆ throw_exception_sjlj()

void throw_exception_sjlj | ( | struct gdb_exception | exception | ) |

Definition at line 270 of file common-exceptions.c.

References all_cleanups(), catcher::buf, CATCH_THROWING, current_catcher, do_cleanups(), catcher::exception, exceptions_state_mc(), and gdb_exception::reason.

Referenced by exceptions_state_mc_catch(), and throw_exception().

## ◆ throw_quit()

void void void void throw_quit | ( | const char * | fmt,
|  |  | ...
| ) |  |

## ◆ throw_verror()

void throw_verror | ( | enum errors | ,
|  | const char * | fmt,
|  | va_list | ap
| ) |  |

## ◆ throw_vquit()

void void throw_vquit | ( | const char * | fmt,
|  | va_list | ap
| ) |  |

## Variable Documentation

## ◆ exception_none

void void void void const struct gdb_exception exception_none

Definition at line 23 of file common-exceptions.c.

Referenced by exceptions_state_mc_init().