Is there something wrong when disassemble?

zhao mindong foolfox008@hotmail.com
Fri Aug 1 09:56:00 GMT 2003


void string_copy(char *str_from, char *str_to)
{  int i=0; // -------------------------------------------------------line 8
    for(; (*(str_to+i)=*(str_from+i))!='\0'; i++) ;
}
main()
{  static char array_str1[20]="I am a teacher.";
    char array_str2[20];
    string_copy(array_str1, array_str2);
}
(gdb) info line 8
Line 8 of "E:\BdxIDE\Bin\TestCase\main.c"
   starts at address 0x8100c038 <string_cop
   and ends at 0x8100c042 <string_copy+10>.
(gdb) info line *0x8100c044
Line 8 of "E:\BdxIDE\Bin\TestCase\main.c"
   starts at address 0x8100c042 <string_copy+10>
   and ends at 0x8100c046 <string_copy+14>.

why it is so diffrent??? wrong?
if i move" int i =0 " to next line then all is OK.how??

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



More information about the Gdb mailing list