[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[microblaze-uclinux] gdb off by 4 bytes
I'm having a problem with gdb lying to me. If I have this:
#include <stdio.h>
static char *MyStrings[] = {"string1", "string2", "string3"};
char *Strings2[] = {"string2_1", "string2_2"};
int
main ()
{
printf ("MyStrings = %x\n", MyStrings);
printf ("MyStrings[0] = %s\n", MyStrings[0]);
printf ("Strings2 = %x\n", Strings2);
printf ("Strings2[0] = %s\n", Strings2[0]);
getchar ();
return 0;
}
It prints:
MyStrings = 459ee170
MyStrings[0] = string1
Strings2 = 459ee168
Strings2[0] = string2_1
But gdb reports:
(gdb) p &MyStrings
$1 = (char *(*)[3]) 0x459ee16c
(gdb) p &Strings2
$2 = (char *(*)[2]) 0x459ee168
gdb reports the static char* array off by -4 bytes. This is with the
2.6 kernel and these compile options:
microblaze-uclinux-gcc -c -Os -g -fomit-frame-pointer -pipe
-fno-common -fno-builtin -Wall -mno-xl-soft-mul -mno-xl-soft-div
-mxl-barrel-shift -mcpu=v6.00.b -DEMBED -I/<path>/petalinux-dist
-I/<path>/petalinux-dist/include -I/<path>/petalinux-dist/include
-Dlinux -D__linux__ -Dunix -D__uClinux__ -DLINUX -o test3.o test3.c
microblaze-uclinux-gcc -L/<path>/petalinux-dist/lib -mno-xl-soft-mul
-mno-xl-soft-div -mxl-barrel-shift -mcpu=v6.00.b -o test3 test3.o
Any I run:
$ microblaze-uclinux-gdb -nw test3.gdb
GNU gdb 5.3PetaLinux 0.20 Build -rc1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=microblaze-uclinux"...
Anyone have a suggestion?
Thanks,
Jim
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/