aboutsummaryrefslogtreecommitdiff
path: root/opcodes/v850-dis.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-04-13 13:20:24 +0000
committerNick Clifton <nickc@redhat.com>2011-04-13 13:20:24 +0000
commit7d063384af231365d6f623f89f09f1af909478f8 (patch)
tree9fdeedb4f261902f0bb371645f36351fd34d3608 /opcodes/v850-dis.c
parentdb17156eaa6dbb38436c6a01712688e35389e773 (diff)
downloadgdb-7d063384af231365d6f623f89f09f1af909478f8.zip
gdb-7d063384af231365d6f623f89f09f1af909478f8.tar.gz
gdb-7d063384af231365d6f623f89f09f1af909478f8.tar.bz2
* v850-dis.c (disassemble): Always print a closing square brace if
an opening square brace was printed.
Diffstat (limited to 'opcodes/v850-dis.c')
-rw-r--r--opcodes/v850-dis.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/opcodes/v850-dis.c b/opcodes/v850-dis.c
index c3624b2..cf0d386 100644
--- a/opcodes/v850-dis.c
+++ b/opcodes/v850-dis.c
@@ -283,6 +283,7 @@ disassemble (bfd_vma memaddr, struct disassemble_info *info, int bytes_read, uns
*opindex_ptr != 0;
opindex_ptr++, opnum++)
{
+ bfd_boolean square = FALSE;
long value;
int flag;
char *prefix;
@@ -323,11 +324,17 @@ disassemble (bfd_vma memaddr, struct disassemble_info *info, int bytes_read, uns
}
if (opnum == 1 && opnum == memop)
- info->fprintf_func (info->stream, "%s[", prefix);
+ {
+ info->fprintf_func (info->stream, "%s[", prefix);
+ square = TRUE;
+ }
else if (opnum > 1
&& (v850_operands[*(opindex_ptr - 1)].flags & V850_OPERAND_DISP) != 0
&& opnum == memop)
- info->fprintf_func (info->stream, "%s[", prefix);
+ {
+ info->fprintf_func (info->stream, "%s[", prefix);
+ square = TRUE;
+ }
else if (opnum > 1)
info->fprintf_func (info->stream, ", %s", prefix);
@@ -431,7 +438,7 @@ disassemble (bfd_vma memaddr, struct disassemble_info *info, int bytes_read, uns
break;
}
- if (opnum == 2 && opnum == memop)
+ if (square)
(*info->fprintf_func) (info->stream, "]");
}