Test Gnome-Shell debugging experience

Source: Internet
Author: User

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/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.