Recently, I am writing a gnome-shell plug-in. Generally, exceptions of the plug-in will be captured by gnome-shell. Once the exceptions of the plug-in are captured by gnome-shell, the plug-in will be reloaded up to two times ), because gnome-shell is reloaded every time
Will automatically clear the full log information in looking glass, so we do not know where the code is wrong, and after more than two times, gnome-shell will not reload again, therefore, you have to restart the logon manager.
All processes on the desktop are forcibly disabled. This is a waste of debugging time.
Therefore, the method is to let gnome-shell run in gdb, so that gnome-shell crash can get stack information from gdb to quickly debug the program.
The complete debugging steps are as follows:
1. log on to gnome-shell desktop normally
2. Press Ctrl + Alt + F1 to enter the terminal and log in with the same user name
3. Use the following code to export the DISPLAY so that gnome-shell is displayed under the DISPLAY you specified ):
export DISPLAY=:0
4. Start gdb with the following code:
gdb /usr/bin/gnome-shell
5. Input in gdb:
r --replace
6. Press Ctrl + Alt + F7 to switch back to the gnome-shell desktop, and then you can swim in the Gnome Shell again.
7. When gnome-shell crashes, press Ctrl + Alt + F1 to switch back to the terminal to view the stack information in gdb:
For example, if there is a Bug in writing the 3D switching extension code, you can see the following information in gdb:
Exception was: Error: Expected type 'ClutterActor' but got 'GObject' ... /home/andy/.local/share/gnome-shell/extensions/windows-alt-tab-3d@linuxdeepin.com/extension.js:625 ...
From the above stack information, you can quickly locate the problem with the code of the 625 lines.
In this way, if you want to reload gnome-shell (unlimited), directly input
r --replace
All programs do not need to be restarted because of the gnome-shell crash, saving a lot of debugging time.
Well, the above is the complete process for debugging gnome-shell. I hope it will be helpful for you to debug gnome-shell. Enjoy!
Original article address: Http://planet.linuxdeepin.com/2012/01/12/test-gnome-shell-tips-fo-manateelazycat/