Navigation Menu

Skip to content

Commit

Permalink
windows: search *.pdb from GROONGA_DIR\bin
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 19, 2017
1 parent 5fa6f75 commit e6e2aff
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions lib/ctx.c
Expand Up @@ -1595,6 +1595,39 @@ exception_filter(EXCEPTION_POINTERS *info)
SYMOPT_LOAD_LINES |
SYMOPT_NO_PROMPTS);
SymInitialize(process, NULL, TRUE);
{
char search_path[MAX_PATH * 2];
const char *base_dir;

if (SymGetSearchPath(process, search_path, sizeof(search_path))) {
grn_strncat(search_path, sizeof(search_path), ";", 1);
} else {
search_path[0] = '\0';
}

base_dir = grn_windows_base_dir();
{
char *current, *end;
current = search_path + strlen(search_path);
end = current + sizeof(search_path) - 1;
for (; *base_dir && current < end; base_dir++, current++) {
if (*base_dir == '/') {
*current = '\\';
} else {
*current = *base_dir;
}
}
if ((current + strlen("\\bin") + 1) < end) {
(*current++) = '\\';
(*current++) = 'b';
(*current++) = 'i';
(*current++) = 'n';
}
*current = '\0';
}

SymSetSearchPath(process, search_path);
}

memset(&frame, 0, sizeof(STACKFRAME64));
frame.AddrPC.Mode = AddrModeFlat;
Expand Down

0 comments on commit e6e2aff

Please sign in to comment.