473,791 Members | 2,853 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2196
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(vo id);

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(vo id)
{
_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.c om, 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/googlegroupsrep ly/>
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 (myBreakConditi on(a,b,c,d)){
logBreakConditi on("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
5531
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; Auto-attach to process ' w3wp.exe' on machine 'CSS5' failed. Error code 0x80070005 (Access is denied. ). I have found a number of articles and it would appear that the problem
5
2069
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 start debugger on the web server: Access is Denied" when attempting to start the app with debugging. Now, I have already spent 3 days going through every Knowledge base article and all the included help with .net, have tried about 50 different...
1
1668
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 has Visual Studio.NET installed on it and IIS is configured. This machine is also hosting my SQL Server 2000. Everything except debugging seems to be working. I can connect to the machine from my remote workstation and develop as well as develop...
5
6585
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 Environment" with this message: "Error while trying to run project: Unable to start debugging on the web server. Server-side error occurred on sending debug HTTP request. Make sure the server is operating correctly. Verify there are no...
2
1853
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 (for javascript debugging) This causes IE to consume loads of CPU if the page is very large. Is there any way to have debugging of server side code but leave IE in "normal" mode?
5
2958
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 final, never installed beta) installed on this box if it makes a difference (I did not install VS Development Web Server as I'm already using the XP web server). I've seen that I need to attach to the native IIS engine, but I don't know what it's...
5
3648
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 New System.Diagnostics.Process 'p.Start(MDEPDirStr & "macrun.exe", sPPTOut) p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE") 'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
3
2367
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 to build ASP.net programs now. For a new ASP.net project, an error message (i.e Unable to start debugging on the web server) popped out. I disabled the ASP.net debugging for 3-4 projects. However, I either could not see the ASP.net...
4
7626
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 user name or bad password I logged on to a neighbors computer and I can debug from his so the server should be OK right? The web server is running Server 2003 sp1. I even tried disabling the loopback check in the registry...
0
3155
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 Procedure in it. The target DB is SQL Server 2005 and im using VS 2005. I simply create a new SQL Server Project which creates a Test.sql, i then simply added a Stored Procedure to it called the default name StoredProcedure1.cs and put a break point...
0
9515
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10426
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10154
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5430
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.