473,399 Members | 4,254 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Debugging a server-client app

Greetings,

I am debugging client-server single threaded code and would like to
hear some suggestions regarding being able to make debugger to detect a
certain condition and from that point to allow step by step debugging.
The reason for that is because I need to see what is arriving at a
certain packet, not necessary the first one.
In fact, I was thinking to start server in debugging mode to wait for a
trap, where I'll put a bookmark (location to stop a debugger at), and
run the client, which will send packets. I am not sure how to do that.
Is it possible? Are there any other suggestions?

Currently, I am using Eclipse for C on Linux.

Thank you

Apr 23 '06 #1
3 2169
bobrics a écrit :
Greetings,

I am debugging client-server single threaded code and would like to
hear some suggestions regarding being able to make debugger to detect a
certain condition and from that point to allow step by step debugging.
The reason for that is because I need to see what is arriving at a
certain packet, not necessary the first one.
In fact, I was thinking to start server in debugging mode to wait for a
trap, where I'll put a bookmark (location to stop a debugger at), and
run the client, which will send packets. I am not sure how to do that.
Is it possible? Are there any other suggestions?

Currently, I am using Eclipse for C on Linux.

Thank you


If your debugger is not sophisticated to handle conditional breakpoints
just add a line to your application (in the critical problem section)
void CallDebugger(void);

if (condition) {
CallDebugger();
}
Now, CallDebugger() could be some system specific code to attach the
debugger to your application or, if you run in an x86 system just

void CallDebugger(void)
{
_asm("int $3");
}

This will call the debugger in all linux x86 systems.
Apr 23 '06 #2
bobrics wrote:

I am debugging client-server single threaded code and would like
to hear some suggestions regarding being able to make debugger to
detect a certain condition and from that point to allow step by
step debugging. The reason for that is because I need to see what
is arriving at a certain packet, not necessary the first one. In
fact, I was thinking to start server in debugging mode to wait for
a trap, where I'll put a bookmark (location to stop a debugger
at), and run the client, which will send packets. I am not sure
how to do that. Is it possible? Are there any other suggestions?

Currently, I am using Eclipse for C on Linux.


This is off-topic for c.l.c. Which means, among other things, that
any answers you get are very likely to be meaningless blather from
people who cannot stay on topic, and who will certainly not get
corrected as to facts. Look for a newsgroup with 'thread' in its
name, or one that deals with your particular system.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
Apr 23 '06 #3
On 2006-04-23, bobrics <bo*****@gmail.com> wrote:
Greetings,

I am debugging client-server single threaded code and would like to
hear some suggestions regarding being able to make debugger to detect a
certain condition and from that point to allow step by step debugging.
The reason for that is because I need to see what is arriving at a
certain packet, not necessary the first one.
In fact, I was thinking to start server in debugging mode to wait for a
trap, where I'll put a bookmark (location to stop a debugger at), and
run the client, which will send packets. I am not sure how to do that.
Is it possible? Are there any other suggestions?

Currently, I am using Eclipse for C on Linux.

Thank you


Most debuggers have conditional breakpoints : since you dont mention
your platform I can't really confirm this : but most debuggers
understand (in C environment) C conditions to force the break
point. Failing that you can add a line to your code (assuming you have
ability to check it out and compile locally which I assume you do)
where you can set the breakpoint : although be very careful that the
"if" statement is bugfree : adding "debug" code can and frequently
does affect the application being debugged - see

http://heather.cs.ucdavis.edu/~matlo...tml#tth_sEc3.1

It discusses why using debug specific code is not a good idea, but
often it is convenient and certainly has its place in small systems
where its easy to add/remove/compile small code bases:

eg.

if (myBreakCondition(a,b,c,d)){
logBreakCondition("Here!"); /* set breakpoint here */
}

Using printfs on their own without a breakpoint has its place but is
limited and requires recompilations and code removal as well as
possibly causing heisenbugs : in addition, they tell you nothing at
all about the call stack which might have contributed to the break condition.

Good luck!
Apr 23 '06 #4

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

Similar topics

3
by: Steve Wark | last post by:
I have a Windows 2003 Web server on which I was debugging remotely with no problems. I then moved this server to a different domain and now remote debugging will not work, the error is; ...
5
by: Don Hans | last post by:
Gents, Have .Net2003 Enterprise architect installed on a Win2k Server with IIS. Even logged in as administrator, I cannot run any ASP.NET app with debugging. I always get the error "Unable to...
1
by: Drunken Coder | last post by:
I have a small network setup in my home where I have my workstation which is WindowsXP Home Edition and a server running Windows 2000 Server configured as a domain controller. The domain controller...
5
by: Bruce Schechter | last post by:
I just started to develop an ASP.NET application in vs.net 2003 . But each time I try to execute the application (which is basically empty so far), I get a dialog box titled "Microsoft Development...
2
by: Andy Fish | last post by:
Hi, Using VS.NET 2003, when I use 'F5' to start debugging my web app, it obviously attaches the IDE to IIS for server debugging. However, it also seems to put IE into some kind of debugging mode...
5
by: Velvet | last post by:
Can someone tell me to what process I need to attach to be able to step through my classic ASP code in VS.net 2003. I'm working on an XP box with IIS installed. I also have VS.net 2005 (The...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
3
by: =?Utf-8?B?SmVmZnJleQ==?= | last post by:
Just started to test a VB.net 2002 project for ASP.net application. After successfully installed the VS.net 2002 and tested the IIS 5.1 on XP Pro SP2 for some classical ASP programs, I am starting...
4
by: ian | last post by:
A few weeks ago I was able to run remote debugging from my local machine (VS 2005 XP sp2) but now I get the following message: unable to start debugging on the web server. logon failure: unknown...
0
by: DR | last post by:
Unable to start TSQL Debugging. Could not attach to SQL Server Process on 'srvname'. The RPC server is unavailable. I get this error when I try to run a SQL Server Project with a CLR stored...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.