The problem is that X crashes and takes everything with it (including the terminal, of course). When I put 'run --desktop' X crashed and I was back to gdm's login window.
See below x-session-errors file:

/etc/gdm3/Xsession: Beginning session setup...
/usr/share/themes/Statler/gtk-2.0/gtkrc:85: Murrine configuration option "gradients" is no longer supported and will be ignored.
/usr/share/themes/Statler/gtk-2.0/gtkrc:85: Murrine configuration option "gradients" is no longer supported and will be ignored.
/usr/share/themes/Statler/gtk-2.0/gtkrc:85: Murrine configuration option "gradients" is no longer supported and will be ignored.
[1521:1521:298439436:ERROR:CONSOLE(6465)] "Uncaught TypeError: Cannot read property 'can_uninstall' of undefined", source: chrome://newtab/ (6465)
/usr/share/themes/Statler/gtk-2.0/gtkrc:85: Murrine configuration option "gradients" is no longer supported and will be ignored.
(up until here nothing interesting then below is the crash)
g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 31 requests (31 known processed) with 0 events remaining.
lxpanel: Fatal IO error 11 (Recurso temporariamente indisponível) on X server :0.
XIO:  fatal IO error 11 (Recurso temporariamente indisponível) on X server ":0"
      after 13985 requests (13985 known processed) with 0 events remaining.
volumeicon: Fatal IO error 11 (Recurso temporariamente indisponível) on X server :0.
x-terminal-emulator: Fatal IO error 11 (Recurso temporariamente indisponível) on X server :0.

On Thu, May 19, 2011 at 8:35 PM, PCMan <pcman.tw@gmail.com> wrote:
Try this:
http://wiki.lxde.org/en/PCManFM_build_and_setup_guide#Bug_Reporting_and_How_to_Help_Debug_PCManFM
Then execute "run --desktop" in gdb.
Thanks

On Thu, May 19, 2011 at 2:29 PM, Sergio Cipolla <secipolla@gmail.com> wrote:
> How would I take it?
> If I open the terminal to run gdb then afterwards the session crashes (gdm
> logs out) it will take the terminal (and every open program) with it.
> Is there another way of doing it?