Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
howto:panel_plugin_debug [2009/01/14 13:22] – typo + make a title 88.172.125.130howto:panel_plugin_debug [2012/07/04 10:44] – [Temporarily capturing messages to stdout and stderr] belnac
Line 21: Line 21:
   #!/bin/sh   #!/bin/sh
   valgrind --log-file=$HOME/clipman-valgrind.log \   valgrind --log-file=$HOME/clipman-valgrind.log \
-  /usr/local/libexec/xfce4/panel-plugins/clipman $@+  /usr/local/libexec/xfce4/panel-plugins/clipman "$@"
  
   * Now you can add the plugin "Clipman (valgrind)" to the panel as usual   * Now you can add the plugin "Clipman (valgrind)" to the panel as usual
Line 28: Line 28:
 {{wiki:information.png}} It'll be really slow as wrapped in valgrind, but you'll be able to hunt memory leaks. {{wiki:information.png}} It'll be really slow as wrapped in valgrind, but you'll be able to hunt memory leaks.
  
-==== More useful call to Valgrind ====+=== More useful call to Valgrind ===
  
   G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --tool=memcheck --leak-check=full \   G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --tool=memcheck --leak-check=full \
Line 46: Line 46:
  
   #!/bin/sh   #!/bin/sh
-  gdb -ex r -ex bt -ex q --args /usr/local/libexec/xfce4/panel-plugins/clipman $@ \+  gdb -ex r -ex bt -ex continue -ex q --args /usr/local/libexec/xfce4/panel-plugins/clipman $@ \
   > $HOME/clipman-gdb.log 2>&1   > $HOME/clipman-gdb.log 2>&1
  
-==== Using GDB on running instances ====+=== Using GDB on running instances ===
  
 If you want an interactive debug session with GDB, you can simply find the process id of the plugin by running If you want an interactive debug session with GDB, you can simply find the process id of the plugin by running
Line 62: Line 62:
  
 Again, the plugin must already be loaded for this to work. Again, the plugin must already be loaded for this to work.
 +
 +===== Temporarily capturing messages to stdout and stderr =====
 +
 +  * Add the plugin to the panel
 +  * Exit the panel:
 +
 +  $ xfce4-panel -q
 +
 +  * Start panel capturing stdout and stderr to file. Note that this will capture all messages from the panel, including all plugins, to 'file':
 +
 +  $ xfce4-panel > file 2>&1 & disown
 +
 +  * When done capturing, exit the panel and start it again:
 +
 +  $ xfce4-panel -q
 +  $ xfce4-panel & disown
  
 ====== Some tips ====== ====== Some tips ======
   * By creating your own desktop entry file, it will never get overwritten by any installation, and the file doesn't cause any problem.   * By creating your own desktop entry file, it will never get overwritten by any installation, and the file doesn't cause any problem.
-  * You can point the Exec= key to your development directory, for instance /home/john/clipman/panel-plugin/xfce4-clipman-plugin-gdb, and write the shell script xfce4-clipman-plugin-gdb that points to the binary inside your development directory aswell.  This avoids you to install the binary every time, all you will need is to restart the panel (''xfce4-panel -r'') :-P+  * You can point the Exec= key to your development directory, for instance /home/john/clipman/panel-plugin/xfce4-clipman-plugin-gdb, and write the shell script xfce4-clipman-plugin-gdb that points to the binary inside your development directory aswell.  This avoids you to install the binary every time, all you will need is to restart the panel (''xfce4-panel -r''after you compile your plugin :-P