* [PATCH] gdb: Fix ARI warnings in or1k-tdep.c
@ 2017-12-13 13:27 Stafford Horne
2017-12-13 14:42 ` Simon Marchi
2017-12-14 2:51 ` Joel Brobecker
0 siblings, 2 replies; 4+ messages in thread
From: Stafford Horne @ 2017-12-13 13:27 UTC (permalink / raw)
To: GDB patches; +Cc: Stafford Horne
Fix a few issues not using the gettext _() wrapper and issues where
we are using %p directly instead of the dedicated host/target functions.
gdb/ChangeLog:
yyyy-mm-dd Stafford Horne <shorne@gmail.com>
* or1k-tdep.c (or1k_analyse_inst): Use _() wrapper for message
strings.
(or1k_unwind_pc): Use paddress() instead of %p.
(or1k_unwind_sp ): Likewise.
(or1k_frame_cache): Use host_address_to_string()/paddress()
instead of %p and use _() wrapper for message strings.
---
gdb/or1k-tdep.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c
index 54b365e958..06ee53e83c 100644
--- a/gdb/or1k-tdep.c
+++ b/gdb/or1k-tdep.c
@@ -132,7 +132,7 @@ or1k_analyse_inst (uint32_t inst, const char *format, ...)
/* Check we got something, and if so skip on. */
if (start_ptr == end_ptr)
- error ("bitstring \"%s\" at offset %d has no length field.\n",
+ error (_("bitstring \"%s\" at offset %d has no length field."),
format, i);
i += end_ptr - start_ptr;
@@ -141,7 +141,7 @@ or1k_analyse_inst (uint32_t inst, const char *format, ...)
still give a fatal error, because these are fixed strings that
just should not be wrong. */
if ('b' != format[i++])
- error ("bitstring \"%s\" at offset %d has no terminating 'b'.\n",
+ error (_("bitstring \"%s\" at offset %d has no terminating 'b'."),
format, i);
/* Break out the field. There is a special case with a bit width
@@ -158,7 +158,7 @@ or1k_analyse_inst (uint32_t inst, const char *format, ...)
break;
default:
- error ("invalid character in bitstring \"%s\" at offset %d.\n",
+ error (_("invalid character in bitstring \"%s\" at offset %d."),
format, i);
break;
}
@@ -541,8 +541,8 @@ or1k_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
pc = frame_unwind_register_unsigned (next_frame, OR1K_NPC_REGNUM);
if (or1k_debug)
- fprintf_unfiltered (gdb_stdlog, "or1k_unwind_pc, pc=0x%p\n",
- (void *) pc);
+ fprintf_unfiltered (gdb_stdlog, "or1k_unwind_pc, pc=%s\n",
+ paddress (gdbarch, pc));
return pc;
}
@@ -561,8 +561,8 @@ or1k_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
sp = frame_unwind_register_unsigned (next_frame, OR1K_SP_REGNUM);
if (or1k_debug)
- fprintf_unfiltered (gdb_stdlog, "or1k_unwind_sp, sp=0x%p\n",
- (void *) sp);
+ fprintf_unfiltered (gdb_stdlog, "or1k_unwind_sp, sp=%s\n",
+ paddress (gdbarch, sp));
return sp;
}
@@ -882,8 +882,8 @@ or1k_frame_cache (struct frame_info *this_frame, void **prologue_cache)
if (or1k_debug)
fprintf_unfiltered (gdb_stdlog,
- "or1k_frame_cache, prologue_cache = 0x%p\n",
- *prologue_cache);
+ "or1k_frame_cache, prologue_cache = %s\n",
+ host_address_to_string (*prologue_cache));
/* Nothing to do if we already have this info. */
if (NULL != *prologue_cache)
@@ -942,7 +942,7 @@ or1k_frame_cache (struct frame_info *this_frame, void **prologue_cache)
have executed the code. Check we have a sane prologue size, and if
zero we are frameless and can give up here. */
if (end_addr < start_addr)
- error ("end addr 0x%08x is less than start addr 0x%08x\n",
+ error (_("end addr 0x%08x is less than start addr 0x%08x"),
(unsigned int) end_addr, (unsigned int) start_addr);
if (end_addr == start_addr)
@@ -1068,10 +1068,10 @@ or1k_frame_cache (struct frame_info *this_frame, void **prologue_cache)
if (or1k_debug)
{
- fprintf_unfiltered (gdb_stdlog, " this_sp_for_id = 0x%p\n",
- (void *) this_sp_for_id);
- fprintf_unfiltered (gdb_stdlog, " start_addr = 0x%p\n",
- (void *) start_addr);
+ fprintf_unfiltered (gdb_stdlog, " this_sp_for_id = %s\n",
+ paddress (gdbarch, this_sp_for_id));
+ fprintf_unfiltered (gdb_stdlog, " start_addr = %s\n",
+ paddress (gdbarch, start_addr));
}
return info;
--
2.13.6
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gdb: Fix ARI warnings in or1k-tdep.c
2017-12-13 13:27 [PATCH] gdb: Fix ARI warnings in or1k-tdep.c Stafford Horne
@ 2017-12-13 14:42 ` Simon Marchi
2017-12-14 2:51 ` Joel Brobecker
1 sibling, 0 replies; 4+ messages in thread
From: Simon Marchi @ 2017-12-13 14:42 UTC (permalink / raw)
To: Stafford Horne; +Cc: GDB patches
On 2017-12-13 08:26, Stafford Horne wrote:
> Fix a few issues not using the gettext _() wrapper and issues where
> we are using %p directly instead of the dedicated host/target
> functions.
>
> gdb/ChangeLog:
>
> yyyy-mm-dd Stafford Horne <shorne@gmail.com>
>
> * or1k-tdep.c (or1k_analyse_inst): Use _() wrapper for message
> strings.
> (or1k_unwind_pc): Use paddress() instead of %p.
> (or1k_unwind_sp ): Likewise.
Spurious space here. Otherwise, LGTM.
Simon
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gdb: Fix ARI warnings in or1k-tdep.c
2017-12-13 13:27 [PATCH] gdb: Fix ARI warnings in or1k-tdep.c Stafford Horne
2017-12-13 14:42 ` Simon Marchi
@ 2017-12-14 2:51 ` Joel Brobecker
2017-12-14 5:42 ` Stafford Horne
1 sibling, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2017-12-14 2:51 UTC (permalink / raw)
To: Stafford Horne; +Cc: GDB patches
Hello,
A very minor thing:
> diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c
> index 54b365e958..06ee53e83c 100644
> --- a/gdb/or1k-tdep.c
> +++ b/gdb/or1k-tdep.c
> @@ -132,7 +132,7 @@ or1k_analyse_inst (uint32_t inst, const char *format, ...)
>
> /* Check we got something, and if so skip on. */
> if (start_ptr == end_ptr)
> - error ("bitstring \"%s\" at offset %d has no length field.\n",
> + error (_("bitstring \"%s\" at offset %d has no length field."),
> format, i);
The second line in the error looks over indented to me. I think
it ought to be aligned with the other arguments on the first line:
error (_("bitstring \"%s\" at offset %d has no length field."),
format, i);
(I think I saw about 3 instances of the same alignment issue)
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gdb: Fix ARI warnings in or1k-tdep.c
2017-12-14 2:51 ` Joel Brobecker
@ 2017-12-14 5:42 ` Stafford Horne
0 siblings, 0 replies; 4+ messages in thread
From: Stafford Horne @ 2017-12-14 5:42 UTC (permalink / raw)
To: Joel Brobecker; +Cc: GDB patches
On Thu, Dec 14, 2017 at 06:51:06AM +0400, Joel Brobecker wrote:
> Hello,
>
> A very minor thing:
>
> > diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c
> > index 54b365e958..06ee53e83c 100644
> > --- a/gdb/or1k-tdep.c
> > +++ b/gdb/or1k-tdep.c
> > @@ -132,7 +132,7 @@ or1k_analyse_inst (uint32_t inst, const char *format, ...)
> >
> > /* Check we got something, and if so skip on. */
> > if (start_ptr == end_ptr)
> > - error ("bitstring \"%s\" at offset %d has no length field.\n",
> > + error (_("bitstring \"%s\" at offset %d has no length field."),
> > format, i);
>
> The second line in the error looks over indented to me. I think
> it ought to be aligned with the other arguments on the first line:
>
> error (_("bitstring \"%s\" at offset %d has no length field."),
> format, i);
>
> (I think I saw about 3 instances of the same alignment issue)
Understood, I didnt notice those. Will fix, I have a few other patches to send.
-Stafford
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-12-14 5:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-13 13:27 [PATCH] gdb: Fix ARI warnings in or1k-tdep.c Stafford Horne
2017-12-13 14:42 ` Simon Marchi
2017-12-14 2:51 ` Joel Brobecker
2017-12-14 5:42 ` Stafford Horne
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).