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,23 +239,27 @@ 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++)
{
memmove(ptr + 1, ptr, strlen(ptr));
*ptr = '_';
}
else
const char* ptr = strchr(name, '!');
if ((ptr && ptr[1] != '_') || (!ptr && *name != '_'))
{
buffer[0] = '*';
buffer[1] = '!';
buffer[2] = '_';
strcpy(&buffer[3], name);
if (ptr)
{
int offset = ptr - name;
memcpy(buffer, name, offset + 1);
buffer[offset + 1] = '_';
strcpy(&buffer[offset + 2], ptr + 1);
}
else
{
buffer[0] = '*';
buffer[1] = '!';
buffer[2] = '_';
strcpy(&buffer[3], name);
}
SymEnumSymbols(dbg_curr_process->handle, 0, buffer, sgv_cb, (void*)&sgv);
}
SymEnumSymbols(dbg_curr_process->handle, 0, buffer, sgv_cb, (void*)&sgv);
}
SymSetOptions(opt);
......
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