This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: [RFA] New port: CR16: BFD Changes required by the gdb port
- From: Kaushik Phatak <Kaushik dot Phatak at kpitcummins dot com>
- To: nick clifton <nickc at redhat dot com>, Tom Tromey <tromey at redhat dot com>
- Cc: Pedro Alves <palves at redhat dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Joel Brobecker <brobecker at adacore dot com>
- Date: Thu, 3 Jan 2013 11:16:15 +0000
- Subject: RE: [RFA] New port: CR16: BFD Changes required by the gdb port
- References: <C6CA53A2A46BA7469348BDBD663AB65848541C0B@KCHJEXMB02.kpit.com> <50CB6CA4.1060901@redhat.com> <C6CA53A2A46BA7469348BDBD663AB6584856466C@KCHJEXMB02.kpit.com> <50E431EF.5030904@redhat.com>
Hi Nick,
Thanks for the review and commit.
Tom Tromey > make_instruction,match_opcode): Added function prototypes.
> What about these?
Yes, I agree. These functions are used by the tdep files as well, so a prefix
here would be useful.
Please find below a patch that adds similar prefix for make_instruction
and match_opcode. I have re-based this against gdb-7.5.50.20130103.
Also fixed a minor typo (doewsn't -> doesn't)
Please review and let me know if ok.
Thanks,
Kaushik
2013-01-03 Kaushik Phatak <kaushik.phatak@kpitcummins.com>
include/opcode/ChangeLog
* cr16.h (cr16_match_opcode,cr16_make_instruction): Added
prefix 'cr16_'.
diff -uprN gdb_src.orig/include/opcode/cr16.h gdb_src/include/opcode/cr16.h
--- gdb_src.orig/include/opcode/cr16.h 2013-01-02 18:43:36.000000000 +0530
+++ gdb_src/include/opcode/cr16.h 2013-01-03 15:53:35.000000000 +0530
@@ -445,7 +445,7 @@ extern ULONGLONG cr16_allWords;
extern ins cr16_currInsn;
/* Prototypes for function in cr16-dis.c. */
-extern void make_instruction (void);
-extern int match_opcode (void);
+extern void cr16_make_instruction (void);
+extern int cr16_match_opcode (void);
#endif /* _CR16_H_ */
diff -uprN gdb_src.orig/opcodes/cr16-dis.c gdb_src/opcodes/cr16-dis.c
--- gdb_src.orig/opcodes/cr16-dis.c 2013-01-02 18:43:35.000000000 +0530
+++ gdb_src/opcodes/cr16-dis.c 2013-01-03 16:25:42.000000000 +0530
@@ -315,10 +315,10 @@ build_mask (void)
/* Search for a matching opcode. Return 1 for success, 0 for failure. */
int
-match_opcode (void)
+cr16_match_opcode (void)
{
unsigned long mask;
- /* The instruction 'constant' opcode doewsn't exceed 32 bits. */
+ /* The instruction 'constant' opcode doesn't exceed 32 bits. */
unsigned long doubleWord = (cr16_words[1]
+ (cr16_words[0] << 16)) & 0xffffffff;
@@ -743,7 +743,7 @@ print_arguments (ins *currentInsn, bfd_v
/* Build the instruction's arguments. */
void
-make_instruction (void)
+cr16_make_instruction (void)
{
int i;
unsigned int shift;
@@ -813,7 +813,7 @@ print_insn_cr16 (bfd_vma memaddr, struct
/* Retrieve the encoding from current memory location. */
get_words_at_PC (memaddr, info);
/* Find a matching opcode in table. */
- is_decoded = match_opcode ();
+ is_decoded = cr16_match_opcode ();
/* If found, print the instruction's mnemonic and arguments. */
if (is_decoded > 0 && (cr16_words[0] << 16 || cr16_words[1]) != 0)
{
@@ -825,7 +825,7 @@ print_insn_cr16 (bfd_vma memaddr, struct
if (((cr16_currInsn.nargs = get_number_of_operands ()) != 0)
&& ! (IS_INSN_MNEMONIC ("b")))
info->fprintf_func (info->stream, "\t");
- make_instruction ();
+ cr16_make_instruction ();
/* For push/pop/pushrtn with RA instructions. */
if ((INST_HAS_REG_LIST) && ((cr16_words[0] >> 7) & 0x1))
cr16_currInsn.nargs +=1;