Hi all,
I have a problem using OpenOCD, when I want to remove a breakpoint with
'rbreak' command.
I instantanetly get a segfault. A bt bring me in gdb code, here :
jimregexp.c:1021
static int regtry( regex_t *preg, const char *string )
{
int i;
preg->reginput = string;
for (i = 0; i < preg->nmatch; i++) {
preg->pmatch[i].rm_so = -1;
preg->pmatch[i].rm_eo = -1;
}
if (regmatch(preg, 1)) {
preg->pmatch[0].rm_so = string - preg->start;
preg->pmatch[0].rm_eo = preg->reginput - preg->start; // It
crash here !!!
return(1);
} else
return(0);
}
If I go back I see that the problem may come from here :
symtab.c:3386
static int
search_symbols_name_matches (const char *symname, void *user_data)
{
struct search_symbols_data *data = user_data;
return !data->preg_p || regexec (&data->preg, symname, 0, *NULL*, 0) == 0;
}
Signature of regexec :
int regexec(regex_t *preg, const char *string, size_t nmatch,
regmatch_t pmatch[], int eflags)
Why NULL ?? It's clear that if pmatch is NULL preg->pmatch[0].rm_eo =
preg->reginput - preg->start; can't work !
I'm pretty sure it could impact on RTOS awarness problem brought by
Freddie last year on "RTOS?" thread.
Someone can test it to be sure that I'm not alone with this.
I only load an elf, and place a breakpoint, continue (or not) and try to
remove bp !
Vivien !
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel