[gst-devel] Initial .gdbinit script

Erik Walthinsen omega at temple-baptist.com
Mon May 7 20:33:17 CEST 2001

Here's the contents of my .gdbinit script as of right now.  It's a helper
function to print out a bunch of useful information about an element
pointer.  It'll get better over time, but here's the first draft:

define element_info
  set $element = $arg0
  printf "Element name is \"%s\"\n", ((GstObject *)$element)->name
  set $current_state = ((GstElement *)$element)->current_state
  set $pending_state = ((GstElement *)$element)->pending_state

  set $parent = ((GstObject *)$element)->parent
  if ($parent != 0)
    set $parent_name = ((GstObject *)$parent)->name
    printf "  Parent is \"%s\", %p\n", $parent_name, $parent

  printf "  There are %d pads:\n", ((GstElement *)$element)->numpads
  set $pads = ((GstElement *)$element)->pads
  while ($pads != 0)
    set $pad = ((GList *)$pads)->data
    set $pad_name = ((GstObject *)$pad)->name
    set $peer = ((GstRealPad *)$pad)->peer
    printf "    Pad \"%s\"", $pad_name
    if ($peer != 0)
      set $peer_name = ((GstObject *)$peer)->name
      set $peer_parent = ((GstObject *)$peer)->parent
      set $peer_parent_name = ((GstObject *)$peer_parent)->name
      printf " has peer \"%s:%s\"", $peer_parent_name, $peer_name
      printf " has NO peer"
    printf "\n"
    set $pads = ((GList *)$pads)->next

Just place that in your ~/.gdbinit file, and when you want more info on an
element, just type:

element_info elementsymbol

      Erik Walthinsen <omega at temple-baptist.com> - System Administrator
       /  \                GStreamer - The only way to stream!
      |    | M E G A        ***** http://gstreamer.net/ *****
      _\  /_

More information about the gstreamer-devel mailing list