From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20684 invoked by alias); 24 Feb 2011 18:57:16 -0000 Received: (qmail 20676 invoked by uid 22791); 24 Feb 2011 18:57:15 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,TW_EG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Feb 2011 18:57:09 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id p1OIuief023305; Thu, 24 Feb 2011 19:56:44 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id p1OIugJQ004697; Thu, 24 Feb 2011 19:56:42 +0100 (CET) Date: Thu, 24 Feb 2011 18:58:00 -0000 Message-Id: <201102241856.p1OIugJQ004697@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: brobecker@adacore.com CC: gdb-patches@sourceware.org, brobecker@adacore.com In-reply-to: <1298569763-18784-17-git-send-email-brobecker@adacore.com> (message from Joel Brobecker on Thu, 24 Feb 2011 12:49:21 -0500) Subject: Re: [PATCH 16/18] Add tdep files for x86 and powerpc. References: <1298569763-18784-1-git-send-email-brobecker@adacore.com> <1298569763-18784-17-git-send-email-brobecker@adacore.com> 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: 2011-02/txt/msg00720.txt.bz2 > From: Joel Brobecker > Cc: Joel Brobecker > > This patch adds a new GDB_OSABI_VXWORKS for VxWorks targets, and > introduces new VxWorks tdep files for x86 and powerpc. They will > be included in the build by the next patch. > > gdb/ChangeLog: > > * defs.h (enum gdb_osabi): Add GDB_OSABI_VXWORKS. > * osabi.c (gdb_osabi_names): Add entry for GDB_OSABI_VXWORKS. > * i386-vxworks-tdep.c, rs6000-vxworks-tdep.c: New files. > --- > gdb/defs.h | 1 + > gdb/i386-vxworks-tdep.c | 53 +++++++++++++++++++++++ > gdb/osabi.c | 1 + > gdb/rs6000-vxworks-tdep.c | 105 +++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 160 insertions(+), 0 deletions(-) > create mode 100644 gdb/i386-vxworks-tdep.c > create mode 100644 gdb/rs6000-vxworks-tdep.c The i386 bits have my blessing. The powerpc bits look a bit weird though: > +static CORE_ADDR > +rs6000_vxworks_push_dummy_code (struct gdbarch *gdbarch, > + CORE_ADDR sp, CORE_ADDR funaddr, > + struct value **args, int nargs, > + struct type *value_type, > + CORE_ADDR *real_pc, CORE_ADDR *bp_addr, > + struct regcache *regcache) > +{ > + /* Something here to findout the size of a breakpoint and then > + allocate space for it on the stack. */ > + int bplen; > + /* This code assumes frame align. */ > + gdb_assert (gdbarch_frame_align_p (gdbarch)); > + /* Force the stack's alignment. The intent is to ensure that the SP > + is aligned to at least a breakpoint instruction's boundary. */ > + sp = gdbarch_frame_align (gdbarch, sp); > + /* Allocate space for, and then position the breakpoint on the stack. */ > + if (gdbarch_inner_than (gdbarch, 1, 2)) > + { > + CORE_ADDR bppc = sp; > + gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen); > + sp = gdbarch_frame_align (gdbarch, sp - bplen); > + (*bp_addr) = sp; > + /* Should the breakpoint size/location be re-computed here? */ > + } > + else > + { > + (*bp_addr) = sp; > + gdbarch_breakpoint_from_pc (gdbarch, bp_addr, &bplen); > + sp = gdbarch_frame_align (gdbarch, sp + bplen); > + } This bit of code looks like it is trying to support both stacks growing up and stack growing down. Does that really happen on VxWorks? Your code doesn't call set_gdbarch_inner_than(), so at least one of these branches must be dead code.