Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-01-27 03:49:13 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-01-27 03:49:13 +0400
commit556912792ad3c37c294256a558c96b39f264e7b5 (patch)
tree9b6ee8cf1ad92ee89c04f27a89be11599c5b40c0 /source/creator
parent9251d628db0abe599d927d79170025d8545c8ace (diff)
parentc84383301c5a2582e95259a7e4468a23a3566401 (diff)
Merged changes in the trunk up to revision 54110.
Conflicts resolved: source/blender/blenfont/SConscript source/blender/blenkernel/intern/subsurf_ccg.c source/blender/makesdna/intern/makesdna.c source/blender/makesrna/intern/rna_scene.c
Diffstat (limited to 'source/creator')
-rw-r--r--source/creator/CMakeLists.txt4
-rw-r--r--source/creator/creator.c79
2 files changed, 69 insertions, 14 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 7db4b5bfc89..4ac8364aa19 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -985,6 +985,10 @@ endif()
list(APPEND BLENDER_SORTED_LIBS bf_intern_locale)
endif()
+ if(WITH_BULLET)
+ list_insert_after(BLENDER_SORTED_LIBS "bf_blenkernel" "bf_rigidbody")
+ endif()
+
if(WITH_BULLET AND NOT WITH_BULLET_SYSTEM)
list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet")
endif()
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 55a24971c61..5aa0ca51a58 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -46,16 +46,19 @@
#else
# include <unistd.h> /* getpid */
#endif
-/* for backtrace */
-#ifndef WIN32
-# include <execinfo.h>
-#endif
#ifdef WIN32
# include <Windows.h>
# include "utfconv.h"
#endif
+/* for backtrace */
+#if defined(__linux__) || defined(__APPLE__)
+# include <execinfo.h>
+#elif defined(_MSV_VER)
+# include <DbgHelp.h>
+#endif
+
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
@@ -166,9 +169,10 @@ static int print_version(int argc, const char **argv, void *data);
/* for the callbacks: */
-#define BLEND_VERSION_STRING_FMT \
- "Blender %d.%02d (sub %d)\n", \
- BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION \
+#define BLEND_VERSION_FMT "Blender %d.%02d (sub %d)"
+#define BLEND_VERSION_ARG BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION
+/* pass directly to printf */
+#define BLEND_VERSION_STRING_FMT BLEND_VERSION_FMT "\n", BLEND_VERSION_ARG
/* Initialize callbacks for the modules that need them */
static void setCallbacks(void);
@@ -448,9 +452,11 @@ static int set_fpe(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(dat
return 0;
}
+#if defined(__linux__) || defined(__APPLE__)
+
+/* Unix */
static void blender_crash_handler_backtrace(FILE *fp)
{
-#ifndef WIN32
#define SIZE 100
void *buffer[SIZE];
int nptrs;
@@ -469,11 +475,51 @@ static void blender_crash_handler_backtrace(FILE *fp)
free(strings);
#undef SIZE
-#else /* WIN32 */
- /* TODO */
+}
+
+#elif defined(_MSV_VER)
+
+static void blender_crash_handler_backtrace(FILE *fp)
+{
(void)fp;
+
+#if 0
+#define MAXSYMBOL 256
+ unsigned short i;
+ void *stack[SIZE];
+ unsigned short nframes;
+ SYMBOL_INFO *symbolinfo;
+ HANDLE process;
+
+ process = GetCurrentProcess();
+
+ SymInitialize(process, NULL, TRUE);
+
+ nframes = CaptureStackBackTrace(0, SIZE, stack, NULL);
+ symbolinfo = MEM_callocN(sizeof(SYMBOL_INFO) + MAXSYMBOL * sizeof( char ), "crash Symbol table");
+ symbolinfo->MaxNameLen = MAXSYMBOL - 1;
+ symbolinfo->SizeOfStruct = sizeof(SYMBOL_INFO);
+
+ for( i = 0; i < nframes; i++ )
+ {
+ SymFromAddr(process, ( DWORD64 )( stack[ i ] ), 0, symbolinfo);
+
+ fprintf(fp, "%u: %s - 0x%0X\n", nframes - i - 1, symbolinfo->Name, symbolinfo->Address);
+ }
+
+ MEM_freeN(symbolinfo);
#endif
}
+
+#else /* non msvc/osx/linux */
+
+static void blender_crash_handler_backtrace(FILE *fp)
+{
+ (void)fp;
+}
+
+#endif
+
static void blender_crash_handler(int signum)
{
@@ -513,14 +559,20 @@ static void blender_crash_handler(int signum)
printf("Writing: %s\n", fname);
fflush(stdout);
- BLI_snprintf(header, sizeof(header), "# " BLEND_VERSION_STRING_FMT);
+ BLI_snprintf(header, sizeof(header), "# " BLEND_VERSION_FMT ", Revision: %s\n", BLEND_VERSION_ARG,
+#ifdef BUILD_DATE
+ build_rev
+#else
+ "Unknown"
+#endif
+ );
/* open the crash log */
errno = 0;
fp = BLI_fopen(fname, "wb");
if (fp == NULL) {
fprintf(stderr, "Unable to save '%s': %s\n",
- fname, errno ? strerror(errno) : "Unknown error opening file");
+ fname, errno ? strerror(errno) : "Unknown error opening file");
}
else {
if (wm) {
@@ -538,8 +590,7 @@ static void blender_crash_handler(int signum)
#ifndef WIN32
kill(getpid(), signum);
#else
- /* force crash on windows for now */
- *((void **)NULL) = NULL;
+ TerminateProcess(GetCurrentProcess(), signum);
#endif
}