public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Duplicate 0x prefix - cr16 - bug. no. 10173
@ 2011-12-26 17:11 James Murray
  2012-01-16 23:52 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: James Murray @ 2011-12-26 17:11 UTC (permalink / raw)
  To: binutils

Regarding:
http://sourceware.org/bugzilla/show_bug.cgi?id=10173

The fix for the duplicate 0x prefix on numbers during disassembly was:

--- src/opcodes/cr16-dis.c 2008/11/27 11:30:33 1.5
+++ src/opcodes/cr16-dis.c 2009/06/15 15:24:52 1.6
@@ -678,7 +678,9 @@
+      /* PR 10173: Avoid printing the 0x prefix twice.  */
+      if (info->num_symbols > 0)
+	func (stream, "%s", "0x");


I'm wondering if that might be better as
+      if (info->symtab_size > 0)

Today I ran into a similar long-standing issue on the m68hc11 where the
0x prefixes were omitted on some addresses, or duplicated some times
after I'd added the 0x to the target-specific code.

objdump.c does this: (line 1030)
  if (sorted_symcount < 1)
    {

but that's not always the same value as info->symtab_size, so when I
tried applying the same fix as for cr16 I was still getting duplicated
or omitted 0x.

At the end of the function after sorted_symcount is manipulated, the
value is stored (line 2213)
  disasm_info.symtab_size = sorted_symcount;

So my change is supposed to then use that same value. So far in my
testing, that appears to resolve the issue and allows the 0x to be
emitted in either core or target code but not both.

regards

James Murray

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Duplicate 0x prefix - cr16 - bug. no. 10173
  2011-12-26 17:11 Duplicate 0x prefix - cr16 - bug. no. 10173 James Murray
@ 2012-01-16 23:52 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2012-01-16 23:52 UTC (permalink / raw)
  To: James Murray; +Cc: binutils

On Mon, Dec 26, 2011 at 05:11:29PM +0000, James Murray wrote:
> Regarding:
> http://sourceware.org/bugzilla/show_bug.cgi?id=10173
> 
> The fix for the duplicate 0x prefix on numbers during disassembly was:
> 
> --- src/opcodes/cr16-dis.c 2008/11/27 11:30:33 1.5
> +++ src/opcodes/cr16-dis.c 2009/06/15 15:24:52 1.6
> @@ -678,7 +678,9 @@
> +      /* PR 10173: Avoid printing the 0x prefix twice.  */
> +      if (info->num_symbols > 0)
> +	func (stream, "%s", "0x");
> 
> 
> I'm wondering if that might be better as
> +      if (info->symtab_size > 0)

Applied.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-16 23:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-26 17:11 Duplicate 0x prefix - cr16 - bug. no. 10173 James Murray
2012-01-16 23:52 ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).