# Cannot debug in Embedded GDB mode

**URL:** <https://forum.sierrawireless.com/t/cannot-debug-in-embedded-gdb-mode/5088>\
**Category:** Development tools\
**Created:** [May 31, 2011, 1:38pm UTC](https://forum.sierrawireless.com/t/cannot-debug-in-embedded-gdb-mode/5088 "2011-05-31T13:38:03Z")\
**Posts on this page:** 4\
**Page:** 3

<div class="post-metadata">

**Author:** ![daav](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/daav/32/2767_2.png) [@daav](https://forum.sierrawireless.com/u/daav)\
**Post date:** [October 26, 2011, 8:17am UTC](https://forum.sierrawireless.com/t/cannot-debug-in-embedded-gdb-mode/5088/41 "2011-10-26T08:17:07Z")

</div>

No… ADL is event-driven, functioning on callbacks.  
To setup the timer, you need to:

- put a timer subscription (with a callback function!) in your task initialization function, and just return.
- move all your processing to the callback function

Just have a look to the hello world sample to see how it works…

---

<div class="post-metadata">

**Author:** ![quimisur](https://avatars.discourse-cdn.com/v4/letter/q/96bed5/32.png) [@quimisur](https://forum.sierrawireless.com/u/quimisur)\
**Post date:** [October 26, 2011, 8:43am UTC](https://forum.sierrawireless.com/t/cannot-debug-in-embedded-gdb-mode/5088/42 "2011-10-26T08:43:32Z")

</div>

I thought there would be no problem as far as my generated.c looks like this:

const adl\_InitTasks\_t adl\_InitTasks [] =  
{  
{ iqm2m\_init, 3072, “main”, 2 },// my library initialization function  
{ main\_task, 3072, “task1”, 1 }, //task execution(just write some messages to the console)

```
{ 0, 0, 0, 0 }

```

};

Now main\_task looks do this:

void main\_task ( adl\_InitType\_e InitType )  
{  
adl\_tmr\_t \*tt;

tt = adl\_tmrSubscribe ( FALSE,  
30,  
ADL\_TMR\_TYPE\_100MS,  
tmr\_handler);  
}

and tmr\_handler prints the messages to console. Neither it stops in the breakpoints, nor it prints any message. 😊

---

<div class="post-metadata">

**Author:** ![daav](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/daav/32/2767_2.png) [@daav](https://forum.sierrawireless.com/u/daav)\
**Post date:** [October 26, 2011, 9:40am UTC](https://forum.sierrawireless.com/t/cannot-debug-in-embedded-gdb-mode/5088/43 "2011-10-26T09:40:18Z")

</div>

3s sounds a little bit short for breakpoint…  
For the messages, can’t imagine any reason; maybe try to compare with Hello World app?

---

<div class="post-metadata">

**Author:** ![quimisur](https://avatars.discourse-cdn.com/v4/letter/q/96bed5/32.png) [@quimisur](https://forum.sierrawireless.com/u/quimisur)\
**Post date:** [October 26, 2011, 10:02am UTC](https://forum.sierrawireless.com/t/cannot-debug-in-embedded-gdb-mode/5088/44 "2011-10-26T10:02:48Z")

</div>

You were right, with 30 seconds it start to work, even with 10 looks to be enough, I hope this will help me with other problems. Thank you!

[Previous page](https://forum.sierrawireless.com/t/cannot-debug-in-embedded-gdb-mode/5088.md?page=2)
