@@ -46,12 +46,12 @@ Boston, MA 02111-1307, USA. */
4646/* The following line makes Solaris' gcc/cpp not puke. */
4747#undef HAVE_READLINE_READLINE_H
4848#include <readline/readline.h>
49+ #endif /* HAVE_LIBREADLINE */
4950
5051/* From readline. ?? Should this be in configure? */
5152#ifndef whitespace
5253#define whitespace (c ) (((c) == ' ') || ((c) == '\t'))
5354#endif
54- #endif /* HAVE_LIBREADLINE */
5555
5656#include "cmd_initialize.h"
5757
@@ -79,8 +79,6 @@ char *psz_debugger_args;
7979
8080debug_enter_reason_t last_stop_reason ;
8181
82- #ifdef HAVE_LIBREADLINE
83-
8482short_cmd_t short_command [256 ] = { { NULL ,
8583 (const char * ) '\0' ,
8684 (const char * ) '\0' ,
@@ -226,8 +224,6 @@ extern debug_return_t dbg_cmd_set_var (char *psz_args, int expand)
226224 return debug_readloop ;
227225}
228226
229- #endif /* HAVE_LIBREADLINE */
230-
231227#define PROMPT_LENGTH 300
232228
233229#include <setjmp.h>
@@ -381,10 +377,14 @@ debug_return_t enter_debugger (target_stack_node_t *p,
381377
382378 if ( line ) {
383379 if ( * (s = stripwhite (line )) ) {
380+ #ifdef HAVE_LIBREADLINE
384381 add_history (s );
382+ #endif /* HAVE_LIBREADLINE */
385383 debug_return = execute_line (s );
386384 } else {
385+ #ifdef HAVE_LIBREADLINE
387386 add_history ("step" );
387+ #endif /* HAVE_LIBREADLINE */
388388 debug_return = dbg_cmd_step ((char * ) "" );
389389 }
390390 free (line );
0 commit comments