Sponsored Content
Full Discussion: Debugging a c/c++ program
Top Forums UNIX for Advanced & Expert Users Debugging a c/c++ program Post 302073468 by 01000101 on Sunday 14th of May 2006 07:19:02 PM
Old 05-14-2006
simple debugging in *nix

if you have the GCC,G++ debugger, which you probably do... you can take your source code text (made or copied in one of the text editors) and assign it the extension you want.. say its EXAMPLE.cpp , to debug just type in the shell command line

gcc -lg++ -Wall -pedantic -ansi -g -o EXOUT EXAMPLE.cpp

this takes and debuggs EXAMPLE.cpp, and hassle-free outputs the compiled program named EXOUT (this can be named whatever you want btw).
the -lg++ is just to tell the debugger to look in the default location for #include header files.. and then -Wall is the actual debugger part. the -o is for a simple output, instead of the a.out aproach.

Pe@cE ... this also works for plain cc instead of gcc
 

10 More Discussions You Might Find Interesting

1. Programming

how to run debugging on c program

Can someone help me debug a c program I am running? It gives me segmentation fault. I want to turn on debugging. Can some one give the command to turn it on? Below is the error I get: Segmentation Fault (core dumped) (3 Replies)
Discussion started by: ibeg
3 Replies

2. Shell Programming and Scripting

Regarding Debugging

Hi, If we want to debug a shell script, then set -vx has to be included in the begining of the script. Just i want to know what purpose -vx is used. Thanks in advace Sarwan (2 Replies)
Discussion started by: sarwan
2 Replies

3. Programming

Semaphore debugging

I'm running one multithreaded application, in that one of my thread is waiting infinitely in a semphore. Is there a way to determine, in which semaphore the particular thread is waiting and which thread(s) is holding the semaphore. (5 Replies)
Discussion started by: ptprabu
5 Replies

4. Solaris

debugging

when I tried to debug my application i got the following. gdb -v GNU gdb 6.6 file is in C and Xmotiff Languages (gdb) attach 25499 Attaching to process 25499 Retry #1: Retry #2: Retry #3: Retry #4: 0xfea40b68 in ?? () (gdb) where #0 0xfea40b68 in ?? () (0 Replies)
Discussion started by: satish@123
0 Replies

5. Programming

Need some help in debugging the C-Progam.

Hi i want to debug the C program with GDB debugger. I want to debug the program by line by line. I want to debug program like as we debug the program in Turbo-C using the F8. Can any one help me? I know i have to use single stepping. But i don't know how to use it. Any help can be appreciated..... (5 Replies)
Discussion started by: ps_sach
5 Replies

6. Programming

Debugging Program during execution

I have made use of 'valgrind' and -finstrument-functions compiler option for debugging / analyzing code. Both the options lets us know the line / file being executed to some extent. Is there a generic way that lets program dump the file:line it is getting executed dumped to a log file during... (3 Replies)
Discussion started by: uunniixx
3 Replies

7. Homework & Coursework Questions

Fixer Debugging

School:Syrian Virtual University - Bachelor in Information Technology - Tutor: A.Issa - course: S10-iti320 hi all, would you please help me correcting and debugging this script: fx-permiss.sh which accepts a list of users as argument resiting those files permissions: say our directory... (0 Replies)
Discussion started by: erzal
0 Replies

8. Programming

c++ debugging

hey i have a problem with a switch case in program and the debugger is messy has hell ( we use normal VI and gdb in our schoool to make it more diffiacult) any way i have a problom where for some unknown reason the debugger just skips a switch statment as if it wasent even there the rest... (2 Replies)
Discussion started by: gotenxds
2 Replies

9. Shell Programming and Scripting

Debugging functions

So here I have a simple function that I wish to debug. However, I am unable to debug the desired function even with set -o functrace enabled. Before resorting to asking this question, I had managed to find a possible solution that did not produce the desired results, which is located here. How... (5 Replies)
Discussion started by: BrandonD
5 Replies

10. Programming

Debugging a program written in two languages

Subject: Debugging a program written in two languages Platform: Linux (Kubuntu) I am trying to debug a C application with bindings to some simple functions written in Ada using the GNAT Programming Studio IDE (GPS). The main entry point is in C. The debugger is gdb. I managed to compile... (0 Replies)
Discussion started by: NiGHTS
0 Replies
pdb2mdb(1)						      General Commands Manual							pdb2mdb(1)

NAME
pdb2mdb - Program Database to Mono Debugging Symbol converter. SYNOPSIS
pdb2mdb pdb_file DESCRIPTION
This tool is used to convert debugging symbols generated by Microsoft's compilers into debugging symbols that can be consumed by Mono's runtime. Program Database files are files that end with the extension .pdb and are associated with a library or executable (a .dll or .exe file). This format was until recently not documented so Mono used its own file format for storing debugging information, the Mono debugging for- mat. Just like PDB files Mono Debugging information is stored in files that reside side-by-side with a program executable or a library. You can use the pdb2mdb tool to transform these PDB files into MDB files that Mono can then consume to debug programs or provide line-num- ber information for stack traces or exceptions. LICENSE
The pdb2mdb tool is released under the terms of the Microsoft Public License (MS-PL). JB Evain wrote the tool. The PDB reading support came from Microsoft Common Compiler Infrastructure. SEE ALSO
mono(1), mdb(1) WEB SITE
http://www.mono-project.com 23 April 2009 pdb2mdb(1)
All times are GMT -4. The time now is 03:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy