This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Is there something wrong when disassemble?


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]