From: David Carlton <carlton@kealia.com>
To: Andrew Cagney <ac131313@redhat.com>
Cc: Randolph Chung <randolph@tausq.org>, gdb-patches@sources.redhat.com
Subject: Re: [patch/minor] fix compile warning in linux-proc.c
Date: Wed, 27 Aug 2003 15:42:00 -0000 [thread overview]
Message-ID: <yf2d6erds3o.fsf@hawaii.kealia.com> (raw)
In-Reply-To: <3F4C32C3.7020504@redhat.com> (Andrew Cagney's message of "Wed, 27 Aug 2003 00:25:39 -0400")
On Wed, 27 Aug 2003 00:25:39 -0400, Andrew Cagney <ac131313@redhat.com> said:
> David, feel free to check it in. A comment mentioning that this
> should use a generic (and not yet existing) local_address_string()
> method would be useful.
Done; here's what I've committed. Tested on i686-pc-linux-gnu,
DWARF-2, GCC 3.2; no regressions.
David Carlton
carlton@kealia.com
2003-08-27 David Carlton <carlton@kealia.com>
From Randolph Chung <tausq@debian.org>:
* linux-proc.c (linux_info_proc_cmd): rework the code so that it
compiles with -Wformat-nonliteral -Werror.
Index: linux-proc.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-proc.c,v
retrieving revision 1.17
diff -u -p -r1.17 linux-proc.c
--- linux-proc.c 24 Aug 2003 13:34:01 -0000 1.17
+++ linux-proc.c 27 Aug 2003 15:32:58 -0000
@@ -404,35 +404,52 @@ linux_info_proc_cmd (char *args, int fro
{
long long addr, endaddr, size, offset, inode;
char permissions[8], device[8], filename[MAXPATHLEN];
- char *header_fmt_string, *data_fmt_string;
+ printf_filtered ("Mapped address spaces:\n\n");
if (TARGET_ADDR_BIT == 32)
{
- header_fmt_string = "\t%10s %10s %10s %10s %7s\n";
- data_fmt_string = "\t%#10lx %#10lx %#10x %#10x %7s\n";
- }
+ printf_filtered ("\t%10s %10s %10s %10s %7s\n",
+ "Start Addr",
+ " End Addr",
+ " Size", " Offset", "objfile");
+ }
else
- {
- header_fmt_string = " %18s %18s %10s %10s %7s\n";
- data_fmt_string = " %#18lx %#18lx %#10x %#10x %7s\n";
- }
-
- printf_filtered ("Mapped address spaces:\n\n");
- printf_filtered (header_fmt_string,
+ {
+ printf_filtered (" %18s %18s %10s %10s %7s\n",
"Start Addr",
" End Addr",
" Size", " Offset", "objfile");
+ }
while (read_mapping (procfile, &addr, &endaddr, &permissions[0],
&offset, &device[0], &inode, &filename[0]))
{
size = endaddr - addr;
- printf_filtered (data_fmt_string, (unsigned long) addr, /* FIXME: pr_addr */
+
+ /* FIXME: carlton/2003-08-27: Maybe the printf_filtered
+ calls here (and possibly above) should be abstracted
+ out into their own functions? Andrew suggests using
+ a generic local_address_string instead to print out
+ the addresses; that makes sense to me, too. */
+
+ if (TARGET_ADDR_BIT == 32)
+ {
+ printf_filtered ("\t%#10lx %#10lx %#10x %#10x %7s\n",
+ (unsigned long) addr, /* FIXME: pr_addr */
(unsigned long) endaddr,
(int) size,
(unsigned int) offset,
filename[0] ? filename : "");
-
+ }
+ else
+ {
+ printf_filtered (" %#18lx %#18lx %#10x %#10x %7s\n",
+ (unsigned long) addr, /* FIXME: pr_addr */
+ (unsigned long) endaddr,
+ (int) size,
+ (unsigned int) offset,
+ filename[0] ? filename : "");
+ }
}
fclose (procfile);
prev parent reply other threads:[~2003-08-27 15:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-21 5:08 Randolph Chung
2003-08-25 16:48 ` David Carlton
2003-08-27 4:25 ` Andrew Cagney
2003-08-27 15:42 ` David Carlton [this message]
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=yf2d6erds3o.fsf@hawaii.kealia.com \
--to=carlton@kealia.com \
--cc=ac131313@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=randolph@tausq.org \
/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