diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-01-20 01:57:58 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-01-20 01:57:58 +0100 |
commit | 74cac79218c58e399bec261683617d66652663fe (patch) | |
tree | 43978b455d807351ff5b1a46b27323980d365166 /mysys/stacktrace.c | |
parent | 139bf5ce4c3e67c287418a3c5043b056c9a5cf4d (diff) | |
download | mariadb-git-74cac79218c58e399bec261683617d66652663fe.tar.gz |
- Fix rpl_checksum test. Use basename of file in error messages, not the o
nes prefixed with .\ or ./
- Add my_basename() to mysys.
- Do not compile files that are not needed on Windows (my_addr_resolve, an
d safemalloc related stuff it it is not used)
Avoids linker warnings about compilation of essentially empty files.
Diffstat (limited to 'mysys/stacktrace.c')
-rw-r--r-- | mysys/stacktrace.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index 1766c0f503a..30c9fafcb82 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -465,6 +465,7 @@ void my_write_core(int sig) #include <dbghelp.h> #include <tlhelp32.h> +#include <my_sys.h> #if _MSC_VER #pragma comment(lib, "dbghelp") #endif @@ -652,14 +653,10 @@ void my_print_stacktrace(uchar* unused1, ulong unused2) &(package.sym)); have_source= SymGetLineFromAddr64(hProcess, addr, &line_offset, &line); - my_safe_printf_stderr("%p ", addr); + my_safe_printf_stderr("%p ", (uintptr_t)addr); if(have_module) { - char *base_image_name= strrchr(module.ImageName, '\\'); - if(base_image_name) - base_image_name++; - else - base_image_name= module.ImageName; + const char *base_image_name= my_basename(module.ImageName); my_safe_printf_stderr("%s!", base_image_name); } if(have_symbol) @@ -670,11 +667,7 @@ void my_print_stacktrace(uchar* unused1, ulong unused2) if(have_source) { - char *base_file_name= strrchr(line.FileName, '\\'); - if(base_file_name) - base_file_name++; - else - base_file_name= line.FileName; + const char *base_file_name= my_basename(line.FileName); my_safe_printf_stderr("[%s:%u]", base_file_name, line.LineNumber); } |