RFC: dwarf merge patch
eric.pouech at orange.fr
Thu Jan 21 15:23:00 CST 2010
André Hentschel a écrit :
> Eric Pouech schrieb:
>> André Hentschel a écrit :
>>> I made a patch to merge code from ntdll/signal_x86_64.c to
>>> The operator DW_OP_deref_size needs to read different sizes of
>>> variables from memory into a fixed size variable.
>>> Now i am not sure if my solution is the smallest and easiest one, so i
>>> would be happy for every comment on this.
>> you could factorize all the calls to ReadProcessMemory into a single
>> one, then use more explicit integral conversion
>> BYTE deref;
>> if (!ReadProcessMemory(hproc, (void*)addr, &deref, derefsize, NULL))
>> WARN("Couldn't read memory at %lx\n", addr);
>> return loc_err_cant_read;
>> switch (derefsize)
>> case 1: stack[++stk] = *(unsigned char*)&deref; break;
>> case 2: stack[++stk] = *(unsigned short*)&deref; break;
>> case 4: stack[++stk] = *(DWORD*)&deref; break;
>> case 8: stack[++stk] = *(DWORD64*)&deref; break;
> Hi Eric,
> correct me if i am wrong, but IMO that leads to problems with endianess(Big Endian vs. Little Endian).
> In that case, is my last implementation ok or should i extend yours to be aware of endianess?
it just implies that debugger and debuggee use the same integral storage
it could cause however some alignment faults on some hardware
"The problem with designing something completely foolproof is to underestimate the ingenuity of a complete idiot." (Douglas Adams)
More information about the wine-devel