#113901 - sgeos - Mon Jan 01, 2007 12:52 am
I'm working on a PC side test scaffold for some code, and the first member of one of my arrays is messed up. I have never seen anything like this before. Could it be a compiler error?
The macros just spit out a string and function pointer, like the first line. The assembler looks fine:
A list of string constants followed by the array. The array members are lined up in memory in a regular fashion, but the location of the first string is odd:
The function pointers appear to be correct. The "printme" string is in the binary. It lives right in front of "pr", where it should be, but address appears to have been botched.
-Brendan
Code: |
CommandAction mList[] =
{ {"printme", &print}, DISPATCH_ALIAS(pr, print), DISPATCH_COMMAND(print), DISPATCH_ALIAS(q, quit), DISPATCH_COMMAND(quit), DISPATCH_ALIAS(set, set), DISPATCH_COMMAND(var), LAST_DISPATCH_COMMAND }; |
The macros just spit out a string and function pointer, like the first line. The assembler looks fine:
Code: |
LC0:
.ascii "printme\0" LC1: .ascii "pr\0" LC2: .ascii "print\0" LC3: .ascii "q\0" LC4: .ascii "quit\0" LC5: .ascii "set\0" LC6: .ascii "var\0" .globl _mList .data .align 32 _mList: .long LC0 .long _print .long LC1 .long _print .long LC2 .long _print .long LC3 .long _quit .long LC4 .long _quit .long LC5 .long _set .long LC6 .long _var .long 0 .long 0 |
A list of string constants followed by the array. The array members are lined up in memory in a regular fashion, but the location of the first string is odd:
Code: |
Array Function String String
0: 0x00403000 0x004015C1 0x0040FC60 <----- Why is it here?! 1: 0x00403008 0x004015C1 0x00404038 pr 2: 0x00403010 0x004015C1 0x0040403B print 3: 0x00403018 0x0040175A 0x00404041 q 4: 0x00403020 0x0040175A 0x00404043 quit 5: 0x00403028 0x004016BD 0x00404048 set 6: 0x00403030 0x00401620 0x0040404C var |
The function pointers appear to be correct. The "printme" string is in the binary. It lives right in front of "pr", where it should be, but address appears to have been botched.
-Brendan