gdb: breakpoint condition to compare string

P

Pawel

Hallo group members.

Is it possible in gdb to setup breakpoint conditions to stop if char*
points to string that is equal to some string, for example

void fun(char* line) {
printf("%s\n", line); // breakpoint 1 is set on this line
};

I tried the following but these do not work:

(gud) cond 1 strcmp(line,"value")
(gud) cond 1 line == "value"

regards
 
I

Ian Collins

Pawel said:
Hallo group members.

Is it possible in gdb to setup breakpoint conditions to stop if char*
points to string that is equal to some string, for example
Wrong group, look for a gnu forum.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top