Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gdb cross compilation, error from gdb/tui module.... please help.
@ 2010-10-27 15:36 paawan oza
  2010-10-27 16:14 ` Baurzhan Ismagulov
  0 siblings, 1 reply; 13+ messages in thread
From: paawan oza @ 2010-10-27 15:36 UTC (permalink / raw)
  To: gdb

Hi,

I am working on reversible debugging on arm....at the first step there are 
couple of hurdles, please help.

-> I have donwload arm tool chain from
http://www.codesourcery.com/sgpp/lite/arm/portal/package3696/public/arm-none-linux-gnueabi/arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2


-> tried to compile gdb (at the first point it threw 'termcap library not 
found')

-> so I cross compiled ncurses-5.5 and kept libraries along with other arm 
libraries.

-> and gdb went on with more compilation stuffs and finally it threw following.

arm-none-linux-gnueabi-gcc -g -O2   -I. -I. -I./common -I./config 
-DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode 
-I./../opcodes/.. -I./../readline/.. -I../bfd -I./../bfd -I./../include 
-I../libdecnumber -I./../libdecnumber  -I./gnulib -Ignulib  -DMI_OUT=1 -DTUI=1  
-Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral 
-Wno-pointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch 
-Wno-char-subscripts  -c -o mi-getopt.o -MT mi-getopt.o -MMD -MP -MF 
.deps/mi-getopt.Tpo ./mi/mi-getopt.c
arm-none-linux-gnueabi-gcc -g -O2   -I. -I. -I./common -I./config 
-DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode 
-I./../opcodes/.. -I./../readline/.. -I../bfd -I./../bfd -I./../include 
-I../libdecnumber -I./../libdecnumber  -I./gnulib -Ignulib  -DMI_OUT=1 -DTUI=1  
-Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral 
-Wno-pointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch 
-Wno-char-subscripts  -c -o tui-command.o -MT tui-command.o -MMD -MP -MF 
.deps/tui-command.Tpo ./tui/tui-command.c
In file included from ./tui/tui-command.c:26:
./tui/tui-data.h:38: error: expected specifier-qualifier-list before 'WINDOW'
In file included from ./tui/tui-command.c:27:
./tui/tui-win.h:40: error: expected '=', ',', ';', 'asm' or '__attribute__' 
before 'tui_border_ulcorner'
./tui/tui-win.h:41: error: expected '=', ',', ';', 'asm' or '__attribute__' 
before 'tui_border_urcorner'
./tui/tui-win.h:42: error: expected '=', ',', ';', 'asm' or '__attribute__' 
before 'tui_border_lrcorner'
./tui/tui-win.h:43: error: expected '=', ',', ';', 'asm' or '__attribute__' 
before 'tui_border_llcorner'
./tui/tui-win.h:44: error: expected '=', ',', ';', 'asm' or '__attribute__' 
before 'tui_border_vline'
./tui/tui-win.h:45: error: expected '=', ',', ';', 'asm' or '__attribute__' 
before 'tui_border_hline'
./tui/tui-command.c: In function 'tui_dispatch_ctrl_char':
./tui/tui-command.c:80: error: 'WINDOW' undeclared (first use in this function)
./tui/tui-command.c:80: error: (Each undeclared identifier is reported only once
./tui/tui-command.c:80: error: for each function it appears in.)
./tui/tui-command.c:80: error: 'w' undeclared (first use in this function)
./tui/tui-command.c:80: error: 'struct tui_gen_win_info' has no member named 
'handle'
./tui/tui-command.c:85: warning: implicit declaration of function 'wgetch'
./tui/tui-command.c:86: error: 'ERR' undeclared (first use in this function)
./tui/tui-command.c:93: error: 'KEY_PPAGE' undeclared (first use in this 
function)
./tui/tui-command.c:95: error: 'KEY_NPAGE' undeclared (first use in this 
function)
./tui/tui-command.c:113: error: 'KEY_DOWN' undeclared (first use in this 
function)
./tui/tui-command.c:114: error: 'KEY_SF' undeclared (first use in this function)
./tui/tui-command.c:117: error: 'KEY_UP' undeclared (first use in this function)
./tui/tui-command.c:118: error: 'KEY_SR' undeclared (first use in this function)
./tui/tui-command.c:121: error: 'KEY_RIGHT' undeclared (first use in this 
function)
./tui/tui-command.c:124: error: 'KEY_LEFT' undeclared (first use in this 
function)
make[2]: *** [tui-command.o] Error 1
make[2]: Leaving directory `/home/oza/mk_patch/gdb/gdb-7.2/gdb'
make[1]: *** [all-gdb] Error 2
make[1]: Leaving directory `/home/oza/mk_patch/gdb/gdb-7.2'
make: *** [all] Error 2



1) does it have something to do with the compaitibility with ncurses library 
version ?
folowing is the list of ncurses arm libaries which were copied.
libform.a  libform_g.a  libmenu.a  libmenu_g.a  libncurses++.a  libncurses.a  
libncurses_g.a  libpanel.a  libpanel_g.a

please help..

Regards,
Oza.


      


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: gdb cross compilation, error from gdb/tui module
@ 2010-10-28 15:14 paawan oza
  0 siblings, 0 replies; 13+ messages in thread
From: paawan oza @ 2010-10-28 15:14 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Baurzhan Ismagulov, gdb

now I have used -T gneric.ld option with arm-none-abi tool chain, in that case 
it compiles ok but gdb still hangs.
log as below.

linux-ghot:/home/oza/mk_patch/gdb/gdb-7.2/gdb # arm-none-eabi-gcc -T generic.ld 
-g ./test.c -o test
/home/oza/mk_patch/packages/arm-2009q3/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/libcs3unhosted.a(unhosted-_close.o):
 warning: IO function '_close' used
/home/oza/mk_patch/packages/arm-2009q3/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/libcs3unhosted.a(unhosted-_fstat.o):
 warning: IO function '_fstat' used
/home/oza/mk_patch/packages/arm-2009q3/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/libcs3unhosted.a(unhosted-isatty.o):
 warning: IO function '_isatty' used
/home/oza/mk_patch/packages/arm-2009q3/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/libcs3unhosted.a(unhosted-_lseek.o):
 warning: IO function '_lseek' used
/home/oza/mk_patch/packages/arm-2009q3/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/libcs3unhosted.a(unhosted-_read.o):
 warning: IO function '_read' used
/home/oza/mk_patch/packages/arm-2009q3/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/libcs3unhosted.a(unhosted-_write.o):
 warning: IO function '_write' used

linux-ghot:/home/oza/mk_patch/gdb/gdb-7.2/gdb # file ./test
./test: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not 
stripped

linux-ghot:/home/oza/mk_patch/gdb/gdb-7.2/gdb # ./gdb
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-eabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Setting up the environment for debugging gdb.
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; 
input not from terminal]
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; 
input not from terminal]
.gdbinit:8: Error in sourced command file:
Argument required (one or more breakpoint numbers).
(gdb) target sim
Connected to the simulator.
(gdb) file ./test
Reading symbols from /home/oza/mk_patch/gdb/gdb-7.2/gdb/test...done.
(gdb) load
Loading section .text, size 0x2cb4 vma 0x0
Loading section .eh_frame, size 0x4 vma 0x2cb4
Loading section .ARM.exidx, size 0x8 vma 0x2cb8
Loading section .rodata, size 0x60 vma 0x2cc0
Loading section .data, size 0x850 vma 0x2d20
Start address 0x40
Transfer rate: 109440 bits in <1 sec.
(gdb) run
Starting program: /home/oza/mk_patch/gdb/gdb-7.2/gdb/test

<here gdb hangs>

Regards,
Oza.

----- Original Message ----

From: paawan oza <paawan1982@yahoo.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: Baurzhan Ismagulov <ibr@radix50.net>; gdb@sourceware.org
Sent: Thu, October 28, 2010 7:36:39 PM
Subject: Re: gdb cross compilation, error from gdb/tui module

but it is bare metal tool chain, I tried to compile sample application with that 

but got linker error as follows.

/home/oza/mk_patch/gdb/gdb-7.2/gdb # arm-none-eabi-gcc -g ./test.c
/home/oza/mk_patch/packages/arm-2009q3/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/bin/ld:

warning: cannot find entry symbol _start; defaulting to 00008018
/home/oza/mk_patch/packages/arm-2009q3/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/libc.a(lib_a-sbrkr.o):

In function `_sbrk_r':
sbrkr.c:(.text+0x18): undefined reference to `_sbrk'
/home/oza/mk_patch/packages/arm-2009q3/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/libc.a(lib_a-writer.o):

In function `_write_r':
writer.c:(.text+0x20): undefined reference to `_write'
/home/oza/mk_patch/packages/arm-2009q3/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/libc.a(lib_a-closer.o):

In function `_close_r':
closer.c:(.text+0x18): undefined reference to `_close'
/home/oza/mk_patch/packages/arm-2009q3/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/libc.a(lib_a-fstatr.o):

In function `_fstat_r':
fstatr.c:(.text+0x1c): undefined reference to `_fstat'
/home/oza/mk_patch/packages/arm-2009q3/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/libc.a(lib_a-isattyr.o):

In function `_isatty_r':
isattyr.c:(.text+0x18): undefined reference to `_isatty'
/home/oza/mk_patch/packages/arm-2009q3/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/libc.a(lib_a-lseekr.o):

In function `_lseek_r':
lseekr.c:(.text+0x20): undefined reference to `_lseek'
/home/oza/mk_patch/packages/arm-2009q3/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/libc.a(lib_a-readr.o):

In function `_read_r':
readr.c:(.text+0x20): undefined reference to `_read'
collect2: ld returned 1 exit status
8




----- Original Message ----
From: Pedro Alves <pedro@codesourcery.com>
To: paawan oza <paawan1982@yahoo.com>
Cc: Baurzhan Ismagulov <ibr@radix50.net>; gdb@sourceware.org
Sent: Thu, October 28, 2010 6:41:37 PM
Subject: Re: gdb cross compilation, error from gdb/tui module

On Thursday 28 October 2010 13:46:41, paawan oza wrote:
> same results with arm-eabi
...
> linux-ghot:/home/oza/mk_patch/gdb/gdb-7.2/gdb # arm-none-linux-gnueabi-gcc -g 
...

But I suggested:

"I suppose you'll get better results with a compiler that matches
your target..."

"... and to use the arm-eabi compiler, not the arm-linux-gnueabi compiler."

-- 
Pedro Alves


      


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-10-28 15:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-27 15:36 gdb cross compilation, error from gdb/tui module.... please help paawan oza
2010-10-27 16:14 ` Baurzhan Ismagulov
2010-10-28  4:02   ` gdb cross compilation, error from gdb/tui module.... please help. <readline comilation error after disabling tui> paawan oza
2010-10-28  9:43     ` gdb cross compilation, error from gdb/tui module paawan oza
2010-10-28 10:18       ` Pedro Alves
2010-10-28 11:13         ` paawan oza
2010-10-28 11:27           ` Pedro Alves
2010-10-28 11:57             ` paawan oza
2010-10-28 12:11               ` Pedro Alves
2010-10-28 12:46                 ` paawan oza
2010-10-28 13:11                   ` Pedro Alves
2010-10-28 14:06                     ` paawan oza
2010-10-28 15:14 paawan oza

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox