Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Elena Zannoni <ezannoni@cygnus.com>
To: gdb-patches@sources.redhat.com
Cc: jtc@redback.com
Subject: [RFA] memattr.c: improve output
Date: Tue, 17 Jul 2001 13:15:00 -0000	[thread overview]
Message-ID: <15188.40529.818057.722474@krustylu.cygnus.com> (raw)

JT, this patch reformats the output of 'info mem' to look a little more
like breakpoint output. 

Also, it improves a bit the help messages.


(gdb) i m
Num Enb Low Addr           High Addr          Attrs 
1   y  	0x0000000012345678 0x0000000012345679 rw nocache 



(gdb) mem 0x12345678 0x12345680 rw 8 nocache
(gdb) i m
Num Enb Low Addr   High Addr  Attrs 
1   y  	0x12345678 0x12345680 rw 8 nocache 



OK?
Elena


2001-07-17  Elena Zannoni  <ezannoni@redhat.com>

	* memattr.c (mem_info_command): Reformat output to look more like
	'info break' output.
	(_initialize_mem): Improve help.


Index: memattr.c
===================================================================
RCS file: /cvs/src/src/gdb/memattr.c,v
retrieving revision 1.5
diff -u -p -r1.5 memattr.c
--- memattr.c	2001/07/04 18:06:02	1.5
+++ memattr.c	2001/07/17 19:53:43
@@ -229,16 +229,36 @@ mem_info_command (char *args, int from_t
       return;
     }
 
-  printf_filtered ("Memory regions now in effect:\n");
+  printf_filtered ("Num ");
+  printf_filtered ("Enb ");
+  printf_filtered ("Low Addr   ");
+  if (TARGET_ADDR_BIT > 32)
+    printf_filtered ("        ");
+  printf_filtered ("High Addr  ");
+  if (TARGET_ADDR_BIT > 32)
+    printf_filtered ("        ");
+  printf_filtered ("Attrs ");
+  printf_filtered ("\n");
+
   for (m = mem_region_chain; m; m = m->next)
     {
-      printf_filtered ("%d: %c\t",
+      char *tmp;
+      printf_filtered ("%-3d %-3c\t",
 		       m->number,
 		       m->status ? 'y' : 'n');
-      printf_filtered ("%s - ",
-		    local_hex_string_custom ((unsigned long) m->lo, "08l"));
-      printf_filtered ("%s\t",
-		    local_hex_string_custom ((unsigned long) m->hi, "08l"));
+      if (TARGET_ADDR_BIT <= 32)
+	tmp = longest_local_hex_string_custom ((unsigned long) m->lo, "08l");
+      else
+	tmp = longest_local_hex_string_custom ((unsigned long) m->lo, "016l");
+      
+      printf_filtered ("%s ", tmp);
+      
+      if (TARGET_ADDR_BIT <= 32)
+	tmp = longest_local_hex_string_custom ((unsigned long) m->hi, "08l");
+      else
+	tmp = longest_local_hex_string_custom ((unsigned long) m->hi, "016l");
+      
+      printf_filtered ("%s ", tmp);
 
       /* Print a token for each attribute.
 
@@ -495,21 +515,25 @@ void
 _initialize_mem ()
 {
   add_com ("mem", class_vars, mem_command,
-	   "Define attributes for memory region.");
+	   "Define attributes for memory region.\n\
+Usage: mem <lo addr> <hi addr> [<mode> <width> <cache>]");
 
   add_cmd ("mem", class_vars, mem_enable_command,
 	   "Enable memory region.\n\
 Arguments are the code numbers of the memory regions to enable.\n\
+Usage: enable mem <code number>\n\
 Do \"info mem\" to see current list of code numbers.", &enablelist);
 
   add_cmd ("mem", class_vars, mem_disable_command,
 	   "Disable memory region.\n\
 Arguments are the code numbers of the memory regions to disable.\n\
+Usage: disable mem <code number>\n\
 Do \"info mem\" to see current list of code numbers.", &disablelist);
 
   add_cmd ("mem", class_vars, mem_delete_command,
 	   "Delete memory region.\n\
 Arguments are the code numbers of the memory regions to delete.\n\
+Usage: delete mem <code number>\n\
 Do \"info mem\" to see current list of code numbers.", &deletelist);
 
   add_info ("mem", mem_info_command,


             reply	other threads:[~2001-07-17 13:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-17 13:15 Elena Zannoni [this message]
2001-07-17 13:46 ` J.T. Conklin
2001-07-23 12:53   ` Elena Zannoni

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=15188.40529.818057.722474@krustylu.cygnus.com \
    --to=ezannoni@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jtc@redback.com \
    /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