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.
This commit is contained in:
Peter Oberndorfer 2007-03-07 22:04:21 +01:00 committed by Alexandre Julliard
parent 719a02856d
commit e879efcc74
1 changed files with 18 additions and 14 deletions

View File

@ -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++)
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
{
buffer[0] = '*';
buffer[1] = '!';
buffer[2] = '_';
strcpy(&buffer[3], name);
}
SymEnumSymbols(dbg_curr_process->handle, 0, buffer, sgv_cb, (void*)&sgv);
}
else
{
buffer[0] = '*';
buffer[1] = '!';
buffer[2] = '_';
strcpy(&buffer[3], name);
}
SymEnumSymbols(dbg_curr_process->handle, 0, buffer, sgv_cb, (void*)&sgv);
}
SymSetOptions(opt);