This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with gdb debug gcc
- From: Ian Lance Taylor <iant at google dot com>
- To: cazy <ad319min at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 26 May 2010 22:43:53 -0700
- Subject: Re: Problem with gdb debug gcc
- References: <28688877.post@talk.nabble.com>
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