Re: Anyone using alpha-freebsd target in gdb-current?

Jason R Thorpe
2002-01-13T00:50:05Z

> > But, anyway, I'd really like to just know if anyone is successfully using
> > the alpha bsd native support successfully right now. That would help
> > eliminate some variables for me.
>
> Feel free to ask!

Okay, well, here is something I would appreciate a sanity-check on.

Breakpoints are definitely having a problem on the alpha target. For the
following simple program:

GNU gdb 2002-01-12-cvs
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "alpha-unknown-netbsd"...
(gdb) list main
1 int
2 main(int argc, char *argv[])
3 {
4 int a, b, c, d;
5
6 a = 1;
7 b = 2;
8 c = 3;
9 d = 4;
10 printf("a = %d, b = %d, c = %d, d = %d\n", a, b, c, d);
(gdb) break 9
Breakpoint 1 at 0x120000dbc: file foo.c, line 9.
(gdb) run
Starting program: /var/tmp/a.Breakpoint 1, main (argc=1, argv=0x1fffff4d0) at foo.c:9
9 d = 4;
(gdb) print a
$1 = 1
(gdb) print b
$2 = 2
(gdb) print c
$3 = 3
(gdb) cont
Continuing.
a = 1, b = 2, c = 3, d = 0

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb)

If I do not set that breakpoint, then "d" is set properly. (Yah,
I haven't figured out why it segv's on exit yet, that's pretty cute,
too.)

Now, if you look at what happens during a software single-step:

(gdb) break main
Breakpoint 1 at 0x120000d98: file foo.c, line 3.
(gdb) run
Starting program: /var/tmp/a.out
*** FOUND .interp SECTION

Breakpoint 1, main (argc=-32, argv=0x1) at foo.c:3
3 {
(gdb) stepi
0x120000da0 3 {
(gdb)
0x120000da8 6 a = 1;
(gdb)
0x120000db0 7 b = 2;
(gdb)

Note the PC value is incrementing by 8 each time -- this is wrong, it should
be incrementing by 4. This, combined with my failure above, leads me to
believe that the PC is not being adjusted properly when the breakpoint is
tripped.