From 19462f4aa5369eddfa59b9022f13f12cfd5c5934 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 25 Jan 2012 22:06:12 -0300 Subject: [PATCH] m1/patches/rtems/mem-fixes.patch: fix mdump and medit shell commands --- m1/patches/rtems/mem-fixes.patch | 41 ++++++++++++++++++++++++++++++++ m1/patches/rtems/series | 1 + 2 files changed, 42 insertions(+) create mode 100644 m1/patches/rtems/mem-fixes.patch diff --git a/m1/patches/rtems/mem-fixes.patch b/m1/patches/rtems/mem-fixes.patch new file mode 100644 index 0000000..543ae8a --- /dev/null +++ b/m1/patches/rtems/mem-fixes.patch @@ -0,0 +1,41 @@ +This patch fixes the "mdump" and "medit" shell commands: + +- "mdump" got the length argument wrong and would only produce useful + output if it was omitted. + +- "medit" overran the argument list, choking on the NULL pointer + following the last argument. + +Note that "medit" still only does byte-sized accesses, which limits +its usefulness on most systems. + +- Werner + +Index: rtems/cpukit/libmisc/shell/main_mdump.c +=================================================================== +--- rtems.orig/cpukit/libmisc/shell/main_mdump.c 2012-01-25 21:48:05.000000000 -0300 ++++ rtems/cpukit/libmisc/shell/main_mdump.c 2012-01-25 21:48:27.000000000 -0300 +@@ -47,8 +47,8 @@ + } + + if (argc > 2) { +- if ( rtems_string_to_int(argv[1], &max, NULL, 0) ) { +- printf( "Length argument (%s) is not a number\n", argv[1] ); ++ if ( rtems_string_to_int(argv[2], &max, NULL, 0) ) { ++ printf( "Length argument (%s) is not a number\n", argv[2] ); + return -1; + } + if (max <= 0) { +Index: rtems/cpukit/libmisc/shell/main_medit.c +=================================================================== +--- rtems.orig/cpukit/libmisc/shell/main_medit.c 2012-01-25 21:48:30.000000000 -0300 ++++ rtems/cpukit/libmisc/shell/main_medit.c 2012-01-25 21:50:30.000000000 -0300 +@@ -55,7 +55,7 @@ + * Now edit the memory + */ + n = 0; +- for (i=2 ; i<=argc ; i++) { ++ for (i=2 ; i