diff options
Diffstat (limited to 'gdb/utils.c')
-rw-r--r-- | gdb/utils.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/utils.c b/gdb/utils.c index 364470c..a8a7cb3 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -466,6 +466,24 @@ make_cleanup_restore_current_language (void) (void *) (uintptr_t) saved_lang); } +/* Helper function for make_cleanup_clear_parser_state. */ + +static void +do_clear_parser_state (void *ptr) +{ + struct parser_state **p = (struct parser_state **) ptr; + + *p = NULL; +} + +/* Clean (i.e., set to NULL) the parser state variable P. */ + +struct cleanup * +make_cleanup_clear_parser_state (struct parser_state **p) +{ + return make_cleanup (do_clear_parser_state, (void *) p); +} + /* This function is useful for cleanups. Do |