gets pushed. */
static void
-ada_add_standard_exceptions (regex_t *preg, VEC(ada_exc_info) **exceptions)
+ada_add_standard_exceptions (compiled_regex *preg,
+ VEC(ada_exc_info) **exceptions)
{
int i;
for (i = 0; i < ARRAY_SIZE (standard_exc); i++)
{
if (preg == NULL
- || regexec (preg, standard_exc[i], 0, NULL, 0) == 0)
+ || preg->exec (standard_exc[i], 0, NULL, 0) == 0)
{
struct bound_minimal_symbol msymbol
= ada_lookup_simple_minsym (standard_exc[i]);
gets pushed. */
static void
-ada_add_exceptions_from_frame (regex_t *preg, struct frame_info *frame,
+ada_add_exceptions_from_frame (compiled_regex *preg,
+ struct frame_info *frame,
VEC(ada_exc_info) **exceptions)
{
const struct block *block = get_frame_block (frame, 0);
/* Return true if NAME matches PREG or if PREG is NULL. */
static bool
-name_matches_regex (const char *name, regex_t *preg)
+name_matches_regex (const char *name, compiled_regex *preg)
{
return (preg == NULL
- || regexec (preg, ada_decode (name), 0, NULL, 0) == 0);
+ || preg->exec (ada_decode (name), 0, NULL, 0) == 0);
}
/* Add all exceptions defined globally whose name name match
gets pushed. */
static void
-ada_add_global_exceptions (regex_t *preg, VEC(ada_exc_info) **exceptions)
+ada_add_global_exceptions (compiled_regex *preg,
+ VEC(ada_exc_info) **exceptions)
{
struct objfile *objfile;
struct compunit_symtab *s;
do not match. Otherwise, all exceptions are listed. */
static VEC(ada_exc_info) *
-ada_exceptions_list_1 (regex_t *preg)
+ada_exceptions_list_1 (compiled_regex *preg)
{
VEC(ada_exc_info) *result = NULL;
struct cleanup *old_chain
VEC(ada_exc_info) *
ada_exceptions_list (const char *regexp)
{
- VEC(ada_exc_info) *result = NULL;
- struct cleanup *old_chain = NULL;
- regex_t reg;
-
- if (regexp != NULL)
- old_chain = compile_rx_or_error (®, regexp,
- _("invalid regular expression"));
+ if (regexp == NULL)
+ return ada_exceptions_list_1 (NULL);
- result = ada_exceptions_list_1 (regexp != NULL ? ® : NULL);
-
- if (old_chain != NULL)
- do_cleanups (old_chain);
- return result;
+ compiled_regex reg (regexp, REG_NOSUB, _("invalid regular expression"));
+ return ada_exceptions_list_1 (®);
}
/* Implement the "info exceptions" command. */