From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,81a782944ec77e6a X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-01-25 11:20:35 PST Path: supernews.google.com!sn-xit-02!sn-xit-04!supernews.com!feed.textport.net!logbridge.uoregon.edu!pln-w!spln!dex!extra.newsguy.com!newsp.newsguy.com!jwest From: jwest@emag.ecen.okstate.edu (Jim West) Newsgroups: comp.unix.tru64 Subject: Re: gdb:"next" works as "step" Date: 25 Jan 2001 18:24:39 GMT Organization: http://extra.newsguy.com Message-ID: References: NNTP-Posting-Host: p-890.newsdawg.com User-Agent: slrn/0.9.6.2 (OSF1) Xref: supernews.google.com comp.unix.tru64:1577 In article , i Watch wrote: >Hi all, > I recently installed gdb 5.0 on alpha-tru64 4.0G. I have gcc 2.95.2 >installed on the same machine. When I debug using gdb, "next" works as >"step", ie when debugger steps into a function irrespective of whether I >type "next" or "step". This is wasting a lot of my time, any advice would be >of great help. > >Thanks, >Prakash Following is the complete response I got to the same question a couple years ago. Using gdb-4.17 the patch that Norbert sent me works quite well (at least on pre-5.1 releases of Tru64). ******starts here**** Hi Jim, >... if you would be willing ... Of course, appended is the patch to make gdb work with code generated by egcs-1.1.x. The patch applies to stock gdb-4.17 as it can be found at every GNU mirror. >... that gdb-4.18 would fix the problem ... No, not at all. It seems to me that gdb-4.18 has some other serious bugs. (Didn't get the time to dig into it). Actually there are two bugs. A big one in egcs-1.1.x and small one in gdb-4.17. The patch fixes the small bug in gdb and it contains a work around for the big egcs bug. A real egcs bug fix would not only affect the machine dependend parts of egcs but it would also affect some machine independend parts of it. Unfortunately I do not have the time to fix it. So I contacted the egcs maintainer and he asserted me that my request got queued. For that chances are good to get a working egcs in a couple of years ;-). Anyway, here is the patch. It would be nice to hear from you if it works. Best regards, -- Norbert ------ ------ ------ ------ *** gdb-4.17/gdb/ChangeLog.orig Mon Apr 27 19:43:32 1998 --- gdb-4.17/gdb/ChangeLog Thu Mar 25 14:15:54 1999 *************** *** 1,3 **** --- 1,12 ---- + 1999-03-25 Norbert Berzen + + * symtab.c (in_prologue): #ifdef TM_ALPHA_H ... . Cannot use + `sal' for in-prologue checking on code generated by egcs-1.1.x + for alpha-dec-osf target. + + * alpha-tdep.c (alpha_skip_prologue): Recognize `subq $sp,n,$sp', + `stq $zero,n($sp)' and `stt $zero,n($sp)' as 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. *** gdb-4.17/gdb/alpha-tdep.c.orig Wed Apr 22 03:23:07 1998 --- gdb-4.17/gdb/alpha-tdep.c Thu Mar 25 10:34:22 1999 *************** *** 1204,1221 **** continue; if ((inst & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */ continue; ! else if ((inst & 0xfc1f0000) == 0xb41e0000 ! && (inst & 0xffff0000) != 0xb7fe0000) ! continue; /* stq reg,n($sp) */ ! /* reg != $zero */ ! else if ((inst & 0xfc1f0000) == 0x9c1e0000 ! && (inst & 0xffff0000) != 0x9ffe0000) ! continue; /* stt reg,n($sp) */ ! /* reg != $zero */ ! else if (inst == 0x47de040f) /* bis sp,sp,fp */ continue; ! else ! break; } return pc + offset; } --- 1204,1219 ---- continue; if ((inst & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */ continue; ! if ((inst & 0xffe0ffff) == 0x43c0153e) /* subq $sp,n,$sp */ ! continue; ! if ((inst & 0xfc1f0000) == 0xb41e0000) /* stq reg,n($sp) */ continue; ! if ((inst & 0xfc1f0000) == 0x9c1e0000) /* stt reg,n($sp) */ ! continue; ! if (inst == 0x47de040f) /* bis sp,sp,fp */ ! continue; ! ! break; } return pc + offset; } *** gdb-4.17/gdb/symtab.c.orig Tue Feb 10 22:45:12 1998 --- gdb-4.17/gdb/symtab.c Thu Mar 25 14:05:34 1999 *************** *** 3492,3497 **** --- 3492,3517 ---- if (sal.line == 0) goto nosyms; + #ifdef TM_ALPHA_H + + /* N.B.: If the `sal' we got does not belong to the pc's + function we fetch the following `sal'. This is actually + a work around a bug in egcs-1.1.[12] since this compiler + generates bad line number info for alpha-dec-osf targets. */ + + if ((sal.pc < func_addr) || (sal.pc > sal.end)) + { + sal.line = 0; + + if (sal.end < func_end) + sal = find_pc_line (sal.end, 0); + + if (sal.line == 0) + goto nosyms; + } + + #endif /* TM_ALPHA_H */ + if (sal.end > func_addr && sal.end <= func_end) /* Is prologue in function? */ return pc < sal.end; /* Yes, is pc in prologue? */ ------ ------ ------ ------ -- James C. West (Jim) jwest@okstate.edu Professor jwest@emag.ecen.okstate.edu Electrical and Computer Engineering Oklahoma State University