BlenderDev/DebugBlender

Wikipedia,自由的百科全书

Debugging of Blender

There are a couple ways to go about debugging crashes in Blender. Today I had to learn one of them. The steps are pretty easy to follow. These instructions should work for any platform with Bash and GDB (like Cygwin or Unix).

  • Compile a debug version of Blender by doing either of the following:
    • type 'make debug' in the root directory of the Blender source code
    • set the environmental variable NAN_DEBUG (on Cygwin this requires adding 'export NAN_DEBUG="-g"' to user-def.mk) Both of these options work fine but the latter is preferable because it doesn't force you to recompile the entire source
  • If you chose 'make debug' you'll find the resulting binary in obj/xxx/debug where xxx is your platform
  • You make want to rename this file blender_debug so that you can copy it to your installation directory without overwriting your original binary. _note: this file will be unusually large. Expect filesize > 40MB._
  • Start GDB by changing the working directory to the location of your new debug build and typing 'gdb xxx.exe' where xxx is the name of the binary (generally just blender.exe or blender_debug.exe. Whatever you choose).
  • Type 'run' at the GDB prompt and Blender should start as normal. Crash it!
  • Once the crash occurs type 'bt' (backtrace) at the GDB prompt. This will give useful information about the crash.
  • If you would like to make this information available to a developer you can copy and paste it from the command prompt (though it doesn't work as typical copy and paste) by right clicking on the terminal header, select Edit>Mark from the menu. Then highlight your selection. Then again right click on the header and select Edit>Copy.
  • Now you can paste the debug information into a bug report which can be filed using the blender bug tracker http://projects.blender.org/tracker/?atid=125&group_id=9&func=browse

-- DeveloperWikiChrisBurt - 14 Aug 2005

Code Review

Personal tools