Re: exec

Russell Shaw
2005-01-02T07:12:03Z

Daniel Jacobowitz wrote:
> On Sun, Jan 02, 2005 at 02:44:55PM +1100, Russell Shaw wrote:
>
>>Hi,
>>When i step into:
>>
>> (*func) (program, argv);
>>
>>gdb exits.
>>
>>func is execv, and program is "/usr/local/libexec/gcc/avr/3.4.3/cc1"
>>
>>How do i get into cc1 so i can set breakpoints there?
>
> Run it by hand - gcc -v will show you the command line. GDB has very
> limited support for debugging across exec, depending on your platform.

Hi,
Cc1 runs ok at the command line:

/usr/local/libexec/gcc/avr/3.4.3/cc1 -quiet -v main.c -quiet -dumpbase main.c -dP -mmcu=atmega16
-auxbase main -g -O0 -Wall -Wno-unused -version -o /tmp/cccVrfqY.s

When i try to run the same thing in gdb, it crashes:

Program received signal SIGSEGV, Segmentation fault.
0x080f3cd1 in init_emit () at ../../gcc-3.4.3/gcc/emit-rtl.c:5354
/home/russell/SRC/gcc-3.4.3/gcc/emit-rtl.c:5354:138102:beg:0x80f3cd1
(gdb)

It crashes in emit-rtl.c here:

/* Indicate that the virtual registers and stack locations are
all pointers. */
REG_POINTER (stack_pointer_rtx) = 1;