[Toybox] Editors and such.

Roy Tam roytam at gmail.com
Wed Sep 5 20:31:43 PDT 2012


2012/9/6 David Seikel <onefang at gmail.com>:
> Sending this again, since it seemed to have been silently dropped
> somewhere.  No bounce, it just never made it to the mailing list.  This
> time with a link instead of an attached file, in case that was the
> problem.
>
> On Sun, 01 Jul 2012 22:20:24 -0500 Rob Landley <rob at landley.net> wrote:
>
>> On 07/01/2012 12:14 PM, David Seikel wrote:
>> > On Sun, 01 Jul 2012 11:58:05 -0500 Rob Landley <rob at landley.net>
>> > wrote:
>> >
>> >> I'm adding a chunk at a time and checking it in. I have somewhat
>> >> elaborate plans, but they change as I go along.
>> >>
>> >> Your design of course takes into account none of _my_ elaborate
>> >> plans, but since I haven't checked them in yet they're fair game.
>> >>
>> >> But I'm a bit nervous about impedence matching a giant code drop.
>> >
>> > My design is changing as I go along as well.  I'm trying to shake
>> > out a proper design for all of this with some real world sanity
>> > checking.
>>
>> Aren't we all. :)
>>
>> > The first code drop will just be a single toy, which is just a
>> > prototype.  A work in progress for commenting on.  Later it should
>> > probably be split up into a few library bits that can be left out of
>> > the build if not needed.
>>
>> Yay trail of breadcrumbs. I look forward to it.
>
> Here's a code drop, warts and all.  I should have done this a month ago,
> which is the last time I looked at it.  Though the stuff I did a month
> ago was mostly adding lots more comments.  Keep in mind what I said
> above, this is a work in progress, proof of concept, playground,
> packaged up as one big toy, to be self contained until the mess is
> cleaned up.  This "boxes" toy itself will go away, to be replaced by
> individual editor / pager toys and library bits.  Nothing is set in
> stone, lots of mess inside, there's bugs, but at least it shows the
> general direction my mind is wandering in.  As a bonus, it actually
> works, you can edit stuff.
>
> Please don't actually include this in toybox yet.  Just look at it and
> sneer / giggle, depending on your nature.  Drop it into the toys
> directory to try it out, it's just one big toy.
>
> If you want to see how it can be used to build specific editors, start
> at the end of the source code and work backwards.  Reading the lengthy
> comments at the beginning would also be useful.
>
> I've not even looked at it in the last month, just thought it was past
> time to show the code.  I'll get back to working on it when I can.
>
> I put it on github, simply coz github is where I put all my stuff, and
> I suspect my previous emails large attachment was the reason it got
> dropped.  If and when it's ready for including in toybox, and Rob wants
> to include it, then it can be added to the official toybox repo and I
> can drop the github version.  But since it's on github now, I might as
> well keep that up to date, "release often".
>
> https://github.com/onefang/boxes
>

I did a brief trial and I hit segfault.

$ gdb --args ./toybox_unstripped boxes -m less LICENSE
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/roy/toybox/toybox_unstripped...done.
(gdb) r

[press page down for few seconds, then press up arrow for few seconds]

Program received signal SIGSEGV, Segmentation fault.
formatLine (view=0x8069168, input=0x0, output=0x806919c)
    at toys/other/boxes.c:843
843        int len = strlen(input), i = 0, o = 0;
(gdb) bt
#0  formatLine (view=0x8069168, input=0x0, output=0x806919c)
    at toys/other/boxes.c:843
#1  0x0804f1dd in moveCursorAbsolute (view=0x8069168, cX=0, cY=10, sX=0, sY=0)
    at toys/other/boxes.c:951
#2  0x0804f367 in moveCursorRelative (view=0x8069168, cX=0, cY=10, sX=0, sY=0)
    at toys/other/boxes.c:1011
#3  0x0804f479 in upLine (view=0x8069168, event=0x0) at toys/other/boxes.c:1442
#4  0x0804fb63 in handleKey (view=0x8069168, i=2, keyName=<optimized out>,
    buffer=0xbffffad8 "\033[A") at toys/other/boxes.c:1593
#5  0x0805008d in editLine (view=0x8069168, X=-1, Y=-1, W=-1, H=-1)
    at toys/other/boxes.c:1785
#6  0x08050288 in boxes_main () at toys/other/boxes.c:2482
#7  0x0804b262 in toy_exec (argv=0xbffffd58) at main.c:104
#8  0x0804b29d in toybox_main () at main.c:118
#9  0x0804b262 in toy_exec (argv=0xbffffd54) at main.c:104
#10 0x0804b29d in toybox_main () at main.c:118
#11 0x0804affa in main (argc=5, argv=0xbffffd54) at main.c:159

 1346902303.0


More information about the Toybox mailing list