dino-lang / dino

The programming language DINO
GNU General Public License v2.0
71 stars 5 forks source link

dino aborts with --dump param #15

Closed rofl0r closed 4 years ago

rofl0r commented 4 years ago
/seed/home/rofl/introduction[master]# gdb --args ../dino/DINO/dino --dump sas.d #oberon2.sas 
GNU gdb (GDB) 7.6.2
Copyright (C) 2013 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 "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /seed/home/rofl/dino/DINO/dino...done.
(gdb) b abort
Breakpoint 1 at 0x41f590
(gdb) r
Starting program: /seed/home/rofl/introduction/../dino/DINO/dino --dump sas.d
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ff9000

Breakpoint 1, 0x00007ffff7d87d3a in abort () from /lib/ld-musl-x86_64.so.1
(gdb) up
#1  0x0000000000424d56 in dino_main (argc=3, argv=0x7fffffffec38, envp=0x7fffffffec58)
    at d_dino.c:1663
1663            d_unreachable ();
(gdb) p option
$1 = 0x86f720 "--"

this is with sabotage linux/x86_64 based on musl libc.

vnmakarov commented 4 years ago

Thank you. I reproduced the bug. I think the problem is in a wrong command line description. I'll fix it this weekend.

rofl0r commented 4 years ago

from a cursory investigation it appears the command line parser module was changed to split "--foo" style options into the parts "--" and "foo", however the consumer (here dino) wasn't adapted and tries to parse the option as a single string.

vnmakarov commented 4 years ago

I fixed it. Command line arguments can have parameter. And parameter dump (for -i argument) conflicted with argument --dump. Fix was in change parameter dump into dumpfile.

rofl0r commented 4 years ago

thanks!