how to build a connection using gdb stub???

Naster rtemswq at yahoo.com.cn
Tue Apr 9 08:27:18 UTC 2002


Hello all:
I want to crossing debug base_sp using gdb stub,
but i can not build a connection between host and
target successfully.

Host : 
operation system:   Redhat linux 7.2 
cpu: Inter pentium4,   1.5GHZ
Target:
cpu: inter pentium      166MHZ 

And i have connected these two computers with a serial
line(serial port com2 to com2).

On the target,i have downloaded and run base_sp.exe
with grub stage2,and then base_sp.exe stopped at
breakpoint, correctly.
On the host ,in base_sp directory, i run :
i386-rtems-gdb --nx o-optimize/base_sp.exe,and then i
received messages " Ignoring packet error ,continuing
....
couldn't establish connection to remote target
Malformed response to offset query,time out"

I modified base_sp soruce code as below:
##### init.c  #####
#define CONFIGURE_INIT
#include "system.h"
#include <stdio.h>
#include <uart.h>    /*modified*/
#define ARGUMENT 0

rtems_task Init(
  rtems_task_argument argument
)
{ 
  extern int
BSPConsolePort; /*modified*/                          

  rtems_name        task_name;
  rtems_id          tid;
  rtems_status_code status;

if(BSPConsolePort!=BSP_UART_COM2)
{i386_stub_glue_init(BSP_UART_COM2);
}
else
{i386_stub_glue_init(BSP_UART_COM1);
}

set_debug_traps();/*modified*/
i386_stub_glue_init_breakin();/*modified*/

task_name = rtems_build_name( 'T', 'A', '1', ' ' );
status = rtems_task_create( task_name, 1,
RTEMS_MINIMUM_STACK_SIZE,
             RTEMS_INTERRUPT_LEVEL(0),
RTEMS_DEFAULT_ATTRIBUTES, &tid );
status = rtems_task_start( tid, Application_task,
ARGUMENT );
status = rtems_task_delete( RTEMS_SELF );
}

#######  apptask.c  ######
#include "system.h"
#include <stdio.h>

rtems_task Application_task(
  rtems_task_argument argument
)
{
  rtems_id          tid;
  rtems_status_code status;
  status = rtems_task_ident( RTEMS_SELF,
RTEMS_SEARCH_ALL_NODES, &tid );
  printf( "\nApplication task was invoked with
argument (%d) "
          "and has id of 0x%x\n", argument, tid );
  
   breakpoint(); /*modified*/
   printf( "\n*** END OF SAMPLE SINGLE PROCESSOR
APPLICATION ***\n" );
  exit( 0 );
}

Thanks for any help.
                                             David

_________________________________________________________
Do You Yahoo!? 
到世界杯主题公园玩一玩,赢取世界杯门票乐一乐。
http://cn.worldcup.yahoo.com/



More information about the users mailing list