I just got PPCBoot, Linux, RTLinux ported to a custom MPC860 board and
have one
remaining problem.  The application (ported from pSOS) is a bit large to
keep in
one source file.  When I try to debug a module that is partially linked
(ld -r),
however; gdb is unable to get line number information.  To demonstrate I
split
the hello.c file into the following

/* hello_module.c */

#include <rtl.h>
#include <rtl_conf.h>
#include <rtl_debug.h>

#include <time.h>
#include <pthread.h>

int hello_debug = 0;
MODULE_PARM( hello_debug, "i" );
void * start_routine( void * );

pthread_t thread;

int init_module(void) {
        return pthread_create (&thread, NULL, start_routine, ( void * )
6);
}

void cleanup_module(void) {
        pthread_delete_np (thread);
}

and

/* hello_start.c */

#include <rtl_debug.h>

#include <time.h>
#include <pthread.h>

extern int hello_debug;
extern pthread_t thread;

void * start_routine(void *arg)
{
        struct sched_param p;
        p . sched_priority = 1;
        pthread_setschedparam (pthread_self(), SCHED_FIFO, &p);

        pthread_make_periodic_np (pthread_self(), gethrtime(),
500000000);

    if( 0 != hello_debug ) { breakpoint( ); }

        while (1) {
                pthread_wait_np ();
                rtl_printf("Got Here!\n");
        }
        return 0;
}

Which I build as follows

powerpc-linux-gcc -g -O2 -D__powerpc__ -fsigned-char -msoft-float -pipe
-fno-builtin -ffixed-r2 -Wno-uninitialized -mmultiple -mstring -mcpu=860
-D__KERNEL__ -Wall -Wstrict-prototypes -D__RTL__ -D_LOOSE_KERNEL_NAMES
-I/usr/local/powerpc/src/linux-2.4.4-2001-05-12/include
-I/usr/local/powerpc/src/rtlinux_3_0/include
-I/usr/local/powerpc/src/rtlinux_3_0/include/compat
-I/usr/local/powerpc/src/rtlinux_3_0/include/posix -DMODULE -c -o
hello_module.o
hello_module.c

powerpc-linux-gcc -g -O2 -D__powerpc__ -fsigned-char -msoft-float -pipe
-fno-builtin -ffixed-r2 -Wno-uninitialized -mmultiple -mstring -mcpu=860
-D__KERNEL__ -Wall -Wstrict-prototypes -D__RTL__ -D_LOOSE_KERNEL_NAMES
-I/usr/local/powerpc/src/linux-2.4.4-2001-05-12/include
-I/usr/local/powerpc/src/rtlinux_3_0/include
-I/usr/local/powerpc/src/rtlinux_3_0/include/compat
-I/usr/local/powerpc/src/rtlinux_3_0/include/posix -c -o hello_start.o
hello_start.c

powerpc-linux-ld -g -static -r -o hello2.o hello_module.o hello_start.o

I then
        insmod /hello2.o hello_debug=1
rtl_debug.o responds with
        RTLinux Debugger Loaded (http://www.fsmlabs.com/)
I use netcat to connect to gdb on the host
        nc -v -l -p 6000 </dev/rtf10 >/dev/rtf10
and on the host
        powerpc-linux-gdb
        (gdb) file hello2.o
        Reading symbols from hello2.o...done.
        (gdb) target remote 192.168.1.85:6000
        Remote debugging using 192.168.1.85:6000
        [Switching to thread -1069749760]
        0xc584a130 in start_routing ()
        (gdb) step
        Single stepping until exit from function start_routine,
        which has no line number information.

The thread stops (only one rtl_printf) but the debugger continues to
wait...

I am using rtlinux 3.0 and gdb 5.0 (I've tried 4.18 as well, same
results).
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

Reply via email to