473,508 Members | 2,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

debugging and bad c code

I was wondering if there was a technique for understanding a huge code
that was written about a decade back, has no coding conventions
followed and has bad variable/function names.

GDB/DDD are fine but I do not want to dig into each and every function
and find out what is the meaning of each
and every variable.

The code uses a few structs also with a good deal of data put into
each.

Re-writing the entire code is not a possibility.
I need something to understand-ablify the existing code.

At the least, how can I write a macro/function that will print all the
contents of a structure given
an instance of the structure.

Feb 27 '07 #1
2 1301
On 27 Feb 2007 01:46:12 -0800, "call_me_anything" wrote:
>I was wondering if there was a technique for understanding a huge code
that was written about a decade back, has no coding conventions
followed and has bad variable/function names.
First of all, demand a rise in salary.
>Re-writing the entire code is not a possibility.
I need something to understand-ablify the existing code.
A book (http://www.spinellis.gr/codereading/) may help or a commercial
tool (http://www.scitools.com/products/und...p/product.php).

Good luck,
Roland Pibinger
Feb 27 '07 #2
On Feb 27, 10:46 am, "call_me_anything" <s...@yahoo.comwrote:
I was wondering if there was a technique for understanding a huge code
that was written about a decade back, has no coding conventions
followed and has bad variable/function names.

GDB/DDD are fine but I do not want to dig into each and every function
and find out what is the meaning of each
and every variable.

The code uses a few structs also with a good deal of data put into
each.

Re-writing the entire code is not a possibility.
I need something to understand-ablify the existing code.

At the least, how can I write a macro/function that will print all the
contents of a structure given
an instance of the structure.
A bit OT, but doxygen might be able to help. Have not used it much
myself but I think it will be able to generate diagrams of which
functions calls which etc.

--
Erik Wikström

Feb 27 '07 #3

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

Similar topics

6
25182
by: Dmitri Shvetsov | last post by:
Hi All, Did somebody see the situation when the VS refuses to debug the Web Service at all? I can't catch why, the initially created Web Service can be debugged very easy but after some changes...
0
3203
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
5
2926
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
3612
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...
8
2198
by: razael1 | last post by:
I am putting debugging messages into my program by putting blocks that look like this: #ifdef DEBUG errlog << "Here is some information"; #endif All these #ifdef blocks make the code bulky and...
5
7776
by: phnimx | last post by:
Hi , We have developed a number of plug-in .NET Library Components that we typically deploy with our various applications by installing them into the GAC. Each of the applications contains an...
5
2790
by: rn5a | last post by:
Can someone please suggest me a text editor especially for DEBUGGING ASP scripts apart from Microsoft Visual Interdev? I tried using Visual Interdev & created a project but Interdev generates...
0
7295
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
2
20814
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...
33
2843
by: fmassei | last post by:
Hello! I made a short piece of code that I find very useful for debugging, and I wanted to ask you if it is correct, somehow acceptable or if I simply reinvented the wheel. To deal with some bad...
0
7321
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
7377
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...
1
7036
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
5624
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,...
1
5047
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
4705
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
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.