C++11 debugging

I’m trying to make a C++11 application that uses Xlib to draw text on the screen. I have installed and updated OpenSUSE 12.2. My program is having a segmentation fault and I can’t seem to narrow it down to one thing.

(gdb) bt
#0 0xb73309da in getenv () from /lib/libc.so.6
#1 0xb7608f2c in XOpenDisplay () from /usr/lib/libX11.so.6
#2 0x0804c01a in rcmp::window::draw (this=0xbf92867c) at window.cpp:60
#3 0x0804bb48 in main () at main.cpp:49

It’s my understanding that if there were debug versions of the libX11-6 package, or I could get the source code and compile my own debug version that I could see what variables are getting passed to getenv and debug the problem.

I can’t find a package named libX11-debug or libX11-6-debug.

I also can’t find a srcpackage for this.
sudo zypper search -t srcpackage libX11-6
sudo zypper search -t srcpackage libX11
sudo zypper search -t srcpackage | grep -i lib

How do I go about debugging this issue?

Hi
Check your repositories via YaST or zypper, the debug ones are disabled by default.

Or check the software search and enable (click on the spanner to the right) the extra options;
software.opensuse.org: Search
Check the subpackages link :wink:

That was it. Thanks!

No let’s see if I can actually find the bug(s) now.

I found the bug, Yea!

int a[100];
sizeof(a); // does not get the array size.

I knew that… :stuck_out_tongue: