SymEnumSymbolsForAddr in dbghelp.dll

Roger Cruz roger_r_cruz at yahoo.com
Tue Apr 17 23:37:03 CDT 2012


Any recent bug fixes in the dbghelp.dll (since 1.36.3 which is my development base)?  For some reason, symt_find_nearest()  is not finding the address which corresponds to the MessageBoxW() in user32.dll.   I have stepped through the function and it appears that the address for MessageBoxW is not in the sorted list of addresses as shown in the log below
 
symt_find_nearest (module=0x455604b8, addr=0x458bc19c) at symbol.c:976
973         if (cmp_sorttab_addr(module, mid, addr) < 0)
(gdb) p low
$235 = 0xa85
(gdb) p high
$236 = 0xa88
(gdb) p mid
$237 = 0xa86
(gdb) s
cmp_sorttab_addr (module=0x455604b8, idx=0xa86, addr=0x458bc19c) at symbol.c:54
54     symt_get_address(&module->addr_sorttab[idx]->symt, &ref);
(gdb) n
55     return cmp_addr(ref, addr);
(gdb) p ref
$239 = 0x458bc458 <-- this address at idx=0xa86 is past the one I'm looking for
(gdb) p addr
$240 = 0x458bc19c   <---- this is the address of MessageBoxW that I am searching for.

After returning from this call, we exit the while (high > low + 1) and then return the "incorrect" symbol at idx=0xa85 which is the closest given the sorted address but not the one I was looking for.
 
98     symt_get_address(&module->addr_sorttab[low]->symt, &ref_addr);
(gdb) p low
$249 = 0xa85
(gdb) p ref_addr
$250 = 0x458bbb18
(gdb) info symbol ref_addr
MSGBOX_OnInit + 3044 in section .text of /development/rcruz/sandbox/wine/installs/wine-1.3.36/lib/wine/user32.dll.so
(gdb) n
1003     return module->addr_sorttab[low];

So why isn't the address 0x458bc19c for MessageBoxW found in the sorted array between addr 0x458bbb18  and 0x458bc458?  did it not get added to the sorted list of symbols at all? or incorrectly?  There are close to 8000 symbols in user32.dll so obviously I haven't looked through this entire array to see if this function got inserted into the wrong place.  I will continue to debug this but I figure I ask first in case there is a known issue which has been address in a subsequent release.
 
Regards
Roger
 


________________________________
From: Roger Cruz <roger_r_cruz at yahoo.com>
To: André Hentschel <nerv at dawncrow.de>; "wine-devel at winehq.org" <wine-devel at winehq.org> 
Sent: Tuesday, April 17, 2012 11:11 PM
Subject: Re: SymEnumSymbolsForAddr in dbghelp.dll


I already changed the code to use SymEnumSymbols and SymSetContext to specify the address of the symbol I want to look for.  A little more cumbersome but equivalent in functionality.  I'm currently in the process of debugging why symt_find_nearest() is not properly identifying the correct function symbol associated with the address it is being passed in.  The binary search in that function seems to stop short of the actual symbol.

With regards to winebuild and *.spec files,  I had examined the code and was pretty sure that stub meant not implemented but I just wanted to confirm.  Sometimes I ask also to see if anyone else is working on something similar so I don't duplicate the work and to get additional pointers on who to talk to like Juan did.  

Much greatful for your help and all of you other wine developers out there


Regards,
Roger R. Cruz


________________________________
> *From:* Roger Cruz <roger_r_cruz at yahoo.com>
> *To:* "wine-devel at winehq.org" <wine-devel at winehq.org>
> *Sent:* Monday, April 16, 2012 9:13 PM
> *Subject:* SymEnumSymbolsForAddr in dbghelp.dll
> 
> 
> I wrote a simple piece of code that uses dbghelp.dll's  SymEnumSymbolsForAddr() but when I went to search for its code in Wine, it looks to be missing.  The dbghelp.spec has that function listed as "stub".  What does stub mean in this context? Does it mean the function is not implemented?  Are there any plans to?
> 
> Thanks
> Roger R. Cruz

Have a look at SymEnumSymbols (and SymEnumSymbolsW), it seems everything needed for SymEnumSymbolsForAddr is already available or needs only minor changes.

PS: The fact that you don't know Wine basics like spec files is putting you in a bad position to attack wine internals like winebuild/ntdll,
i suggest to read the docs (http://www.winehq.org/documentation) and the regarding wiki Developer pages (http://wiki.winehq.org/Developers).

-- 

Best Regards, André Hentschel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20120417/8bdce25d/attachment-0001.html>


More information about the wine-devel mailing list