CFG,DFG

2009-10-21 Thread swati raina
Hi..

The compiler stores the information about dependencies among various 
instruction in control flow graphs and data flow graph. What kind of graphs are 
these? and can this dependency information be extracted from gcc? 
 
Thanks
Swati Raina



  Get your new Email address!
Grab the Email name you've always wanted before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/


help on debugging gcc using gdb

2010-01-10 Thread swati raina
Hi,
I want to detect simple 'if-else' statements for which i need to understand the 
source code of gcc. I am using version 4.4.0.
So,

I am tried to debug gcc using the following commands

1)[sw...@localhost ~]$ gdb --args /usr/bin/gcc

Missing separate debuginfos, use: debuginfo-install gcc-4.4.0-4.i586


2)(gdb) run gcc
Starting program: /usr/bin/gcc gcc

//The error is as follows:

gcc: gcc: No such file or directory
gcc: no input files

Program exited with code 01.
(gdb)q

// i tried next , the exec command  but still faced same error

(gdb) exec gcc
(gdb) run
Starting program: /usr/lib/ccache/gcc gcc
Executing new program: /usr/bin/gcc
Missing separate debuginfos, use: debuginfo-install ccache-2.4-14.fc11.i586
gcc: gcc: No such file or directory
gcc: no input files

Program exited with code 01.
Missing separate debuginfos, use: debuginfo-install gcc-4.4.0-4.i586
(gdb)q


S Raina




  Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com. 
http://mail.promotions.yahoo.com/newdomains/aa/


help on gcc source code odification

2010-01-29 Thread swati raina


Hi,
I am working with gcc 4.4.2.
I installed the same on my machine using the following command lines.

1)To extract in a new directory,i used,
mkdir gcc1
cd gcc1
tar -xvf gcc-4.4.2.tar.gz

set srcdir = "/home/swati/gcc1/gcc-4.4.2"
set objdir = "/home/swati/gcc1/gcc-bin"
set insdir = "/home/swati/gcc1//usr/local"
mkdir -p srcdir
mkdir -p objdir
mkdir -p insdir

2)Then i configured it in objdir directory using,

/home/swati/gcc1/gcc-4.4.2/configure --prefix=$insdir
make bootstrap -j3
make install (in root)

3)Then compiled using,
export PATH=$insdir/bin/:$PATH
gcc helloworld.c -v


and finally compiled a helloworld.c file using this version and it worked fine.
Now, i wish to modify the source code of gcc.
So am working on the c-parser.c file to introduce an exception
 generation on detection of 'if' statement.
For it ,i used folowing code

static jmp_buf buf;
void exception_handler()
{
FILE *fp1;
fp1=fopen("/home/swati/t.txt","w");
fprintf(fp1,"'if' detected\n"); 
longjmp(buf,1); 
}

static void
c_parser_if_statement (c_parser *parser)
{

FILE *fp;
if (!setjmp(buf) )
{
exception_handler(); 
}
else
{ 
fp=fopen("/home/swati/t.txt","a");
fprintf(fp,"\t\t\t\tBack to if block");
}

}

Now , i recompiled the gcc using following commands,

1)Changed to path to build directory,

 cd /home/swati/newgcc/objdir/build-i686-pc-linux-gnu/gcc/build/

2) Configured with --disable-bootstrap modification.

 /home/swati/newgcc/gcc-4.4.2/configure --disable-bootstrap--prefix=$insdir

 make all-gcc

3)Selected newly configured gcc and tried to compile helloworld.c file.

export
 PATH=$insdir/bin/:$PATH
gcc helloworld.c -v

However, the changes (t.txt creation and statements insertion within it) were 
not reflected and i got an error:
"source is more recent than the executable"

Am i working with the correct file and were the installation and compilation 
steps correct. Also was i correct in attempt to modify the source code 
Please help.

Swati



  Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com. 
http://mail.promotions.yahoo.com/newdomains/aa/