This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Hello, Stan Shebs wrote: >So if you've run into problems that need fixing, please speak up now! I'm using gdb-4.17 along with egcs-1.1.1 on a dec-alpha-osf1 machine. I would like to mention two things. 1) As far as I understand the gdb-4.17 sources the function `alpha_skip_prologue()' (in "./gdb-4.17/gdb/alpha-tdep.c") is not up to date. EGCS generates instructions of the form `subq $sp,n,$sp' in function prologues. This is not recognized by stock gdb-4.17. 2) EGCS (with `-g') produces line number stabs inside of function prologues. This confuses stock gdb-4.17 totally. As a result, the commands `next' and `nexti' are broken. As a work around the function `in_prologue()' (in "gdb-4.17/gdb/symtab.c") could be changed. Appended is a patch applying to stock gdb-4.17 which should fix it. But BE WARNED: This is no real bug fix. It is only a hacked work around! ---<cut-here>---<cut-here>---<cut-here>---<cut-here>--- diff -c -r stock-gdb-4.17/gdb/ChangeLog gdb-4.17/gdb/ChangeLog *** stock-gdb-4.17/gdb/ChangeLog Mon Apr 27 19:43:32 1998 --- gdb-4.17/gdb/ChangeLog Wed Mar 03 17:25:17 1999 *************** *** 1,3 **** --- 1,12 ---- + 1999-03-03 Norbert Berzen <norbert@dune.gia.rwth-aachen.de> + + * symtab.c (in_prologue): If the target machine is a DEC-Alpha + do special function prologue checking. Actually only needed + when debugging code generated by egcs-1.1 and newer. + + * alpha-tdep.c (alpha_skip_prologue): Added recognition of + `subq $sp,n,$sp' as being part of the prologue. + Mon Apr 27 10:43:04 1998 Jason Molenda (crash@bugshack.cygnus.com) * gdb_string.h (strdup): Don't specify arguments in prototype. diff -c -r stock-gdb-4.17/gdb/alpha-tdep.c gdb-4.17/gdb/alpha-tdep.c *** stock-gdb-4.17/gdb/alpha-tdep.c Wed Apr 22 03:23:07 1998 --- gdb-4.17/gdb/alpha-tdep.c Wed Mar 03 15:14:50 1999 *************** *** 1204,1209 **** --- 1204,1215 ---- continue; if ((inst & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */ continue; + + /* N.B.: The following is generated by egcs-1.1.1 (and + maybe egcs-1.1b, not checked) if n is an 8-bit value */ + if ((inst & 0xffe0ffff) == 0x43c0153e) /* subq $sp,n,$sp */ + continue; + else if ((inst & 0xfc1f0000) == 0xb41e0000 && (inst & 0xffff0000) != 0xb7fe0000) continue; /* stq reg,n($sp) */ *************** *** 1214,1219 **** --- 1220,1226 ---- /* reg != $zero */ else if (inst == 0x47de040f) /* bis sp,sp,fp */ continue; + else break; } diff -c -r stock-gdb-4.17/gdb/symtab.c gdb-4.17/gdb/symtab.c *** stock-gdb-4.17/gdb/symtab.c Tue Feb 10 22:45:12 1998 --- gdb-4.17/gdb/symtab.c Wed Mar 03 17:18:51 1999 *************** *** 3492,3498 **** --- 3492,3514 ---- if (sal.line == 0) goto nosyms; + #ifdef TM_ALPHA_H + + /* N.B.: Some compilers (e.g. egcs-1.1b/egcs-1.1.1) generate line + number info within function prologues. For that `sal.end' may + point somewhere inside of a function's prologue. Due to this + we change the logic here. If `pc < sal.end' we might be in a + prologue. But if `pc >= sal.end' we must do machine dependent + code examination to determine if we might be in a prologue. */ + if (sal.end > func_addr + && sal.end <= func_end + && pc < sal.end) + return 1; + + #else + + if (sal.end > func_addr && sal.end <= func_end) /* Is prologue in function? */ return pc < sal.end; /* Yes, is pc in prologue? */ *************** *** 3500,3505 **** --- 3516,3523 ---- case, tell the caller to find the prologue the hard way. */ return 1; + + #endif /* Come here when symtabs don't contain line # info. In this case, it is likely that the user has stepped into a library function w/o symbols, or ---<cut-here>---<cut-here>---<cut-here>---<cut-here>--- So long, -- Norbert