473,487 Members | 2,452 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

gdb: breakpoint condition to compare string



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

Oct 26 '06 #1
1 6483
Pawel wrote:
>
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.

--
Ian Collins.
Oct 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2718
by: Andrew Wilkinson | last post by:
Hi, Below is a back trace from a gdb session. If you look at you'll see that there are some function calls where gdb can't find the name of the function. I'm pretty sure that those functions are...
5
1457
by: Zheng Da | last post by:
When I set a break point in the constructor of a class, and run the program in gdb, but the program didn't stop at the breakpoint I set.It seemed there was no breakpoints at all. How should I set...
1
2220
by: fabio | last post by:
1. #include <stdio.h> 2. #include <stdlib.h> 3. #include <string.h> 4. #include <pthread.h> 5. #include <sys/types.h>
4
9286
by: digz | last post by:
Hi, I am having a lot of trouble setting conditional breakpoints in gdb, here is a simple example... #include<string> #include<iostream> using namespace std; void func(string& s){ cout <<...
2
2571
by: Mahesh | last post by:
Hi, I encounted some problems using GDB with classes that use virtual inheritance. To illustrate this issue, I have created a simple test case. Here it goes. #include <iostream>
29
2548
by: Pietro Cerutti | last post by:
Hello, here I have a strange problem with a real simple strtok example. The program is as follows: ### BEGIN STRTOK ### #include <string.h> #include <stdio.h>
4
5226
by: ravit | last post by:
I have built my gdb-6.7.1 yesterday on my AIX 5.3 64 bit machine. my gcc is gcc3.3.2 and tried debugging 64 bit executables generated by gcc, working fine. debugging session ends successfully....
4
2327
gdb
by: moongeegee | last post by:
I am learning gdb to debug the program. As soon as I run the program, it prompt me an error and terminated. How to step into it or set breakpoint and find the problem. Thanks. (gdb) run...
2
20802
jwwicks
by: jwwicks | last post by:
C/C++ Programs and Debugging in Linux This tutorial will give you a basic idea how to debug a program in Linux using GDB. As you are aware Visual Studio doesn’t run on Linux so you have to use...
0
7106
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4874
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
267
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.