Hello Pavel,
I only tried this on a very simple module (split the hello example,
sources attached), and stepping between files does work, as do
breakpoints. GNU gdb 19990928, RTL 3.0pre6e. Please try this example
and let me know if it works.
Michael.
Pavel Andris ([EMAIL PROTECTED]) wrote:
> Dear all,
>
> I've tried to debug a large module put together from several source
> files. The sources were compiled separately then linked together
> using "partial linking" (ld -r).
>
> gdb commands work well on the basic source file (i.e. one where the
> debugged RT thread starts, it contains also init_module()).
>
> BUT, it is impossible to enter a different source file using gdb's
> step command. You may also set up a breakpoint on a function located
> in a different source file, but the execution does _not_ stop there.
>
> Any idea what could be wrong?
>
> Has anybody tried the same and found it working? Which version of
> RTL, gdb?
>
> Regards,
>
> pa
>
> --
> ..........................................................................
> Pavel Andris | tel: +421 7 5941 2167
> Institute of Control Theory and Robotics | fax: +421 7 5477 6045
> Slovak Academy of Sciences |
> Dubravska cesta 9 | e-mail: [EMAIL PROTECTED]
> SK - 842 37 Bratislava |
> Slovakia |
> .........................................................................
> -- [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/rtlinux/
/*
* RTLinux Hello World example
*
* Written by Michael Barabanov ([EMAIL PROTECTED])
* Copyright (C) 1999-2000 VJY Associates LLC
* Released under the terms of the GPL
*
*/
#include <rtl_sync.h>
#include <rtl.h>
#include <time.h>
#include <pthread.h>
#include <rtl_debug.h>
pthread_t thread = 0;
pthread_t thread2 = 0;
extern int internal(void *arg);
void * start_routine(void *arg)
{
int i;
struct sched_param p;
p . sched_priority = 1;
pthread_setschedparam (pthread_self(), SCHED_FIFO, &p);
pthread_make_periodic_np (pthread_self(), gethrtime(), 500000000);
if (((int) arg) == 1) {
breakpoint();
}
for (i = 0; i < 20; i ++) {
rtl_irqstate_t flags;
pthread_wait_np ();
rtl_no_interrupts(flags);
rtl_restore_interrupts(flags);
internal(arg);
}
return 0;
}
int init_module(void) {
pthread_create (&thread, NULL, start_routine, (void *) 1);
return pthread_create (&thread2, NULL, start_routine, (void *) 2);
}
void cleanup_module(void) {
pthread_delete_np (thread);
pthread_delete_np (thread2);
}
#include <rtl.h>
#include <time.h>
#include <pthread.h>
int internal(void *arg)
{
rtl_printf("I'm here; my arg is %x\n", (unsigned) arg);
return 0;
}