From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9254 invoked by alias); 8 Nov 2002 17:20:18 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 9242 invoked from network); 8 Nov 2002 17:20:15 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 8 Nov 2002 17:20:15 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id gA8GvSw30698 for ; Fri, 8 Nov 2002 11:57:28 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gA8HKFf21697 for ; Fri, 8 Nov 2002 12:20:15 -0500 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gA8HKEs17818 for ; Fri, 8 Nov 2002 12:20:14 -0500 Received: by localhost.redhat.com (Postfix, from userid 469) id 7F48EFF79; Fri, 8 Nov 2002 12:16:06 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15819.61782.395057.654997@localhost.redhat.com> Date: Fri, 08 Nov 2002 09:20:00 -0000 To: "Kris Warkentin" Cc: Subject: Re: debugging sh4 in mi mode In-Reply-To: <061701c28747$9ad7d8e0$0202040a@catdog> References: <061701c28747$9ad7d8e0$0202040a@catdog> X-SW-Source: 2002-11/txt/msg00085.txt.bz2 Kris Warkentin writes: > We were having a problem when debugging sh4 in mi mode with the > "-data-disassemble" command. It seems that mi_cmd_disassemble() uses the > function pointer tm_print_insn which, for sh, was NULL. I looked at some > other arches and they seem to set tm_print_insn in their > _initialize__tdep() in -tdep.c so that is what I did to solve > our problem. Is this the proper way to do it? > Are you working with an older version of gdb? This should be fixed in current CVS. Right now the disassembler functions use ui_file_rewind (stb->stream); pc += TARGET_PRINT_INSN (pc, di); ui_out_field_stream (uiout, "inst", stb); TARGET_PRINT_INSN is wired into the multiarch machinery, and it will call gdb_print_insns_sh: set_gdbarch_print_insn (gdbarch, gdb_print_insn_sh); Do you have the above lines in your version of gdb? Elena > cheers, > > Kris > > Index: sh-tdep.c > =================================================================== > RCS file: /product/tools/gdb/gdb/sh-tdep.c,v > retrieving revision 1.8 > retrieving revision 1.9 > diff -c -r1.8 -r1.9 > *** sh-tdep.c 17 Sep 2002 18:31:22 -0000 1.8 > --- sh-tdep.c 8 Nov 2002 16:33:39 -0000 1.9 > *************** > *** 2207,2211 **** > --- 2207,2214 ---- > > register_gdbarch_init (bfd_arch_sh, sh_gdbarch_init); > > + if(!tm_print_insn) > + tm_print_insn = gdb_print_insn_sh; > + > add_com ("regs", class_vars, sh_show_regs_command, "Print all > registers"); > }