Hi Ian,
  Here's the patch to fix three issues:  ski was looking inside a
private data structure for ncurses, so when libbfd was available, it
FTBFS.

  Also, there was a memory leak (about 240 bytes for each line
disassembled) and an incompatibility with the latest libcurses (An
explicit \r blanks the line nowadays).

Index: ski-1.3.2/src/linux/dwarf-linux.c
===================================================================
--- ski-1.3.2.orig/src/linux/dwarf-linux.c      2008-09-03 07:39:32.506572282 
+1000
+++ ski-1.3.2/src/linux/dwarf-linux.c   2008-09-03 07:40:51.558864149 +1000
@@ -155,7 +155,7 @@
              first.function = function;
              first.line = line;
              first.num_lines = 1;
-             first.limit = sect->_cooked_size;
+             first.limit = bfd_get_section_limit(bfd, sect);
              last_line = line;
            }
          if (line > last_line
Index: ski-1.3.2/src/program.c
===================================================================
--- ski-1.3.2.orig/src/program.c        2008-09-03 07:40:09.366978143 +1000
+++ ski-1.3.2/src/program.c     2008-09-03 07:41:38.330303616 +1000
@@ -250,9 +250,9 @@
 #else
        char *p = line, *i0Str, *i1Str, *i2Str;
        /* XXX - memory leak, these are never freed */
-       i0Str = malloc(prgColumns - 19);        /* + 1 for NUL */
-       i1Str = malloc(prgColumns - 19);
-       i2Str = malloc(prgColumns - 19);
+       i0Str = alloca(prgColumns - 19);        /* + 1 for NUL */
+       i1Str = alloca(prgColumns - 19);
+       i2Str = alloca(prgColumns - 19);
        if (!i0Str || !i1Str || !i2Str)
            goto xxx;
 #endif
@@ -268,11 +268,11 @@
        dasInit(DasPseudoOps|DasTemplate|DasRegNames, prgColumns - 20);
        dasBundle(&bndl, i0Str, i1Str, i2Str);
        ipp = instPtr(ofs, i0Str);
-       p += sprintf(p, "%s%c%c %s %s\r\n", srcp, bpn, ipp, buf, i0Str);
+       p += sprintf(p, "%s%c%c %s %s\n", srcp, bpn, ipp, buf, i0Str);
        if (i1Str[0]) {         /* not MLX */
            bpn = ((i = isbpt(ofs + 4)) >= 0) ? (i + '0') : ' ';
            ipp = instPtr(ofs + 4, i1Str);
-           p += sprintf(p, "%c%c %16s %s\r\n", bpn, ipp, "", i1Str);
+           p += sprintf(p, "%c%c %16s %s\n", bpn, ipp, " ", i1Str);
            bpn = ((i = isbpt(ofs + 8)) >= 0) ? (i + '0') : ' ';
            ipp = instPtr(ofs + 8, i2Str);
        } else {                /* MLX */
@@ -280,12 +280,12 @@
                    ? (i + '0') : ' ';
            ipp = instPtr(ofs + 4, i2Str);
        }
-       p += sprintf(p, "%c%c %16s %s\r\n", bpn, ipp, "", i2Str);
+       p += sprintf(p, "%c%c %16s %s\n", bpn, ipp, " ", i2Str);
        *asmrows = i1Str[0] ? 3 : 2;
     } else {
 xxx:
        ipp = (ipGet(viewPid) == ofs) ? '>' : ' ';
-       (void)sprintf(line, "%c%c %s xxxxxxxx\r\n", bpn, ipp, buf);
+       (void)sprintf(line, "%c%c %s xxxxxxxx\n", bpn, ipp, buf);
        *srcrows = 0;
        *asmrows = 1;
     }



--
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
http://www.ertos.nicta.com.au           ERTOS within National ICT Australia
A university is a non-profit organisation only in the sense that it
spends everything it gets  ... Luca Turin.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to