Le 04/03/2011 14:37, Hilaire Fernandes a écrit :

> Now, I still don't figure out what I should look at when stepping in the
> VM from GDB. I will try to figure out again.


Here is the step by step from breakpoint to running state:


Breakpoint 1, initialiseModule () at
/home/hilaire/Travaux/pharo/temp/COG/src/plugins/LocalePlugin/LocalePlugin.c:112
112             return sqLocInitialize();
(gdb) n
113     }
(gdb) n
callInitializersIn (pluginName=<value optimized out>, ffiLoad=<value
optimized out>)
    at
/home/hilaire/Travaux/pharo/temp/COG/platforms/Cross/vm/sqNamedPrims.c:211
211                     if(!okay) {
(gdb) print
The history is empty.
(gdb) print init2
$1 = (void *) 0x559530
(gdb) print okay
$2 = <value optimized out>
(gdb) n
findOrLoadModule (pluginName=0x559530
"U\211\345S\350\356\370\377\377\201û\032", ffiLoad=5606992)
    at
/home/hilaire/Travaux/pharo/temp/COG/platforms/Cross/vm/sqNamedPrims.c:286
286     }
(gdb) n
ioLoadFunctionFrom (functionName=0xbff5d74c "primitiveTimezoneOffset",
pluginName=0xbff5d64c "LocalePlugin")
    at
/home/hilaire/Travaux/pharo/temp/COG/platforms/Cross/vm/sqNamedPrims.c:298
298             if(!module) {
(gdb) n
303             if(!functionName) {
(gdb) n
309     }
(gdb) n
308             return findFunctionIn(functionName, module);
(gdb) n
309     }
(gdb) n
ioLoadFunctionFrom (functionName=0x78139a2c "primitiveTimezoneOffset",
pluginName=0x17 <Address 0x17 out of bounds>)
    at
/home/hilaire/Travaux/pharo/temp/COG/platforms/Cross/vm/sqNamedPrims.c:308
308             return findFunctionIn(functionName, module);
(gdb) n
findFunctionIn (functionName=0xbff5d74c "primitiveTimezoneOffset",
module=0x81a11e8)
    at
/home/hilaire/Travaux/pharo/temp/COG/platforms/Cross/vm/sqNamedPrims.c:157
157     {
(gdb) n
158             if(module->handle == squeakModule->handle)
(gdb) n
161                     return findExternalFunctionIn(functionName, module);
(gdb) n
162     }
(gdb) n
ioLoadExternalFunctionOfLengthFromModuleOfLength
(functionNameIndex=2014550572, functionNameLength=23,
    moduleNameIndex=2014550204, moduleNameLength=12)
    at
/home/hilaire/Travaux/pharo/temp/COG/platforms/Cross/vm/sqNamedPrims.c:332
332     }
(gdb) n
primitiveExternalCall () at
/home/hilaire/Travaux/pharo/temp/COG/src/vm/gcc3x-cointerp.c:27113
27113           if (addr == 0) {
(gdb) n
27118                   for (i = GIV(externalPrimitiveTableFirstFreeIndex); i <=
(MaxExternalPrimitiveTableSize - 1); i += 1) {
(gdb) n
27122                                   goto l1;
(gdb) n
27119                           if ((externalPrimitiveTable[i]) == 0) {
(gdb) n
27120                                   externalPrimitiveTable[i] = addr;
(gdb) n
27121                                   index = 
GIV(externalPrimitiveTableFirstFreeIndex) = i + 1;
(gdb) n
27128           longAtput((lit + BaseHeaderSize) + (3 << ShiftForWord), ((index
<< 1) | 1));
(gdb) n
27129           if (index >= 0) {
(gdb) n
27130                   
rewriteMethodCacheEntryForExternalPrimitiveToFunction(addr);
(gdb) n
27131                   callExternalPrimitive(addr);
(gdb) n
27137   }
(gdb) n
activateInterpreterMethodFromMachineCode () at
/home/hilaire/Travaux/pharo/temp/COG/src/vm/gcc3x-cointerp.c:8598
8598                            if (FailImbalancedPrimitives
(gdb) n
8600     && ((GIV(framePointer) == savedFramePointer)
(gdb) n
8598                            if (FailImbalancedPrimitives
(gdb) n
8601     && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) <
heapBase))))) {
(gdb) n
8608                            if (GIV(nextProfileTick) > 0) {
(gdb) n
8613                    if (GIV(primFailCode) == 0) {
(gdb) n
8614                            returntoExecutive(popStack(), 0);
(gdb) n
8621            activateNewMethod();
(gdb) n



-- 
Education 0.2 -- http://blog.ofset.org/hilaire


Reply via email to