Re: how to gdb genode apps

2010-09-15 Thread stephane frenot
Thanks, it works now.
The only remaining thing is to think to run gdb in the child process
directory.

/stephane

On Tue, Sep 14, 2010 at 10:28 AM, Norman Feske norman.fe...@genode-labs.com
 wrote:

 Hi Stephane,

 I suspect that have you placed the 'wait_for_continue' call in a program
 that you started via init's 'config' file but attached gdb to core's
 PID? You'll need to attach gdb to the thread that executes
 'wait_for_continue'. Each Genode process is executed as a separate Linux
 process. If you want to debug a non-core process, attach gdb to the
 corresponding Linux thread ID. To find out about which threads there
 are, use 'ps -eLf' and look for thread names starting with [Genode].

 Best regards
 Norman

 On 09/14/2010 09:45 AM, stephane frenot wrote:
  Actually, it is not really working.
 
  Everything works find, until I attach gdb to the process.
 
  I am stucked to this:
 
  (gdb) info thread
  * 1 process 2370  pseudo_end ()
  at
 
 /opt/genode/genode-r121/base-linux/../base-linux/src/platform/x86_64/lx_syscall.S:29
 
  (gdb) info stack
  #0  pseudo_end ()
  at
 
 /opt/genode/genode-r121/base-linux/../base-linux/src/platform/x86_64/lx_syscall.S:29
  #1  0x01021442 in lx_nanosleep (this=0x103c400)
  at
 /opt/genode/genode-r121/base-linux/src/platform/linux_syscalls.h:371
  #2  thread_stop_myself (this=0x103c400)
  at /opt/genode/genode-r121/base-linux/src/base/lock/lock_helper.h:70
  #3  Genode::Cancelable_lock::lock (this=0x103c400)
  at /opt/genode/genode-r121/base/src/base/lock/lock.cc:137
  #4  0x0101022e in Genode::Lock::lock (this=value optimized out)
  at /opt/genode/genode-r121/base/include/base/lock.h:35
  #5  Genode::Platform::wait_for_exit (this=value optimized out)
  at /opt/genode/genode-r121/base-linux/src/core/platform.cc:50
  #6  0x0100dfde in main ()
  at /opt/genode/genode-r121/base/src/core/main.cc:229
 
  And I am not able to reach the line where I put the wait_for_continue
  instruction.
 
  /stephane


 --
 Start uncovering the many advantages of virtual appliances
 and start using them to simplify application deployment and
 accelerate your shift to cloud computing.
 http://p.sf.net/sfu/novell-sfdev2dev
 ___
 Genode-main mailing list
 Genode-main@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/genode-main




-- 
http://perso.citi.insa-lyon.fr/sfrenot
work here : http://tinyurl.com/2ts4xf
sleep here : http://tinyurl.com/33p2gt
play here : http://tinyurl.com/3yarjz
---
Stephane Frenot
Université de Lyon, INRIA
INSA-Lyon, CITI, F-69621, France
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
Genode-main mailing list
Genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main


Re: how to gdb genode apps

2010-09-14 Thread Norman Feske
Hi Stephane,

I suspect that have you placed the 'wait_for_continue' call in a program
that you started via init's 'config' file but attached gdb to core's
PID? You'll need to attach gdb to the thread that executes
'wait_for_continue'. Each Genode process is executed as a separate Linux
process. If you want to debug a non-core process, attach gdb to the
corresponding Linux thread ID. To find out about which threads there
are, use 'ps -eLf' and look for thread names starting with [Genode].

Best regards
Norman

On 09/14/2010 09:45 AM, stephane frenot wrote:
 Actually, it is not really working.
 
 Everything works find, until I attach gdb to the process.
 
 I am stucked to this:
 
 (gdb) info thread
 * 1 process 2370  pseudo_end ()
 at
 /opt/genode/genode-r121/base-linux/../base-linux/src/platform/x86_64/lx_syscall.S:29
 
 (gdb) info stack
 #0  pseudo_end ()
 at
 /opt/genode/genode-r121/base-linux/../base-linux/src/platform/x86_64/lx_syscall.S:29
 #1  0x01021442 in lx_nanosleep (this=0x103c400)
 at /opt/genode/genode-r121/base-linux/src/platform/linux_syscalls.h:371
 #2  thread_stop_myself (this=0x103c400)
 at /opt/genode/genode-r121/base-linux/src/base/lock/lock_helper.h:70
 #3  Genode::Cancelable_lock::lock (this=0x103c400)
 at /opt/genode/genode-r121/base/src/base/lock/lock.cc:137
 #4  0x0101022e in Genode::Lock::lock (this=value optimized out)
 at /opt/genode/genode-r121/base/include/base/lock.h:35
 #5  Genode::Platform::wait_for_exit (this=value optimized out)
 at /opt/genode/genode-r121/base-linux/src/core/platform.cc:50
 #6  0x0100dfde in main ()
 at /opt/genode/genode-r121/base/src/core/main.cc:229
 
 And I am not able to reach the line where I put the wait_for_continue
 instruction.
 
 /stephane

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Genode-main mailing list
Genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main


Re: how to gdb genode apps

2010-09-10 Thread Sebastian Sumpf
 Hello again,

here is a small HOWTO for debugging Genode apps on Linux:

* The first thing to do is to interrupt Genode at a certain point as you
cannot start core with gdb. So, if you want to debug an application you
have to call 'wait_for_continue' from within your code.
Somewhere in your code write something like:
   
extern C void wait_for_continue();

void some_func_in_your_program()
   {
   wait_for_continue();
   }

This will cause your program to stall in the function above.

* Compile your app
* Start './core' from the command line
* As mentioned before your program will stop in the 'wait_for_continue'
function
* Now find out the process id of your program, ('ps -efL | grep Genode')
* Start gdb with 'gdb -p Process ID from ps' , this will attach gdb to
the process
* Switch to the Genode output console (where you started core) and hit
'enter', this will cause your program to leave the 'wait_for_continue'
function
* Switch back to GDB, you now may step and set breakpoints (note: Does
not work with all gdb versions), inspect variables, ... .

I hope this helps,

Sebastian

On 09/10/2010 05:34 PM, stephane frenot wrote:
 Hello,
 I have a problem while debugging genode with gdb.

 When starting gdb ./core it freeezes on 3 LWP.

 Is there a specific gdb configuration in order to reach sub services ?

 /stephane
 -- 
 http://perso.citi.insa-lyon.fr/sfrenot
 work here : http://tinyurl.com/2ts4xf
 sleep here : http://tinyurl.com/33p2gt
 play here : http://tinyurl.com/3yarjz
 ---
 Stephane Frenot
 Université de Lyon, INRIA
 INSA-Lyon, CITI, F-69621, France


 --
 Automate Storage Tiering Simply
 Optimize IT performance and efficiency through flexible, powerful, 
 automated storage tiering capabilities. View this brief to learn how
 you can reduce costs and improve performance. 
 http://p.sf.net/sfu/dell-sfdev2dev


 ___
 Genode-main mailing list
 Genode-main@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/genode-main


--
Automate Storage Tiering Simply
Optimize IT performance and efficiency through flexible, powerful, 
automated storage tiering capabilities. View this brief to learn how
you can reduce costs and improve performance. 
http://p.sf.net/sfu/dell-sfdev2dev
___
Genode-main mailing list
Genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main