C++

HI! Im Afaq
Im new to open suse!
Im using g++ in Konsole for C++ programming
and I wanna use debuggers in that
and the break points
can somebody help me?:slight_smile:

Welcome to these Forums.

It would have been better when you had posted this in the Programming/Scripting subforum. That is where programmers look if they can help.
Also is bit more telling title then “C++” can help you getting the right people to read your post. Something like: “is there a debugger for C++”.

In any case, to help you , I will move this to The other section.

This is now in the Programming/Scripting subforum.

hcvv wrote:
> This is now in the Programming/Scripting subforum.

What is now in this subforum?

All I see is two messages from you.

When you move items, do they appear on NNTP?

I am not that good in NNTP, but at least my first post should have gone there (or not?) warning you that this would be moved.
And “now” is between 21-01-11 15:45 and 21-01-11 15:46 MET as those are the date/time tags I see on those two posts.

EDIT: I read and reread your post. Could it be that you do not have post #1 of this thread? I do see posts#1 (from Afaq123 the OP) and my two posts before and after the move, then your post #4.

I use devc++ with wine for programming.

ddd is the graphical user interface to gdb.

zypper info ddd

I do not see what this has to do with my post about an answer to dhj-novell about what happened during the move of this thread ?!?!?

When this is an answer to the original request of Afaq123, I do not see why you cite my post above it ?!?!?

When that was a slip of the mouse and this is an answer to Afaq123, I do not see why he should revert to using Wine when he wants to program in Linux/openSUSE.

hcvv wrote:
> stamostolias;2281671 Wrote:
>> I use devc++ with wine for programming.
>
> I do not see what this has to do with my post about an answer to
> dhj-novell about what happened during the move of this thread ?!?!?

It does illustrate though that you needed to quote the OP because his
post is not otherwise visible to those of us reading NNTP (or wouldn’t
be had please_try_again not helpfully quoted it).

On Mon, 24 Jan 2011 12:06:02 +0000, hcvv wrote:

> I am not that good in NNTP, but at least my first post should have gone
> there (or not?) warning you that this would be moved.

It did, I didn’t see it when I replied (my apologies). Posts moved in
the forums aren’t moved in NNTP, so quoting the root post is generally a
good idea so those of us using NNTP can see the original question.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Hi there, as was previously mentioned ddd is a graphical debugger for gdb. gdb is installed with gcc and g++ and you can start using it right away in command line mode. It is quite powerful, but there is some learning to it. There are many sites though that have tutorials on gdb, two which I have found helpful are:

Linux software debugging with GDB

Linux Debugging with gdb Guide - Red Hat Enterprise Linux 4

I also have a few notes gdb debugging tools at Graphical Debugging Tools - Lyceum

Good luck with you C++ programming!

Cheers,
Lews Therin

You can also use the Netbeans IDE Welcome to NetBeans. It allows you to incorporate C/C++ using gcc/gcc+ etc right into the IDE. This will also allow you to debug your applications. It also offers code completion, which is quite handy.

Im using g++ in Konsole for C++ programming and I wanna use debuggers in that and the break points

In addition to gdb/ddd which have already been mentioned, have a look at valgrind which is especially useful to find any memory leaks.

No one mentioned this I don’t think, but you have to compile with the -g flag. Probably easiest to use g++ for compiling (and especially linking) C++ code, so make sure you are using “g++ -g” to compile, and “g++” as your linker. It’s possible to use “gcc” too, but g++ sets a few useful options at the linker stage and treats everything as C++ code, regardless of extension, which is preferable until you get a chunk of code that will only compile correctly if treated as straight C, then things get a bit tougher to integrate.

Also, I had heard of valgrind but based on the last post decided to take it for a test drive.

A couple of experiences:

  1. There is a packaging error: the description in YAST says that for the valgrind package states “There is also complete documentation in the /usr/share/doc/packages/valgrind/ directory.” In that directory there is a README that says that “A comprehensive user guide is supplied. Point your browser at
    $PREFIX/share/doc/valgrind/manual.html, where $PREFIX is whatever you
    specified with --prefix= when building.” There is no “manual.html” in the documentation directory for valgrind.

  2. It is quantifiable–ATI’s proprietary video driver, fglrx, is a total mess. A simple tetris clone game of mine that uses SDL and opengl broke valgrind’s default 10,000,000 error cap on startup, with all printed errors coming from fglrx_dri.so–

$>valgrind ./blockfall
==13560== Memcheck, a memory error detector
==13560== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==13560== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==13560== Command: ./blockfall
==13560== 
Initializing SDL.
Audio, timer and video initialized correctly
==13560== Syscall param ioctl(generic) points to uninitialised byte(s)
==13560==    at 0x5C19E87: ioctl (in /lib64/libc-2.11.2.so)
==13560==    by 0x4063A14: ukiCreateContext (in /usr/lib64/libatiuki.so.1.0)
==13560==    by 0xC033C3D: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==    by 0x500000002CF: ???
==13560==    by 0x7ED01E7: ???
==13560==    by 0x7DBA52F: ???
==13560==    by 0xC08CF31: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==  Address 0x7feff4e08 is on thread 1's stack
==13560== 
==13560== Conditional jump or move depends on uninitialised value(s)
==13560==    at 0xC08DDAF: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==    by 0xC08D66F: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==    by 0xC086F2C: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560== 
==13560== Conditional jump or move depends on uninitialised value(s)
==13560==    at 0xBEDD85E: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==    by 0xBEDB2DF: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==    by 0xBEDB2BF: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==    by 0xBEDB2EF: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==    by 0xBEDB1CF: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==    by 0xBEDB12F: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==    by 0xBEDB13F: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==    by 0xBEDB29F: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==    by 0xBEDB28F: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560== 
==13560== Invalid write of size 1
==13560==    at 0x4C2781D: memcpy (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13560==    by 0xBED967F: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==  Address 0x7fbd5358dfff is not stack'd, malloc'd or (recently) free'd
==13560== 
==13560== Invalid write of size 1
==13560==    at 0x4C27827: memcpy (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13560==    by 0xBED967F: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==  Address 0x7fbd5358dffe is not stack'd, malloc'd or (recently) free'd
==13560== 
==13560== Invalid write of size 1
==13560==    at 0x4C27832: memcpy (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13560==    by 0xBED967F: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==  Address 0x7fbd5358dffd is not stack'd, malloc'd or (recently) free'd
==13560== 
==13560== Invalid write of size 1
==13560==    at 0x4C2783D: memcpy (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13560==    by 0xBED967F: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==  Address 0x7fbd5358dffc is not stack'd, malloc'd or (recently) free'd
==13560== 
==13560== Invalid write of size 1
==13560==    at 0x4C2781D: memcpy (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13560==    by 0xBED9694: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==  Address 0x7fbd5358dfff is not stack'd, malloc'd or (recently) free'd
==13560== 
==13560== Invalid write of size 1
==13560==    at 0x4C27827: memcpy (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13560==    by 0xBED9694: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==  Address 0x7fbd5358dffe is not stack'd, malloc'd or (recently) free'd
==13560== 
==13560== Invalid write of size 1
==13560==    at 0x4C27832: memcpy (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13560==    by 0xBED9694: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==  Address 0x7fbd5358dffd is not stack'd, malloc'd or (recently) free'd
==13560== 
==13560== Invalid write of size 1
==13560==    at 0x4C2783D: memcpy (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13560==    by 0xBED9694: ??? (in /usr/lib64/dri/fglrx_dri.so)
==13560==  Address 0x7fbd5358dffc is not stack'd, malloc'd or (recently) free'd
==13560== 
==13560== 
==13560== More than 10000000 total errors detected.  I'm not reporting any more.
==13560== Final error counts will be inaccurate.  Go fix your program!
==13560== Rerun with --error-limit=no to disable this cutoff.  Note
==13560== that errors may occur in your program without prior warning from
==13560== Valgrind, because errors are no longer being displayed.
==13560== 
len_mult ok for now, continue testing..
Sucks to be you, loser!
Level:	8
Score:	397
Lines:	70
Frames per second = 35.343300
==13560== 
==13560== HEAP SUMMARY:
==13560==     in use at exit: 54,425,428 bytes in 1,233 blocks
==13560==   total heap usage: 847,118 allocs, 845,885 frees, 2,502,759,806 bytes allocated
==13560== 
==13560== LEAK SUMMARY:
==13560==    definitely lost: 21,240 bytes in 67 blocks
==13560==    indirectly lost: 336,960 bytes in 39 blocks
==13560==      possibly lost: 522,085 bytes in 60 blocks
==13560==    still reachable: 53,545,143 bytes in 1,067 blocks
==13560==         suppressed: 0 bytes in 0 blocks
==13560== Rerun with --leak-check=full to see details of leaked memory
==13560== 
==13560== For counts of detected and suppressed errors, rerun with: -v
==13560== Use --track-origins=yes to see where uninitialised values come from
==13560== ERROR SUMMARY: 10000000 errors from 11 contexts (suppressed: 63 from 6)

Telecom job - C++ Software Engineer
New York, United States
Vero Solutions

Experience: Required experience/knowledge:

  • 1-5 years software development
  • Good programming skills in C++
  • Threading models (Pthreads or OpenMP),
  • Linux environment experience – know how kernel modules, memory allocation and process scheduling work within such an environment and how to control them,
  • Enthusiasm working with the latest technology and willing to try or think a little different as that might just be the best solution!
    Desired experience/knowledge:
  • Previously working for an Independent Software Vendor (ISV)
  • Knowledge about the telecommunications industry.
  • RDBMS experience (Oracle/MySQL/etc.)

Details:
C++ Software Engineer, job company Software & IT, Telecom Jobs & wireless jobs in the world | TelecomWirelessJobs.com