[Crash-utility] Usage Advice

CAI Qian caiqian at redhat.com
Fri Oct 2 14:06:30 UTC 2009


From: Dave Anderson <anderson at redhat.com>
Subject: Re: [Crash-utility] Usage Advice
Date: Fri, 2 Oct 2009 09:47:38 -0400 (EDT)

> 
> ----- "CAI Qian" <caiqian at redhat.com> wrote:
> 
>> Hallo!
>> 
>> There are a few things that bother me the most regards the crash utility
>> usages.
>> 
>> 1) Pointer remains at the beginning after the UP array key. When
>>    entering the UP array key, it repeats the last command like,
>> 
>>    crash> struct struct_tss
>> 
>>    However, then the current position remains at the beginning. It is
>>    usually unlike in bash that the current position remains at the end,
>>    so it is easier to update the command like,
>> 
>>    crash> struct struct_tss ffffffff819f1764
> 
> I believe that's a function of the readline library, and there may be
> a setting/binding that could be used to make that happen.  Since the
> beginning, readline has been set up by crash like this:
> 
>         if (STREQ(pc->editing_mode, "vi")) {
>                 rl_editing_mode = vi_mode;
> 
>                 rl_bind_key(CTRL('N'), rl_get_next_history);
>                 rl_bind_key(CTRL('P'), rl_get_previous_history);
> 
>                 rl_bind_key_in_map(CTRL('P'), rl_get_previous_history,
>                         vi_insertion_keymap);
>                 rl_bind_key_in_map(CTRL('N'), rl_get_next_history,
>                         vi_insertion_keymap);
> 
>                 rl_generic_bind(ISFUNC, "[A", (char *)rl_get_previous_history,
>                         vi_movement_keymap);
>                 rl_generic_bind(ISFUNC, "[B", (char *)rl_get_next_history,
>                         vi_movement_keymap);
>         }
> 
>         if (STREQ(pc->editing_mode, "emacs")) {
>                 rl_editing_mode = emacs_mode;
>         }
> 
> I don't recall where those bindings came from -- I copied them from some
> other program.  I'm guessing that there's a binding that would put the cursor
> at the end of the recalled string, but I don't know what it is off-hand.
> 
> If anybody knows what the binding sequence is, please post it here...
> 
> On the other hand, when updating a command string, I guess it depends
> whether the location you want to change is at the beginning or the end
> of the string would be a cause to be bothered by it?
>

Yes, but from the familiarity point of view, I vote for at the end like
in Bash.
   
>> 
>> 2) Pressing PgUp/PgDn when input leads nothing can be input. This
>> happens like,
>> 
>>    crash> log
>> 
>>    In order to see the full log output, I may press PgDn several
>>    times. However, if continue pressing the key after the output has
>>    already finished like,
> 
> In the case of the "log" command, the PageUp and PageDown keys are being
> captured by the scrolling routine, which is /usr/bin/less by default.
> 

OK.

>> 
>>    crash>
>> 
>>    there seems no way to input anything unless pressing Enter several
>>    times until reach the next prompt.
> 
> Right -- PageUp and PageDown don't make sense once you are back to
> the "crash> " command prompt.  
> 
>> 3) Ctrl-C is not working to cancel the current input. GDB has the same
>>    problem. It needs to press Ctrl-C several times to get it to a new
>>    prompt.
> 
> That's also done on purpose -- in certain circumstances it requires 
> that Ctrl-C be hit 3 times (MAX_SIGINTS_ACCEPTED).  There was a good
> reason that was put in place, but I'm afraid I don't recall why...
> 

OK.

Thanks!
CAI Qian




More information about the Crash-utility mailing list