wiki:Debugging/GDBScripts

Version 11 (modified by Chris Johns, on 11/22/14 at 03:59:33) (diff)

--

GdbScripts?

This is a set of user-defined commands for gdb which are useful in analyzing an RTEMS application. They can be used to display information about a number of RTEMS objects classes along with information about the system in general. The user defined commands should be saved in a file which is "sourced" as part of invoking gdb. This can be done in two ways. The first is from the command line:

sparc-rtems4.7-gdb --command=rtems-gdb-macros sp01.exe

The second mechanism is from the command line interactively:

sparc-rtems-gdb sp01.exe
...
(gdb) source rtems-gdb-macros

Once the user-defined commands have been loaded, you can do a help user-defined for a list of the user-defined commands or help rtems_XXX for detailed usage information.

--[Dr. Joel] 13:44, 11 Jul 2006 (CDT)


I found some tweaking was required to get this to work on a Coldfire based bsp.

Specifically: Changed the variable named $count to $i (don't know why I needed to do this) Adjusted the stack backtrace for Coldfire ( use frame pointer a6 as the starting point for the back trace).

--Paul Whitfield? 19:25, 6 Aug 2006 (CDT)


Moved out of the Wiki to the FTP server and updated for RTEMS 4.9. Check out http://www.rtems.org/ftp/pub/rtems/people/chrisj/gdb-scripts.

Add support for the i386. You need to edit the script file to get back trace support for your target.

--ChrisJohns? 07:00, 22 July 2008 (CDT)

--- Using GDB Commands

As described load the commands into GDB. You can use the command line used to invoke GDB, the GDB command or they can be placed in a GDB script. There currently is no standard to keep this script so I have placed it in my FTP area on the RTEMS FTP server. The link it:

http://www.rtems.org/ftp/pub/rtems/people/chrisj/gdb-scripts

Please send patches to the RTEMS user list.

Check Status

You will typically come to this page when you have a problem with an application or driver and you are struggling to find a solution. I had one such problem just recently. I had a mutex that once a task blocked on all tasks at the same priority or lower stopping running except IDLE. The {{{rtems_check_state</code> showed IDLE was not at its normal priority and a priority inversion bug relating to creating locked semaphores was shown to be problem. So first run this command to make sure you are not doing something that is know about.