Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Help Needed: set up GDB Remote Debugger (arm-linux)
@ 2003-08-26 14:14 Balarama Krishna
  2003-08-26 14:17 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Balarama Krishna @ 2003-08-26 14:14 UTC (permalink / raw)
  To: gdb

Hi,

I am trying to compile the gdb 5.3 to set up a remote debugger on arm-linux
target. Host is i386-linux.

I went thru the following steps
1) ..gdb-5.3/configure --target=arm-linux --prefix=/usr/local/arm-gdb
2) make
3) make install
/*** "arm-linux-gdb" is formed in /usr/local/arm-gdb/bin ***/
4) cd gdb/gdbserver
5) chmod 755 configure
6) ./configure arm-linux

/*** The following is the output ***/
creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking host system type... arm-unknown-linux-gnu
checking target system type... arm-unknown-linux-gnu
checking build system type... arm-unknown-linux-gnu
checking for a BSD compatible install... /usr/bin/install -c
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sgtty.h... [root@bluetooth-new gdbserver]# export
CC=/data/lart/cross/bin/arm-linux-gcc
[root@bluetooth-new gdbserver]# ./configure arm-linux
loading cache ./config.cache
checking for gcc... /data/lart/cross/bin/arm-linux-gcc
checking whether the C compiler (/data/lart/cross/bin/arm-linux-gcc  )
works... yes
checking whether the C compiler (/data/lart/cross/bin/arm-linux-gcc  ) is a
cross-compiler... yes
checking whether we are using GNU C... yes
checking whether /data/lart/cross/bin/arm-linux-gcc accepts -g... yes
checking host system type... arm-unknown-linux-gnu
checking target system type... arm-unknown-linux-gnu
checking build system type... arm-unknown-linux-gnu
checking for a BSD compatible install... /usr/bin/install -c
checking how to run the C preprocessor...
/data/lart/cross/bin/arm-linux-gcc -E
checking for ANSI C header files... yes
checking for sgtty.h... yes
checking for termio.h... yes
checking for termios.h... yes
checking for sys/reg.h... no
checking for string.h... yes
checking for proc_service.h... no
checking for sys/procfs.h... yes
checking for thread_db.h... no
checking for linux/elf.h... yes
checking for unistd.h... yes
checking for lwpid_t in sys/procfs.h... no
checking for thread_db.h... no
checking for linux/elf.h... yes
checking for unistd.h... yes
checking for lwpid_t in sys/procfs.h... no
checking for psaddr_t in sys/procfs.h... no
checking for prgregset_t in sys/procfs.h... no
checking for prfpregset_t in sys/procfs.h... no
checking for elf_fpregset_t in sys/procfs.h... yes
checking for libthread_db... /lib/libthread_db.so.1
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h
/***************************************************************/


7) make

/*** The following error came ***/

/data/lart/cross/bin/arm-linux-gcc -c -Wall -g -O2    -I. -I. -I./../regform
ats -I./../../include -I../../bfd -I./../../bfd thread-db.c
thread-db.c:53: parse error before `*'
thread-db.c:53: warning: type defaults to `int' in declaration of
`thread_agent'
thread-db.c:53: warning: data definition has no type or storage class
thread-db.c:55: warning: type defaults to `int' in declaration of
`td_thrhandle_t'
thread-db.c:55: parse error before `*'
thread-db.c:58: parse error before `err'
thread-db.c: In function `thread_db_err_str':
thread-db.c:62: `err' undeclared (first use in this function)
thread-db.c:62: (Each undeclared identifier is reported only once
thread-db.c:62: for each function it appears in.)
thread-db.c:64: `TD_OK' undeclared (first use in this function)
thread-db.c:66: `TD_ERR' undeclared (first use in this function)
thread-db.c:68: `TD_NOTHR' undeclared (first use in this function)
thread-db.c:70: `TD_NOSV' undeclared (first use in this function)
thread-db.c:72: `TD_NOLWP' undeclared (first use in this function)
thread-db.c:74: `TD_BADPH' undeclared (first use in this function)
thread-db.c:76: `TD_BADTH' undeclared (first use in this function)
thread-db.c:78: `TD_BADSH' undeclared (first use in this function)
thread-db.c:80: `TD_BADTA' undeclared (first use in this function)
thread-db.c:82: `TD_BADKEY' undeclared (first use in this function)
thread-db.c:84: `TD_NOMSG' undeclared (first use in this function)
thread-db.c:86: `TD_NOFPREGS' undeclared (first use in this function)
thread-db.c:88: `TD_NOLIBTHREAD' undeclared (first use in this function)
thread-db.c:90: `TD_NOEVENT' undeclared (first use in this function)
thread-db.c:92: `TD_NOCAPAB' undeclared (first use in this function)
thread-db.c:94: `TD_DBERR' undeclared (first use in this function)
thread-db.c:96: `TD_NOAPLIC' undeclared (first use in this function)
thread-db.c:98: `TD_NOTSD' undeclared (first use in this function)
thread-db.c:100: `TD_MALLOC' undeclared (first use in this function)
thread-db.c:102: `TD_PARTIALREG' undeclared (first use in this function)
thread-db.c:104: `TD_NOXREGS' undeclared (first use in this function)
thread-db.c:65: warning: unreachable code at beginning of switch statement
thread-db.c: In function `thread_db_create_event':
thread-db.c:142: `td_event_msg_t' undeclared (first use in this function)
thread-db.c:142: parse error before `msg'
thread-db.c:143: `td_err_e' undeclared (first use in this function)
thread-db.c:155: `err' undeclared (first use in this function)
thread-db.c:155: warning: implicit declaration of function
`td_ta_event_getmsg'
thread-db.c:155: `msg' undeclared (first use in this function)
thread-db.c:156: `TD_OK' undeclared (first use in this function)
thread-db.c: In function `thread_db_enable_reporting':
thread-db.c:177: `td_thr_events_t' undeclared (first use in this function)
thread-db.c:177: parse error before `events'
thread-db.c:178: `td_notify_t' undeclared (first use in this function)
thread-db.c:179: `td_err_e' undeclared (first use in this function)
thread-db.c:182: warning: implicit declaration of function
`td_event_emptyset'
thread-db.c:182: `events' undeclared (first use in this function)
thread-db.c:183: warning: implicit declaration of function `td_event_addset'

thread-db.c:183: `TD_CREATE' undeclared (first use in this function)
thread-db.c:191: `err' undeclared (first use in this function)
thread-db.c:191: warning: implicit declaration of function `td_ta_set_event'
thread-db.c:192: `TD_OK' undeclared (first use in this function)
thread-db.c:200: warning: implicit declaration of function
`td_ta_event_addr'
thread-db.c:200: `notify' undeclared (first use in this function)
thread-db.c: At top level:
thread-db.c:230: warning: type defaults to `int' in declaration of
`td_thrhandle_t'
thread-db.c:230: parse error before `*'
thread-db.c: In function `maybe_attach_thread':
thread-db.c:232: `td_err_e' undeclared (first use in this function)
thread-db.c:232: parse error before `err'
thread-db.c:245: `ti_p' undeclared (first use in this function)
thread-db.c:277: `err' undeclared (first use in this function)
thread-db.c:277: warning: implicit declaration of function
`td_thr_event_enable'
thread-db.c:277: `th_p' undeclared (first use in this function)
thread-db.c:278: `TD_OK' undeclared (first use in this function)
thread-db.c: At top level:
thread-db.c:284: warning: type defaults to `int' in declaration of
`td_thrhandle_t'
thread-db.c:284: parse error before `*'
thread-db.c: In function `find_new_threads_callback':
thread-db.c:286: `td_thrinfo_t' undeclared (first use in this function)
thread-db.c:286: parse error before `ti'
thread-db.c:287: `td_err_e' undeclared (first use in this function)
thread-db.c:289: `err' undeclared (first use in this function)
thread-db.c:289: warning: implicit declaration of function `td_thr_get_info'
thread-db.c:289: `th_p' undeclared (first use in this function)
thread-db.c:289: `ti' undeclared (first use in this function)
thread-db.c:290: `TD_OK' undeclared (first use in this function)
thread-db.c:294: `TD_THR_UNKNOWN' undeclared (first use in this function)
thread-db.c:294: `TD_THR_ZOMBIE' undeclared (first use in this function)
thread-db.c: In function `thread_db_find_new_threads':
thread-db.c:305: `td_err_e' undeclared (first use in this function)
thread-db.c:305: parse error before `err'
thread-db.c:308: `err' undeclared (first use in this function)
thread-db.c:308: warning: implicit declaration of function `td_ta_thr_iter'
thread-db.c:309: `TD_THR_ANY_STATE' undeclared (first use in this function)
thread-db.c:309: `TD_THR_LOWEST_PRIORITY' undeclared (first use in this
function)
thread-db.c:310: `TD_SIGNO_MASK' undeclared (first use in this function)
thread-db.c:310: `TD_THR_ANY_USER_FLAGS' undeclared (first use in this
function)
thread-db.c:311: `TD_OK' undeclared (first use in this function)
thread-db.c: In function `thread_db_init':
thread-db.c:322: warning: implicit declaration of function `td_ta_new'
thread-db.c:325: `TD_NOLIBTHREAD' undeclared (first use in this function)
thread-db.c:329: `TD_OK' undeclared (first use in this function)
thread-db.c:327: warning: unreachable code at beginning of switch statement
make: *** [thread-db.o] Error 1

/*************************************************************************/

What looks like for me is compiler couldn't find thread_db.h file. Please
help me to make this build successful.


Thanks & Regards,
Balaram.


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

* Re: Help Needed: set up GDB Remote Debugger (arm-linux)
  2003-08-26 14:14 Help Needed: set up GDB Remote Debugger (arm-linux) Balarama Krishna
@ 2003-08-26 14:17 ` Daniel Jacobowitz
  2003-08-28  6:58   ` Problem using gdbserver Balarama Krishna
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2003-08-26 14:17 UTC (permalink / raw)
  To: gdb

On Tue, Aug 26, 2003 at 07:37:16PM +0530, Balarama Krishna wrote:
> What looks like for me is compiler couldn't find thread_db.h file.
> Please help me to make this build successful.

We can't help you with problems in your build system.  You have to
figure out why the compiler could not find thread_db.h.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Problem using gdbserver
  2003-08-26 14:17 ` Daniel Jacobowitz
@ 2003-08-28  6:58   ` Balarama Krishna
  2003-08-28 10:51     ` Balarama Krishna
  0 siblings, 1 reply; 4+ messages in thread
From: Balarama Krishna @ 2003-08-28  6:58 UTC (permalink / raw)
  To: gdb

Hi,

The set up for GDB as remote debugger (target=arm-linux, host=i386) is
successful.
The following is my sample test program "test.c"
/******************************************************/
#include <stdio.h>
int main()
{
        int i;
        printf("Hello World \n");
        for(i=0; i<3; i++)
                printf("Checking counter %d \n", i);
        return 0;
}
/***************************************************/

I compiled the above program using arm-linux-gcc with -g option and kept in
the target.
These are the following snap shots while debugging this program

/********************************* TARGET*********************** *****/
[root@Linux /mnt]$./gdbserver 107.108.3.197:2020 test
Process test created; pid = 227
Remote debugging from host 107.108.4.244
Hellotest (227): undefined instruction: pc=02000354
Code: e59f003c ebffffc8 (e7ffdefe) e50b3010 e51b3010
 World
test (227): undefined instruction: pc=02000358
Code: ebffffc8 e3a03000 (e7ffdefe) e51b3010 e3530002

Child terminated with signal = 4

Child terminated with signal = 0x4
GDBserver exiting
[root@Linux /mnt]$

/**** ******************************HOST********************* ******/
(gdb) target remote 107.108.3.197:2020
Remote debugging using 107.108.3.197:2020
0x40002560 in ?? ()
(gdb) symbol-file test
Reading symbols from test...done.
(gdb) list
1       #include <stdio.h>
2
3       int main()
4       {
5
6               int i;
7
8               printf("Hello World \n");
9
10
(gdb) list
11              for(i=0; i<3; i++)
12                      printf("Checking counter %d \n", i);
13
14              return 0;
15      }
16
(gdb) break 11
Breakpoint 1 at 0x2000354: file test.c, line 11.
(gdb) cont
Continuing.

Breakpoint 1, main () at test.c:11
11              for(i=0; i<3; i++)
(gdb) n

Program received signal SIGILL, Illegal instruction.
0x02000358 in main () at test.c:11
11              for(i=0; i<3; i++)
(gdb) n

Program terminated with signal SIGILL, Illegal instruction.
The program no longer exists.
(gdb)

/***************************************************************************
******/

I don't know why things are going wrong. Am I missing some thing?? One can
observe that "Hello World" is printed seperately on the Target. Any kind of
help is appreciated in this regard.

Thanks & Regards,
Balaram.



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

* Re: Problem using gdbserver
  2003-08-28  6:58   ` Problem using gdbserver Balarama Krishna
@ 2003-08-28 10:51     ` Balarama Krishna
  0 siblings, 0 replies; 4+ messages in thread
From: Balarama Krishna @ 2003-08-28 10:51 UTC (permalink / raw)
  To: gdb

The problem is solved by using the command "(gdb) file <executable-name>"
instead of "(gdb) symbol-file <executable-name>" and by interchanging the
order of execution of this command and "(gdb) target remote
107.108.3.197:2020"

> Hi,
>
> The set up for GDB as remote debugger (target=arm-linux, host=i386) is
> successful.
> The following is my sample test program "test.c"
> /******************************************************/
> #include <stdio.h>
> int main()
> {
>         int i;
>         printf("Hello World \n");
>         for(i=0; i<3; i++)
>                 printf("Checking counter %d \n", i);
>         return 0;
> }
> /***************************************************/
>
> I compiled the above program using arm-linux-gcc with -g option and kept
in
> the target.
> These are the following snap shots while debugging this program
>
> /********************************* TARGET*********************** *****/
> [root@Linux /mnt]$./gdbserver 107.108.3.197:2020 test
> Process test created; pid = 227
> Remote debugging from host 107.108.4.244
> Hellotest (227): undefined instruction: pc=02000354
> Code: e59f003c ebffffc8 (e7ffdefe) e50b3010 e51b3010
>  World
> test (227): undefined instruction: pc=02000358
> Code: ebffffc8 e3a03000 (e7ffdefe) e51b3010 e3530002
>
> Child terminated with signal = 4
>
> Child terminated with signal = 0x4
> GDBserver exiting
> [root@Linux /mnt]$
>
> /**** ******************************HOST********************* ******/
> (gdb) target remote 107.108.3.197:2020
> Remote debugging using 107.108.3.197:2020
> 0x40002560 in ?? ()
> (gdb) symbol-file test
> Reading symbols from test...done.
> (gdb) list
> 1       #include <stdio.h>
> 2
> 3       int main()
> 4       {
> 5
> 6               int i;
> 7
> 8               printf("Hello World \n");
> 9
> 10
> (gdb) list
> 11              for(i=0; i<3; i++)
> 12                      printf("Checking counter %d \n", i);
> 13
> 14              return 0;
> 15      }
> 16
> (gdb) break 11
> Breakpoint 1 at 0x2000354: file test.c, line 11.
> (gdb) cont
> Continuing.
>
> Breakpoint 1, main () at test.c:11
> 11              for(i=0; i<3; i++)
> (gdb) n
>
> Program received signal SIGILL, Illegal instruction.
> 0x02000358 in main () at test.c:11
> 11              for(i=0; i<3; i++)
> (gdb) n
>
> Program terminated with signal SIGILL, Illegal instruction.
> The program no longer exists.
> (gdb)
>
>
/***************************************************************************
> ******/
>
> I don't know why things are going wrong. Am I missing some thing?? One can
> observe that "Hello World" is printed seperately on the Target. Any kind
of
> help is appreciated in this regard.
>
> Thanks & Regards,
> Balaram.
>
>
>


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

end of thread, other threads:[~2003-08-28 10:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-26 14:14 Help Needed: set up GDB Remote Debugger (arm-linux) Balarama Krishna
2003-08-26 14:17 ` Daniel Jacobowitz
2003-08-28  6:58   ` Problem using gdbserver Balarama Krishna
2003-08-28 10:51     ` Balarama Krishna

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