From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1995 invoked by alias); 28 Aug 2003 22:35:53 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 1968 invoked from network); 28 Aug 2003 22:35:48 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 28 Aug 2003 22:35:48 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id DA3E42B7F for ; Thu, 28 Aug 2003 18:35:43 -0400 (EDT) Message-ID: <3F4E83BF.1040702@redhat.com> Date: Thu, 28 Aug 2003 22:35:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [patch/rfc] Eliminate deprecated_tm_print_insn Content-Type: multipart/mixed; boundary="------------010209080706010805000300" X-SW-Source: 2003-08/txt/msg00521.txt.bz2 This is a multi-part message in MIME format. --------------010209080706010805000300 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 592 (and there was much rejoycing) This patch eliminates the last remenants of the global variables: deprecated_tm_print_insn deprecated_tm_print_insn_info Everything now goes through disasm.c. Note that all architectures currently need to supply TARGET_PRINT_INSN. There's one "future work" item - eliminate TARGET_PRINT_INSN. GDB's multi-arch needs to be a way to map an address onto an arch/mach. Once there opcodes/ (with some interface fudging) can be called directly and it can select the disassembler (well in theory). Anyway, I'll look to commit this in a few days. Andrew --------------010209080706010805000300 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 4564 2003-08-28 Andrew Cagney * arch-utils.h (legacy_print_insn): Delete declaration. * arch-utils.c (legacy_print_insn): Delete function. * disasm.c (deprecated_tm_print_insn_info): Delete. (_initialize_disasm): Delete function, contained code initializing deprecated_tm_print_insn_info. * gdbarch.sh (deprecated_tm_print_insn): Delete. (deprecated_tm_print_insn_info): Delete. (TARGET_PRINT_INSN): Do not provide a default. * gdbarch.h, gdbarch.c: Re-generate. Index: arch-utils.c =================================================================== RCS file: /cvs/src/src/gdb/arch-utils.c,v retrieving revision 1.91 diff -u -r1.91 arch-utils.c --- arch-utils.c 21 Aug 2003 20:43:10 -0000 1.91 +++ arch-utils.c 28 Aug 2003 22:16:04 -0000 @@ -140,14 +140,6 @@ return ip == SKIP_PROLOGUE (ip); } -/* New/multi-arched targets should use the correct gdbarch field - instead of using this global pointer. */ -int -legacy_print_insn (bfd_vma vma, disassemble_info *info) -{ - return (*deprecated_tm_print_insn) (vma, info); -} - /* Helper functions for INNER_THAN */ int Index: arch-utils.h =================================================================== RCS file: /cvs/src/src/gdb/arch-utils.h,v retrieving revision 1.53 diff -u -r1.53 arch-utils.h --- arch-utils.h 21 Aug 2003 20:43:10 -0000 1.53 +++ arch-utils.h 28 Aug 2003 22:16:04 -0000 @@ -55,9 +55,6 @@ language family, so that case is irrelevant for C. */ extern gdbarch_return_value_on_stack_ftype generic_return_value_on_stack_not; -/* Accessor for old global function pointer for disassembly. */ -extern int legacy_print_insn (bfd_vma vma, disassemble_info *info); - /* Backward compatible call_dummy_words. */ extern LONGEST legacy_call_dummy_words[]; extern int legacy_sizeof_call_dummy_words; Index: disasm.c =================================================================== RCS file: /cvs/src/src/gdb/disasm.c,v retrieving revision 1.13 diff -u -r1.13 disasm.c --- disasm.c 14 Aug 2003 21:39:05 -0000 1.13 +++ disasm.c 28 Aug 2003 22:16:08 -0000 @@ -384,22 +384,3 @@ disassemble_info di = gdb_disassemble_info (current_gdbarch, stream); return TARGET_PRINT_INSN (memaddr, &di); } - - -/* FIXME: cagney/2003-04-28: This global deprecated_tm_print_insn_info - is going away. */ -disassemble_info deprecated_tm_print_insn_info; - -extern void _initialize_disasm (void); - -void -_initialize_disasm (void) -{ - - INIT_DISASSEMBLE_INFO_NO_ARCH (deprecated_tm_print_insn_info, gdb_stdout, - (fprintf_ftype)fprintf_filtered); - deprecated_tm_print_insn_info.flavour = bfd_target_unknown_flavour; - deprecated_tm_print_insn_info.read_memory_func = dis_asm_read_memory; - deprecated_tm_print_insn_info.memory_error_func = dis_asm_memory_error; - deprecated_tm_print_insn_info.print_address_func = dis_asm_print_address; -} Index: gdbarch.sh =================================================================== RCS file: /cvs/src/src/gdb/gdbarch.sh,v retrieving revision 1.263 diff -u -r1.263 gdbarch.sh --- gdbarch.sh 18 Aug 2003 20:04:55 -0000 1.263 +++ gdbarch.sh 28 Aug 2003 22:16:52 -0000 @@ -672,7 +672,9 @@ # FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can # single step. If not, then implement single step using breakpoints. F:2:SOFTWARE_SINGLE_STEP:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p -f:2:TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, disassemble_info *info:vma, info:::legacy_print_insn::0 +# FIXME: cagney/2003-08-28: Need to find a better way of selecting the +# disassembler. Perhaphs objdump can handle it? +f::TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, disassemble_info *info:vma, info:::0: f:2:SKIP_TRAMPOLINE_CODE:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc:::generic_skip_trampoline_code::0 @@ -1205,14 +1207,6 @@ #endif -/* The target-system-dependent disassembler is semi-dynamic */ - -/* Use gdb_disassemble, and gdbarch_print_insn instead. */ -extern int (*deprecated_tm_print_insn) (bfd_vma, disassemble_info*); - -/* Use set_gdbarch_print_insn instead. */ -extern disassemble_info deprecated_tm_print_insn_info; - /* Set the dynamic target-system-dependent parameters (architecture, byte-order, ...) using information found in the BFD */ @@ -2300,11 +2294,6 @@ return 1; } - -/* Disassembler */ - -/* Pointer to the target-dependent disassembly function. */ -int (*deprecated_tm_print_insn) (bfd_vma, disassemble_info *); extern void _initialize_gdbarch (void); --------------010209080706010805000300--