I would like to stop my execution when the content of the aux pointer to struct is "AAAAA".
typedef struct Matriz {
string *usuario;
string *produto;
string nota;
Matriz *proxima_linha, *proxima_coluna;
} Matriz;
Matriz *aux = new Matriz();
first i put a breakpoint after the aux declaration.
breakpoint set --file UsuariosSemelhantes.cpp --line 55
then I define a watchpoint.
watchpoint set variable aux
and then I add the stop condition.
watchpoint modify -c '(int)strcmp(*aux->usuario,"AAAAA") == 0'
but I get the following error:
Process 398158 resuming
Stopped due to an error evaluating condition of watchpoint Watchpoint 1: addr = 0x7fffffffe620 size = 8 state = enabled type = w: "(int)strcmp(*aux->usuario,"AAAAA") == 0"
error: <user expression 0>:1:13: cannot pass object of non-trivial type 'std::string' (aka 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >') through variadic function; call will abort at runtime
(int)strcmp(*aux->usuario,"AAAAA") == 0
^