X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Futils.c;h=18ee9bbf98b4a88308394424cf3dbe94c01531c6;hb=a9bb8c343ea7dd2b93573dcf32d913af6adfd508;hp=a222c59ea1815bcfbacca02fa0b1a21b24dcec23;hpb=598d363666e7b84f3dd5bf0f4cca83e856d77b1b;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/utils.c b/gdb/utils.c index a222c59ea1..18ee9bbf98 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -713,6 +713,7 @@ internal_vproblem (struct internal_problem *problem, int quit_p; int dump_core_p; char *reason; + struct cleanup *cleanup = make_cleanup (null_cleanup, NULL); /* Don't allow infinite error/warning recursion. */ { @@ -821,6 +822,7 @@ internal_vproblem (struct internal_problem *problem, } dejavu = 0; + do_cleanups (cleanup); } static struct internal_problem internal_error_problem = { @@ -1124,6 +1126,29 @@ get_regcomp_error (int code, regex_t *rx) return result; } +/* Compile a regexp and throw an exception on error. This returns a + cleanup to free the resulting pattern on success. RX must not be + NULL. */ + +struct cleanup * +compile_rx_or_error (regex_t *pattern, const char *rx, const char *message) +{ + int code; + + gdb_assert (rx != NULL); + + code = regcomp (pattern, rx, REG_NOSUB); + if (code != 0) + { + char *err = get_regcomp_error (code, pattern); + + make_cleanup (xfree, err); + error (("%s: %s"), message, err); + } + + return make_regfree_cleanup (pattern); +} + /* This function supports the query, nquery, and yquery functions. @@ -2651,7 +2676,7 @@ initialize_utils (void) Set number of characters where GDB should wrap lines of its output."), _("\ Show number of characters where GDB should wrap lines of its output."), _("\ This affects where GDB wraps its output to fit the screen width.\n\ -Setting this to zero prevents GDB from wrapping its output."), +Setting this to \"unlimited\" or zero prevents GDB from wrapping its output."), set_width_command, show_chars_per_line, &setlist, &showlist); @@ -2661,7 +2686,7 @@ Set number of lines in a page for GDB output pagination."), _("\ Show number of lines in a page for GDB output pagination."), _("\ This affects the number of lines after which GDB will pause\n\ its output and ask you whether to continue.\n\ -Setting this to zero causes GDB never pause during output."), +Setting this to \"unlimited\" or zero causes GDB never pause during output."), set_height_command, show_lines_per_page, &setlist, &showlist); @@ -2674,7 +2699,7 @@ Set state of GDB output pagination."), _("\ Show state of GDB output pagination."), _("\ When pagination is ON, GDB pauses at end of each screenful of\n\ its output and asks you whether to continue.\n\ -Turning pagination off is an alternative to \"set height 0\"."), +Turning pagination off is an alternative to \"set height unlimited\"."), NULL, show_pagination_enabled, &setlist, &showlist);