diff -r -u gdb-5.2.1.bu/gdb/dbxread.c gdb-5.2.1/gdb/dbxread.c --- gdb-5.2.1.bu/gdb/dbxread.c Fri Apr 5 08:33:49 2002 +++ gdb-5.2.1/gdb/dbxread.c Thu Nov 14 16:23:40 2002 @@ -2591,6 +2591,27 @@ fill_symbuf (abfd); bufp = &symbuf[symbuf_idx++]; INTERNALIZE_SYMBOL (nlist, bufp, abfd); + + /* ----------------------------------------------- */ + /* Horrible fix for when gdb is built with "-m64" */ + /* (sparc-sun-solaris2.8): */ + /* sign-extend the 32-bit result in nlist.n_value. */ + /* */ + /* This fixes the testcase in bug 567, */ + /* in that you can "p d1" successfully. */ + /* Actually you can "p" *anything* */ + /* (previously, you couldn't). */ + /* */ + /* I expect this will break something else, */ + /* we'll just have to wait to see what. */ + /* */ + /* The proper fix is for gdb to know that it's */ + /* working on a 32-bit program and */ + /* truncate addresses to 32 bits before using them */ + /* ----------------------------------------------- */ + + nlist.n_value = (long)(int)nlist.n_value; + OBJSTAT (objfile, n_stabs++); type = bfd_h_get_8 (abfd, bufp->e_type);