Commit e879efcc authored by Peter Oberndorfer's avatar Peter Oberndorfer Committed by Alexandre Julliard

winedbg: Do not write over const char * parameter.

Also pass the right string to SymEnumSymbols and check for _ in symbol name, instead of beginning of string.
parent 719a0285
......@@ -239,14 +239,17 @@ enum sym_get_lval symbol_get_lvalue(const char* name, const int lineno,
SymSetOptions((opt = SymGetOptions()) | 0x40000000);
SymEnumSymbols(dbg_curr_process->handle, 0, buffer, sgv_cb, (void*)&sgv);
if (!sgv.num && (name[0] != '_'))
if (!sgv.num)
{
char* ptr = strchr(name, '!');
if (ptr++)
const char* ptr = strchr(name, '!');
if ((ptr && ptr[1] != '_') || (!ptr && *name != '_'))
{
memmove(ptr + 1, ptr, strlen(ptr));
*ptr = '_';
if (ptr)
{
int offset = ptr - name;
memcpy(buffer, name, offset + 1);
buffer[offset + 1] = '_';
strcpy(&buffer[offset + 2], ptr + 1);
}
else
{
......@@ -257,6 +260,7 @@ enum sym_get_lval symbol_get_lvalue(const char* name, const int lineno,
}
SymEnumSymbols(dbg_curr_process->handle, 0, buffer, sgv_cb, (void*)&sgv);
}
}
SymSetOptions(opt);
/* now grab local symbols */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment