[PATCH] fix showing xmon help

Michael Ellerman michael at ellerman.id.au
Fri Jul 13 09:53:50 EST 2007


On Thu, 2007-07-12 at 16:59 +0900, Ishizaki Kou wrote:
> In some configuration, xmon help string is larger than xmon output
> buffer.  To show whole help string, this patch splits it into 2 parts.
> 
> Signed-off-by: Kou Ishizaki <kou.ishizaki at toshiba.co.jp>

Nice catch! I've seen that a few times, but thought it was a flow
control problem on the console.


> Index: linux-powerpc-git/arch/powerpc/xmon/xmon.c
> ===================================================================
> RCS file: /home/public/cvs/linux-powerpc-git/arch/powerpc/xmon/xmon.c,v
> retrieving revision 1.1.1.7
> diff -u -p -r1.1.1.7 xmon.c
> --- linux-powerpc-git/arch/powerpc/xmon/xmon.c	11 Jul 2007 02:15:32 -0000	1.1.1.7
> +++ linux-powerpc-git/arch/powerpc/xmon/xmon.c	11 Jul 2007 10:08:41 -0000
> @@ -182,7 +182,7 @@ extern void xmon_save_regs(struct pt_reg
>  			 || ('A' <= (c) && (c) <= 'Z'))
>  #define isspace(c)	(c == ' ' || c == '\t' || c == 10 || c == 13 || c == 0)
>  
> -static char *help_string = "\
> +static char *help_string1 = "\
>  Commands:\n\
>    b	show breakpoints\n\
>    bd	set data breakpoint\n\
> @@ -210,7 +210,9 @@ Commands:\n\
>    md	compare two blocks of memory\n\
>    ml	locate a block of memory\n\
>    mz	zero a block of memory\n\
> -  mi	show information about memory allocation\n\
> +  mi	show information about memory allocation\n"
> +;
> +static char *help_string2 = "\
>    p 	call a procedure\n\
>    r	print registers\n\
>    s	single step\n"
> @@ -833,7 +835,8 @@ cmds(struct pt_regs *excp)
>  			mdelay(2000);
>  			return cmd;
>  		case '?':
> -			printf(help_string);
> +			printf(help_string1);
> +			printf(help_string2);
>  			break;
>  		case 'b':
>  			bpt_cmds();


I'm not sure I like the fix though, it's a bit of a kludge :)

We don't actually need to printf() the help string, so what'd be nicer
is to add an xmon_puts() to arch/powerpc/xmon/nonstdio.c which just
calls xmon_write(s, strlen(s)) and use that for printing the help
string.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20070713/01bb5ea6/attachment.pgp>


More information about the Linuxppc-dev mailing list