GDBserver

Classes | Macros | Functions | Variables
cleanups.c File Reference
`#include "common-defs.h"`
`#include "cleanups.h"`

Go to the source code of this file.

## Classes
struct | cleanup

## Macros
#define | SENTINEL_CLEANUP ((struct cleanup *) &sentinel_cleanup)

## Functions
static struct cleanup * | make_my_cleanup2 (struct cleanup **pmy_chain, make_cleanup_ftype *function, void *arg, void(*free_arg)(void *))
static struct cleanup * | make_my_cleanup (struct cleanup **pmy_chain, make_cleanup_ftype *function, void *arg)
struct cleanup * | make_cleanup (make_cleanup_ftype *function, void *arg)
struct cleanup * | make_cleanup_dtor (make_cleanup_ftype *function, void *arg, make_cleanup_dtor_ftype *dtor)
struct cleanup * | make_final_cleanup (make_cleanup_ftype *function, void *arg)
static void | do_my_cleanups (struct cleanup **pmy_chain, struct cleanup *old_chain)
struct cleanup * | all_cleanups (void)
void | do_cleanups (struct cleanup *old_chain)
void | do_final_cleanups (struct cleanup *old_chain)
static void | discard_my_cleanups (struct cleanup **pmy_chain, struct cleanup *old_chain)
void | discard_cleanups (struct cleanup *old_chain)
void | discard_final_cleanups (struct cleanup *old_chain)
static struct cleanup * | save_my_cleanups (struct cleanup **pmy_chain)
struct cleanup * | save_cleanups (void)
struct cleanup * | save_final_cleanups (void)
static void | restore_my_cleanups (struct cleanup **pmy_chain, struct cleanup *chain)
void | restore_cleanups (struct cleanup *chain)
void | restore_final_cleanups (struct cleanup *chain)
void | null_cleanup (void *arg)

## Variables
static const struct cleanup | sentinel_cleanup = { 0, 0, 0, 0 }
static struct cleanup * | cleanup_chain = SENTINEL_CLEANUP
static struct cleanup * | final_cleanup_chain = SENTINEL_CLEANUP

## Macro Definition Documentation

## ◆ SENTINEL_CLEANUP

#define SENTINEL_CLEANUP ((struct cleanup *) &sentinel_cleanup)

Definition at line 59 of file cleanups.c.

Referenced by all_cleanups(), restore_my_cleanups(), and save_my_cleanups().

## Function Documentation

## ◆ all_cleanups()

struct cleanup* all_cleanups | ( | void |  | ) |

Definition at line 165 of file cleanups.c.

References SENTINEL_CLEANUP.

Referenced by exception_rethrow(), operator new(), throw_exception_cxx(), and throw_exception_sjlj().

## ◆ discard_cleanups()

void discard_cleanups | ( | struct cleanup * | old_chain | ) |

Definition at line 212 of file cleanups.c.

References cleanup_chain, and discard_my_cleanups().

Referenced by set_raw_breakpoint_at().

## ◆ discard_final_cleanups()

void discard_final_cleanups | ( | struct cleanup * | old_chain | ) |

Definition at line 221 of file cleanups.c.

References discard_my_cleanups(), and final_cleanup_chain.

## ◆ discard_my_cleanups()

static void discard_my_cleanups | ( | struct cleanup ** | pmy_chain,
|  | struct cleanup * | old_chain
| ) |  |
| static

Definition at line 194 of file cleanups.c.

References cleanup::arg, cleanup::free_arg, cleanup::next, and xfree().

Referenced by discard_cleanups(), and discard_final_cleanups().

## ◆ do_cleanups()

void do_cleanups | ( | struct cleanup * | old_chain | ) |

Definition at line 174 of file cleanups.c.

References cleanup_chain, and do_my_cleanups().

Referenced by exception_rethrow(), install_software_single_step_breakpoints(), linux_mntns_access_fs(), operator new(), set_raw_breakpoint_at(), throw_exception_cxx(), and throw_exception_sjlj().

## ◆ do_final_cleanups()

void do_final_cleanups | ( | struct cleanup * | old_chain | ) |

Definition at line 183 of file cleanups.c.

References do_my_cleanups(), and final_cleanup_chain.

## ◆ do_my_cleanups()

static void do_my_cleanups | ( | struct cleanup ** | pmy_chain,
|  | struct cleanup * | old_chain
| ) |  |
| static

Definition at line 146 of file cleanups.c.

References cleanup::arg, cleanup::free_arg, cleanup::function, cleanup::next, and xfree().

Referenced by do_cleanups(), and do_final_cleanups().

## ◆ make_cleanup()

struct cleanup* make_cleanup | ( | make_cleanup_ftype * | function,
|  | void * | arg
| ) |  |

Definition at line 116 of file cleanups.c.

References cleanup::arg, cleanup_chain, and make_my_cleanup().

Referenced by captured_main(), linux_mntns_access_fs(), make_cleanup_restore_current_thread(), and set_raw_breakpoint_at().

## ◆ make_cleanup_dtor()

struct cleanup* make_cleanup_dtor | ( | make_cleanup_ftype * | function,
|  | void * | arg,
|  | make_cleanup_dtor_ftype * | dtor
| ) |  |

Definition at line 125 of file cleanups.c.

References cleanup::arg, cleanup_chain, and make_my_cleanup2().

Referenced by make_cleanup_close().

## ◆ make_final_cleanup()

struct cleanup* make_final_cleanup | ( | make_cleanup_ftype * | function,
|  | void * | arg
| ) |  |

Definition at line 135 of file cleanups.c.

References cleanup::arg, final_cleanup_chain, and make_my_cleanup().

## ◆ make_my_cleanup()

static struct cleanup* make_my_cleanup | ( | struct cleanup ** | pmy_chain,
|  | make_cleanup_ftype * | function,
|  | void * | arg
| ) |  |
| static

Definition at line 104 of file cleanups.c.

References cleanup::arg, and make_my_cleanup2().

Referenced by make_cleanup(), and make_final_cleanup().

## ◆ make_my_cleanup2()

static struct cleanup* make_my_cleanup2 | ( | struct cleanup ** | pmy_chain,
|  | make_cleanup_ftype * | function,
|  | void * | arg,
|  | void(*)(void *) | free_arg
| ) |  |
| static

Definition at line 79 of file cleanups.c.

References cleanup::arg, cleanup::free_arg, cleanup::function, gdb_assert, cleanup::next, and XNEW.

Referenced by make_cleanup_dtor(), and make_my_cleanup().

## ◆ null_cleanup()

void null_cleanup | ( | void * | arg | ) |

Definition at line 294 of file cleanups.c.

Referenced by linux_mntns_access_fs(), and set_raw_breakpoint_at().

## ◆ restore_cleanups()

void restore_cleanups | ( | struct cleanup * | chain | ) |

Definition at line 273 of file cleanups.c.

References cleanup_chain, and restore_my_cleanups().

Referenced by catcher_pop(), and exception_try_scope_exit().

## ◆ restore_final_cleanups()

void restore_final_cleanups | ( | struct cleanup * | chain | ) |

Definition at line 281 of file cleanups.c.

References final_cleanup_chain, and restore_my_cleanups().

## ◆ restore_my_cleanups()

static void restore_my_cleanups | ( | struct cleanup ** | pmy_chain,
|  | struct cleanup * | chain
| ) |  |
| static

Definition at line 261 of file cleanups.c.

References _, internal_warning(), and SENTINEL_CLEANUP.

Referenced by restore_cleanups(), and restore_final_cleanups().

## ◆ save_cleanups()

struct cleanup* save_cleanups | ( | void |  | ) |

Definition at line 242 of file cleanups.c.

References cleanup_chain, and save_my_cleanups().

Referenced by exception_try_scope_entry(), and exceptions_state_mc_init().

## ◆ save_final_cleanups()

struct cleanup* save_final_cleanups | ( | void |  | ) |

Definition at line 251 of file cleanups.c.

References final_cleanup_chain, and save_my_cleanups().

## ◆ save_my_cleanups()

static struct cleanup* save_my_cleanups | ( | struct cleanup ** | pmy_chain | ) |
| static

Definition at line 231 of file cleanups.c.

References SENTINEL_CLEANUP.

Referenced by save_cleanups(), and save_final_cleanups().

## Variable Documentation

## ◆ cleanup_chain

struct cleanup* cleanup_chain = SENTINEL_CLEANUP
| static

Definition at line 63 of file cleanups.c.

Referenced by discard_cleanups(), do_cleanups(), make_cleanup(), make_cleanup_dtor(), restore_cleanups(), and save_cleanups().

## ◆ final_cleanup_chain

struct cleanup* final_cleanup_chain = SENTINEL_CLEANUP
| static

Definition at line 67 of file cleanups.c.

Referenced by discard_final_cleanups(), do_final_cleanups(), make_final_cleanup(), restore_final_cleanups(), and save_final_cleanups().

## ◆ sentinel_cleanup

const struct cleanup sentinel_cleanup = { 0, 0, 0, 0 }
| static

Definition at line 56 of file cleanups.c.