This is the mail archive of the insight@sources.redhat.com mailing list for the Insight 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]

anybody?help!!


my os win2000,cygwin...
it puzzled me many days and i don't know how to solve it....anybody can help me?thanks,thanks,thansk a lot....
when i use my insight for M.Core....every time when i debug a simple example the program exit...just do like this i think you might get the problem...
gcc-mcore -g file.c -o file.o
and then open the file.o in insight using GUI mode.....set breakpoint at line 11,and the connect object target--sim,and run,then next.....the program exit,yes?
the example:
void my_print(char * string);
void my_print2(char * string);
#include <stdio.h>
main ()
{
char my_string[] = "God save me!";
my_print (my_string);
my_print2 (my_string);
}
void my_print (char *string)
{ /*line 11 the problem happens*/
printf ("The string is %s\n", string);}
void my_print2 (char *string)
{
char *string2;
int size, i;
size = strlen (string);
string2 = (char *) malloc (size + 1);
for (i = 0; i < size; i++)
string2[size - i] = string[i];
string2[size+1] = '\0';
printf ("The string printed backward is %s\n", string2);
}
how does this happen???thanks again....expect your reply....




_________________________________________________________________
享用世界上最大的电子邮件系统— MSN Hotmail。 http://www.hotmail.com

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