<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>I tried printing error.descryption, but it didn't work, because when the error happens, it seems ReadPointerFromMemory never returned to my code.<BR> <BR> <BR>read from address 0000000001223f68<br>Traceback (most recent call last):<br> File "<input>", line 1, in <module><br> File "/home/leikong/repo/WindowsFabric/build.prod/test/fabdbg.py", line 289, in findall<br> findtypes(pattern,ignorePureVirtualType)<br> File "/home/leikong/repo/WindowsFabric/build.prod/test/fabdbg.py", line 246, in findtypes<br> if ignorePureVirtualType and has_pure_virtual(vtableAddr, pureVirtualFuncs) :<br> File "/home/leikong/repo/WindowsFabric/build.prod/test/fabdbg.py", line 190, in has_pure_virtual<br> vtableEndAddr = lldb.process.ReadPointerFromMemory(vtableAddr-8, error)<br> File "/home/leikong/bin/lldb/lib/python2.7/site-packages/lldb/__init__.py", line 9418, in ReadPointerFromMemory<br> return _lldb.SBProcess_ReadPointerFromMemory(self, addr, error)<br>OverflowError: in method 'SBProcess_ReadPointerFromMemory', argument 2 of type 'lldb::addr_t'<br><br> <BR><div>> Subject: Re: [lldb-dev] OverflowError: in method 'SBProcess_ReadPointerFromMemory', argument 2 of type 'lldb::addr_t'<br>> From: jingham@apple.com<br>> Date: Fri, 16 Sep 2016 17:12:24 -0700<br>> CC: lldb-dev@lists.llvm.org<br>> To: leikong@msn.com<br>> <br>> You passed an error into ReadPointerFromMemory. In the cases where you aren't getting what you expect, what does that error say?<br>> <br>> Jim<br>> <br>> > On Sep 16, 2016, at 5:06 PM, Lei Kong via lldb-dev <lldb-dev@lists.llvm.org> wrote:<br>> > <br>> > I ran into the error in the subject when running a python script with "script myfile.myscript()".<br>> > <br>> > The value addr_t parameter used is 0x0000000001223f68, the following works fine:<br>> > <br>> > (lldb) scr<br>> > Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.<br>> > >>> e = lldb.SBError()<br>> > >>> ptr = lldb.process.ReadPointerFromMemory(0x0000000001223f68, e)<br>> > >>> print ptr<br>> > 0<br>> > >>> <br>> > <br>> > Any suggestion how to further investigate? Thanks.<br>> > <br>> > myfile.myscript() calls the following function in a loop (iterate through all vtable symbols), which contains the call ReadPointerFromMemory.<br>> > <br>> > def dump_vtbl(vtableAddr) :<br>> > error = lldb.SBError()<br>> > vtableEndAddr = lldb.process.ReadPointerFromMemory(vtableAddr+8, error)<br>> > if not error.success :<br>> > return False<br>> > print "vtable: [%0.16x, %0.16x)" % (vtableAddr, vtableEndAddr)<br>> > for addr in range(vtableAddr, vtableEndAddr, 8) :<br>> > print "read from address %.016x" % addr<br>> > try:<br>> > funcAddr = lldb.process.ReadPointerFromMemory(addr, error)<br>> > except:<br>> > sys.exc_clear()<br>> > continue<br>> > if not error.success :<br>> > continue<br>> > <br>> > _______________________________________________<br>> > lldb-dev mailing list<br>> > lldb-dev@lists.llvm.org<br>> > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev<br>> <br></div> </div></body>
</html>