Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [patch/rfc] Eliminate deprecated_tm_print_insn
Date: Thu, 28 Aug 2003 22:35:00 -0000	[thread overview]
Message-ID: <3F4E83BF.1040702@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 592 bytes --]

(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

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 4564 bytes --]

2003-08-28  Andrew Cagney  <cagney@redhat.com>

	* 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);
 }
-
-\f
-/* 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);
 

             reply	other threads:[~2003-08-28 22:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-28 22:35 Andrew Cagney [this message]
2003-09-03 23:50 ` Andrew Cagney
2003-09-04 18:05 ` Corinna Vinschen
2003-09-04 18:17   ` Andrew Cagney
2003-09-04 19:27     ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F4E83BF.1040702@redhat.com \
    --to=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox