Local variables in debug view

Gunther Piez gpiez at web.de
Wed May 26 11:15:08 BST 2010


On Wednesday 26 May 2010 10:08:35 Vladimir Prus wrote:
> > Also vector types (like __v2di, __v16qi and the like) are not correctly
> > displayed a all, but as arrays with length 0.
> 
> Could you post a minimal example? I don't even know about these types.

Unfortunately in a minimal example it works ^^
Nevertheless, here it is, so you get an idea what I am talking about:

---

#include <emmintrin.h>

int main(int argc, char **argv) {
	__v2di a = { 0x1234567890abcdef, 0x1234567890abcdef };
	__v16qi b = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
	__v4sf c = { 0.1, 0.2, 0.3, 0.4 };
	
	return 0;
}

---

This are x86 specific vectors (aka SSE), but there exist many others, like 
altivec etc. GDB knows about them all.

Now in the Variable View you get them displayed as arrays of the basic types, 
which is fine (v16qi means "vector of 16 qi, which are "quarter integers" in 
gcc, which are simply bytes and so on).

In a real program I get this variables all as arrays of length 0. Interesting 
enough, I can get the single elements with adding something like "b[5]" to the 
watch variables.

- Gunther




More information about the KDevelop mailing list