. . . but I can't figure out why.  I thought the patch below would
help, but it appears that the value of c is itself broken somehow.

    . . .
    This GDB was configured as "i586-suse-linux"...
    (gdb) r runtime/parrot/library/config.pbc
    Starting program: /usr/src/parrot/disassemble 
runtime/parrot/library/config.pbc
    [New Thread 16384 (LWP 24464)]
    [New Thread 32769 (LWP 24466)]
    [New Thread 16386 (LWP 24467)]
    [New Thread 32771 (LWP 24468)]

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 16384 (LWP 24464)]
    0x08083966 in Parrot_disassemble (interpreter=0x8253d00) at src/embed.c:880
    (gdb) bt
    #0  0x08083966 in Parrot_disassemble (interpreter=0x8253d00) at 
src/embed.c:880
    #1  0x08082871 in do_dis (interpreter=0x8253d00) at src/disassemble.c:99
    #2  0x0808283f in main (argc=2, argv=0xbffff554) at src/disassemble.c:79
    (gdb) 

I find disassemble useful, but it seems subject to periodic bit rot.
So, I think I would like to write some basic tests for it.  Is it worth
extending Parrot::Test to include disassemble_output_is, etc., or should
I do something more special-purpose?

                                        -- Bob Rogers
                                           http://rgrjr.dyndns.org/

------------------------------------------------------------------------
Index: embed.c
===================================================================
--- embed.c     (revision 7955)
+++ embed.c     (working copy)
@@ -877,7 +877,7 @@
         if (line->label)
             PIO_printf(interpreter, "L%li:\t", line->label->number);
         c = pdb->file->source + line->source_offset;
-        while (*c != '\n' && c)
+        while (*c && *c != '\n')
             PIO_printf(interpreter, "%c", *(c++));
         PIO_printf(interpreter, "\n");
         line = line->next;

Reply via email to