how to gdb genode apps

Sebastian Sumpf Sebastian.Sumpf at ...1...
Fri Sep 10 18:09:11 CEST 2010


 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 at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main





More information about the users mailing list