Hello,

I have two problems. Just before explain my problems i would like to clarify
the context. This exercice is for student. In this exercice, they program a
WorkingTask (infini loop) and they pilot this task with an other (go task).

The first problem is when i used rt_task_delete for stop and delete
WorkingTask, the Xenomai program doesn't finish.
But if i use rt_task_suspend before use rt_task_delete, the program stop
correctly.
Why i must use rt_task_suspend before? what is problem with rt_task_delete?


The second problem: I would like to debug a Xenomai program. But in some
situation, i have problems. Xenomai take all ressource, the simulateur
doesn't respond and gdb is blocked in waiting.
The code of this program is join in this email.

I launched gdb and I used these gdb's commands :

b main
b WorkingTask
b 34
start
continue
next
continue


And after the simulateur doesn't respond and gdb is blocked.

What is problem? do you have other problem with gdb?
A solution of how can i used gdb for debug?


The configuration :

- Linux kernel : 2.6.37
- Adeos patch : adeos-ipipe-2.6.37-x86-2.9-00.patch
- Xenomai : 2.5.6
- Host Linux distribution : Ubuntu 10.04
- Compiler : gcc-4.4.3
- GDB : 7.1

Configuration of kernel:

I used the default configuration of Ubunut 10.04 and i change this:
In "Processor type and features":

- change the processor familly : Ahtlon64

- deactivate Enable -fstack-protector buffer overflow detection
(EXPERIMENTAL)
#include <native/task.h>
#include <sys/mman.h>
#include <assert.h>
#include <stdio.h>
#include "utils.h"


RT_TASK Rt_working_task;

int compteur;


void WorkingTask (){
	
	compteur=0;
	
	while (1){
		compteur++;
		rt_task_sleep (100);
	}
}


void go (){
	
	int codeErreur;
	
	codeErreur = rt_task_start (&Rt_working_task, &WorkingTask, NULL);
	assert (codeErreur == 0);
	
	codeErreur = rt_task_sleep (TIME(MS_2_NS(100)));
	assert (codeErreur == 0);
	
	codeErreur = rt_task_suspend (&Rt_working_task); // if you delete this ligne, the program doesn't stop
	assert (codeErreur == 0);
	
	codeErreur = rt_task_delete (&Rt_working_task);
	assert (codeErreur == 0);
}


int main (void){
	RT_TASK Rt_go_task;
	int codeErreur;
	
	codeErreur = mlockall( MCL_CURRENT | MCL_FUTURE );
	assert (codeErreur == 0);
	
	codeErreur = rt_task_create (&Rt_go_task, "go", DEFAULT_STACK_SIZE, 50, T_FPU | T_JOINABLE);
	assert (codeErreur == 0);
	
	codeErreur = rt_task_create (&Rt_working_task, "working", DEFAULT_STACK_SIZE, 30, T_FPU | T_JOINABLE);
	assert (codeErreur == 0);
	
	codeErreur = rt_task_start (&Rt_go_task, &go, NULL);
	assert (codeErreur == 0);
	
	codeErreur = rt_task_join(&Rt_go_task);
	assert (codeErreur == 0);
	
	printf("End of program\r\n");
	
	return 0;
}

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to