On Monday 25 August 2008 07:16:08 Will Coleda wrote:

> Hitting enter immediately after successfully starting the debugger
> throws an error.
>
> $ cat foo.pir
> .sub main
>  say 'hi'
> .end
> $ ./parrot_debugger foo.pir
> Parrot 0.7.0-devel Debugger
>
> Please note: the debugger is currently under reconstruction
>
> (pdb)
> Undefined command: "ñì¶ñì¶".  Try "help".
> (pdb)

I can't reproduce that, but does this patch fix it?

-- c

=== src/debug.c
==================================================================
--- src/debug.c	(revision 30520)
+++ src/debug.c	(local)
@@ -842,16 +842,16 @@
     TRACEDEB_MSG("Parrot_debugger_init");
 
     if (! interp->pdb) {
-        PDB_t *pdb = mem_allocate_zeroed_typed(PDB_t);
-        Parrot_Interp debugger = Parrot_new(interp);
-        interp->pdb     = pdb;
-        debugger->pdb   = pdb;
-        pdb->debugee    = interp;
-        pdb->debugger   = debugger;
+        PDB_t          *pdb      = mem_allocate_zeroed_typed(PDB_t);
+        Parrot_Interp   debugger = Parrot_new(interp);
+        interp->pdb              = pdb;
+        debugger->pdb            = pdb;
+        pdb->debugee             = interp;
+        pdb->debugger            = debugger;
 
         /* Allocate space for command line buffers, NUL terminated c strings */
-        pdb->cur_command = (char *)mem_sys_allocate(DEBUG_CMD_BUFFER_LENGTH + 1);
-        pdb->last_command = (char *)mem_sys_allocate(DEBUG_CMD_BUFFER_LENGTH + 1);
+        pdb->cur_command = (char *)mem_sys_allocate_zeroed(DEBUG_CMD_BUFFER_LENGTH + 1);
+        pdb->last_command = (char *)mem_sys_allocate_zeroed(DEBUG_CMD_BUFFER_LENGTH + 1);
     }
 
     /* PDB_disassemble(interp, NULL); */

Reply via email to