From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17635 invoked by alias); 24 Feb 2012 19:02:21 -0000 Received: (qmail 17624 invoked by uid 22791); 24 Feb 2012 19:02:18 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM,TW_GJ,TW_TJ X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Feb 2012 19:02:04 +0000 Received: from nat-dem.mentorg.com ([195.212.93.2] helo=eu2-mail.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1S10P4-0003Ed-HF from Thomas_Schwinge@mentor.com ; Fri, 24 Feb 2012 11:02:02 -0800 Received: from feldtkeller.schwinge.homeip.net ([172.30.64.147]) by eu2-mail.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 24 Feb 2012 20:02:01 +0100 From: Thomas Schwinge To: gdb-patches@sourceware.org Cc: Kevin Buettner Subject: [PATCH] [SH] PLT slots User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Fri, 24 Feb 2012 19:47:00 -0000 Message-ID: <87ehtk6onw.fsf@schwinge.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-02/txt/msg00590.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 7127 Hi! This patch fixes the following class of errors: Breakpoint 1, main () at /scratch/tschwing/ST_sh-linux-gnu-lite/src/gdb= -trunk/gdb/testsuite/gdb.base/callfuncs.c:508 508 malloc(1); (gdb) info source [...] (gdb) next malloc@plt () (gdb) FAIL: gdb.base/callfuncs.exp: next to t_double_values next Single stepping until exit from function malloc@plt, which has no line number information. ?? () (gdb) FAIL: gdb.base/callfuncs.exp: next to t_structs_c Testing for sh-unknown-linux-gnu for sh4a, there are no regressions, and the following turn into PASSes: FAIL: gdb.base/break.exp: step over breakpoint FAIL: gdb.base/break.exp: clear current line has no breakpoint disallow= ed FAIL: gdb.base/callfuncs.exp: next to t_double_values FAIL: gdb.base/callfuncs.exp: next to t_structs_c FAIL: gdb.base/callfuncs.exp: next to t_double_values FAIL: gdb.base/callfuncs.exp: next to t_structs_c FAIL: gdb.base/callfuncs.exp: bt after continuing from call dummy break= point FAIL: gdb.base/callfuncs.exp: next to t_double_values FAIL: gdb.base/callfuncs.exp: next to t_structs_c FAIL: gdb.base/callfuncs.exp: bt after finishing from call dummy breakp= oint FAIL: gdb.base/callfuncs.exp: next to t_double_values FAIL: gdb.base/callfuncs.exp: next to t_structs_c FAIL: gdb.base/callfuncs.exp: back at main after return from call dummy= breakpoint FAIL: gdb.base/callfuncs.exp: next to t_double_values FAIL: gdb.base/callfuncs.exp: next to t_structs_c FAIL: gdb.base/callfuncs.exp: backtrace at nested call level 1 FAIL: gdb.base/callfuncs.exp: backtrace at nested call level 2 FAIL: gdb.base/callfuncs.exp: backtrace at nested call level 3 FAIL: gdb.base/callfuncs.exp: backtrace at nested call level 4 FAIL: gdb.base/callfuncs.exp: backtrace after finish from nested call l= evel 4 FAIL: gdb.base/callfuncs.exp: backtrace after finish from nested call l= evel 3 FAIL: gdb.base/callfuncs.exp: backtrace after finish from nested call l= evel 2 FAIL: gdb.base/callfuncs.exp: backtrace after finish from nested call l= evel 1 FAIL: gdb.base/define.exp: use hook-stop command FAIL: gdb.base/ena-dis-br.exp: step FAIL: gdb.base/ending-run.exp: step out of main FAIL: gdb.base/longjmp.exp: next over setjmp (1) FAIL: gdb.base/longjmp.exp: next to longjmp (1) FAIL: gdb.base/longjmp.exp: next over setjmp (2) FAIL: gdb.base/sepdebug.exp: step over breakpoint FAIL: gdb.base/sepdebug.exp: clear current line has no breakpoint disal= lowed FAIL: gdb.base/shlib-call.exp: print g FAIL: gdb.base/so-impl-ld.exp: step over solib call FAIL: gdb.base/so-impl-ld.exp: step into solib call FAIL: gdb.base/so-impl-ld.exp: step in solib call FAIL: gdb.base/so-impl-ld.exp: step out of solib call FAIL: gdb.base/store.exp: var struct 3 u; next to add_struct_3 call FAIL: gdb.base/store.exp: var struct 3 u; print old u, expecting {s =3D= \{0, 0, 0}} FAIL: gdb.base/store.exp: var struct 3 u; set u to s_3 FAIL: gdb.base/store.exp: var struct 3 u; print new u, expecting {s =3D= \{1, 2, 3}} FAIL: gdb.base/structs.exp: return foo; return 2 structs-tc FAIL: gdb.base/structs.exp: return foo; return 3 structs-tc FAIL: gdb.base/structs.exp: return foo; return 4 structs-tc FAIL: gdb.base/structs.exp: return foo; return 5 structs-tc FAIL: gdb.base/structs.exp: return foo; return 6 structs-tc FAIL: gdb.base/structs.exp: return foo; return 7 structs-tc FAIL: gdb.base/structs.exp: return foo; return 8 structs-tc FAIL: gdb.base/structs.exp: return foo; return 2 structs-ts FAIL: gdb.base/structs.exp: return foo; return 3 structs-ts FAIL: gdb.base/structs.exp: return foo; return 4 structs-ts FAIL: gdb.base/structs.exp: return foo; return 2 structs-ts-tc FAIL: gdb.base/structs.exp: return foo; return 2 structs-tc-ts FAIL: gdb.cp/pr-1210.exp: step past initialization FAIL: gdb.cp/pr-1210.exp: print *obj FAIL: gdb.cp/pr-1210.exp: print obj->myB FAIL: gdb.threads/linux-dp.exp: info threads after: 0 FAIL: gdb.threads/linux-dp.exp: info threads after: 1 FAIL: gdb.threads/linux-dp.exp: info threads after: 2 FAIL: gdb.threads/linux-dp.exp: info threads after: 3 FAIL: gdb.threads/linux-dp.exp: info threads after: 4 gdb/ 2012-02-24 Thomas Schwinge * sh-tdep.c (sh_make_stub_cache, sh_stub_this_id) (sh_stub_unwind_sniffer): New functions. (sh_stub_unwind): New variable. (sh_gdbarch_init): Wire everything. Index: gdb/sh-tdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/sh-tdep.c,v retrieving revision 1.238 diff -u -p -r1.238 sh-tdep.c --- gdb/sh-tdep.c 24 Feb 2012 11:00:07 -0000 1.238 +++ gdb/sh-tdep.c 24 Feb 2012 18:59:45 -0000 @@ -41,6 +41,7 @@ #include "osabi.h" #include "reggroups.h" #include "regset.h" +#include "objfiles.h" =20 #include "sh-tdep.h" =20 @@ -2666,6 +2667,57 @@ static const struct frame_base sh_frame_ sh_frame_base_address }; =20 +static struct sh_frame_cache * +sh_make_stub_cache (struct frame_info *this_frame) +{ + struct gdbarch *gdbarch =3D get_frame_arch (this_frame); + struct sh_frame_cache *cache; + + cache =3D sh_alloc_frame_cache (); + + cache->saved_sp + =3D get_frame_register_unsigned (this_frame, gdbarch_sp_regnum (gdbarc= h)); + + return cache; +} + +static void +sh_stub_this_id (struct frame_info *this_frame, void **this_cache, + struct frame_id *this_id) +{ + struct sh_frame_cache *cache; + + if (*this_cache =3D=3D NULL) + *this_cache =3D sh_make_stub_cache (this_frame); + cache =3D *this_cache; + + *this_id =3D frame_id_build (cache->saved_sp, get_frame_pc (this_frame)); +} + +static int +sh_stub_unwind_sniffer (const struct frame_unwind *self, + struct frame_info *this_frame, + void **this_prologue_cache) +{ + CORE_ADDR addr_in_block; + + addr_in_block =3D get_frame_address_in_block (this_frame); + if (in_plt_section (addr_in_block, NULL)) + return 1; + + return 0; +} + +static const struct frame_unwind sh_stub_unwind =3D +{ + NORMAL_FRAME, + default_frame_unwind_stop_reason, + sh_stub_this_id, + sh_frame_prev_register, + NULL, + sh_stub_unwind_sniffer +}; + /* The epilogue is defined here as the area at the end of a function, either on the `ret' instruction itself or after an instruction which destroys the function's stack frame. */ @@ -3055,6 +3107,7 @@ sh_gdbarch_init (struct gdbarch_info inf gdbarch_init_osabi (info, gdbarch); =20 dwarf2_append_unwinders (gdbarch); + frame_unwind_append_unwinder (gdbarch, &sh_stub_unwind); frame_unwind_append_unwinder (gdbarch, &sh_frame_unwind); =20 return gdbarch; (This is modeled after what arm-tdep and tic6x-tdep are doing.) Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature Content-length: 489 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJPR96jAAoJENuKOtuXzphJF1QH/1RJREeRfti5JLQThEYEBLs8 TmJU9YTUu0rX9TYdyavw27/ysdnWiG1xBpOICtfEjhK1QwNclUqMQrhwFET9b1eh ER7BCSrKex0oncuS5Orw8me2+SkctY/cl+qb4/de5MS/83nIK+TXI+L5pKHG8+hn 6T9Ey/pjjPiLITDL94+UW84RSgPBDpjHHQ5jHBvTZkwBOKcWZA+mY0Rj3PYFCfvh QKiHOQhHZpLnDGUqTGiHpZKgl5sF+5b4CT6rcZWTRXp2wkWLZnFJernRVHZnjsyq vloK3S5ouuUhmIl2bi9LOb0smTnXFJ2ItrOZIPhTKmZAteTwnsOzPVwUKOP+2Z0= =r+kc -----END PGP SIGNATURE----- --=-=-=--