GCC C FRONT END EXPLANATION

2009-03-19 Thread Guilherme Puglia
Hello to All,

I'm new in gcc list. And as all new members I have a problem.

I will copy an email whose I've sent to Joe Buck. If someone can
answer it for me, I really appreciate that.

"Hi Joe Buck,

My name is Guilherme and I am a Brazilian undergraduate student in
Computer Science.
First of all, I'm sending this email not for to ask you to do my work.
But, I have a work of programming languages course.
In this work I need extend the C language, adding new features wich
will allow a parallel support.
My teacher expect that we (students) modify the gcc. In other words he
wants that we create a new gcc front end.


I analysed the gcc C front end. I think the best way of implement this
work is modifying this front end, without create another.
However, my problems are:
I didn't understand the c parser existent in gcc, I don't know, but I
think that is because I don't have the C grammar wich the gcc front
end is implemented.
My solution is the best way to solve my problem?

Thank you very much,
Guilherme Puglia"


Thanks very much again!
Nice to meet you!

Guilherme

--
--
"Never memorize something that you can look up." - Albert Einstein
--


Re: GCC C FRONT END EXPLANATION

2009-03-20 Thread Guilherme Puglia
Hi,

Sorry for sent a duplicate message.

I and Eduardo are in the same class.
But i don't know who is Diego, Egidio and Rodrigo.
:]

But thanks to everybody.
I'll read the gcc docs in the source code!

See ya!

On 3/20/09, Dave Korn  wrote:
> Ben Elliston wrote:
>> Ah, good, a duplicate question that I just answered. :-)
>> See http://gcc.gnu.org/ml/gcc/2009-03/msg00554.html
>>
>> Ben
>
>   I bet Guilherme and Eduardo are in the same class at college!
>
> http://www.din.uem.br/~hppca/membros.html
>
>   Ah!  We can expect emails from Diego, Egidio, Juliano and Rodrigo next! :)
>
> cheers,
>   DaveK
>
>
>


-- 
--
"Never memorize something that you can look up." - Albert Einstein
--


Debugging gcc front end

2009-04-05 Thread Guilherme Puglia
Hi!

or better, hello again! I have posted a question (with my class friend
Eduardo) about 2 or 3 weeks ago. My question was about the grammar
wich gcc C front end use.

Happily, I found the answer of my question. Now, I'm having other
trouble. I wanna insert some "predefined" AST's tree nodes.

To solve my problem I wanna debug the C front end. I was trying to
debug the gcc main function, toplev_main. Unfortunately, I can't
insert a break point in this line.

I saw the site http://gcc.gnu.org/wiki/DebuggingGCC and
http://gcc.gnu.org/ml/gcc/2004-03/msg01195.html

But I don't understand where is "my path". And how to insert the break point.

If somebody can help me, I appreciated that.

Thanks so much!

Guilherme



-- 
--
"Never memorize something that you can look up." - Albert Einstein
--


C front end trouble

2009-04-06 Thread Guilherme Puglia
Hi,

I´m having some troubles again. I wanna convert a tree structure to
c_declspecs structure.

Anybody know how I could do that?

Thanks

-- 
--
"Never memorize something that you can look up." - Albert Einstein
--


Re: Debugging gcc front end

2009-04-08 Thread Guilherme Puglia
HI,

I wanna say thanks to everyone that help me.

My problem was find the correct path and the command line

I will expose what I did to help someone that can have the same problem.

I copied the files in my local path
$ cp debug /usr/local/bin/
$ cp debugx /usr/local/bin/

after I just run the debugx (tip: the third arg is referent to my gcc
binary, if put only gcc will debug the gcc installed in the system)

$ debugx cc1 local/bin/gcc File.c

To finish I added the break point

(gdb) b toplev_main  ( In my case, I was in emacs ).


Thanks again,
GPuglia

On Mon, Apr 6, 2009 at 8:11 PM, Dave Korn
 wrote:
> Guilherme Puglia wrote:
>> Hi!
>>
>> or better, hello again! I have posted a question (with my class friend
>> Eduardo) about 2 or 3 weeks ago. My question was about the grammar
>> wich gcc C front end use.
>
>  Yeh!  Hi again you guys :)
>
>> To solve my problem I wanna debug the C front end. I was trying to
>> debug the gcc main function, toplev_main. Unfortunately, I can't
>> insert a break point in this line.
>>
>> I saw the site http://gcc.gnu.org/wiki/DebuggingGCC and
>> http://gcc.gnu.org/ml/gcc/2004-03/msg01195.html
>>
>> But I don't understand where is "my path". And how to insert the break point.
>
>  Ok, sounds like you're not much familiar with using the shell?  When it says
> your path, it means the $PATH variable used to look for command-line
> executables.  About setting the breakpoint: if you're using gdb, the command
> would be "b toplev_main", it's all in the manual.
>
>  The main thing I'm not sure if you're fully aware of is that when you run
> "gcc" at the command-line you're just invoking a simple driver program that
> then invokes the preprocessor, compiler, assembler and linker as separate
> processes, so you don't want to debug gcc itself.
>
>  If you add "-v" to the gcc command-line, you will see (among other debug
> info) the separate individual commands it issues to run these other processes.
>  You'll see that the first two commands both invoke "cc1" (or "cc1plus in C++)
> - the first time, with the "-E" option to do the preprocessing on the source
> file, the second time without "-E" to process the generated .i file.  It's
> that second command-line that you want to actually run under the debugger to
> inspect the compilation process.
>
>
>    cheers,
>      DaveK
>
>



-- 
--
"Never memorize something that you can look up." - Albert Einstein
--