This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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]

Re: Problem with gdb debug gcc


cazy <ad319min@gmail.com> writes:

> I've tried to use gdb to debug cc1 ( gcc 4.5.0)
>  
> as fellow:
>  
> (gdb) file ./cc1
> (gdb) run -I /usr/include /cazy/add.c 
> my problem is that ,when I creat the break point 
>  
> (gdb) break main  it worked well   (gcc/main.c) 
>  
> but 
> (gdb) break do_compile, it says  Function "do_compile" not defined.   
> (gcc/toplev.c) 
>  
> so i tried to break another function toplev_main() in the same source file 
> (gdb) break toplev_main  it worked                   (gcc/toplev.c) 
>  
> so I am confused, Is the function only with "extern" could be "break"?

Probably the compiler was built with optimization, as is the default.
Probably the optimizer inlined do_compile into its caller, so that it
does not exist in the executable, and therefore you can not set a
breakpoint on it.

Ian


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