eshelyaron / debug_adapter Goto Github PK
View Code? Open in Web Editor NEWDebug Adapter Protocol (DAP) implementation for SWI-Prolog
License: MIT License
Debug Adapter Protocol (DAP) implementation for SWI-Prolog
License: MIT License
The debug_adapter
currently relies on at least two features that are not available on Windows:
wait_for_input/3
on none-socket streams (stdin specifically)The first problem can be solved by using an extra thread to wait on stdin and relay DAP messages to server via thread_send_message/2
. In this solution, the server handler thread stops using wait_for_input/3
altogether and only handles messages from the thread message queue.
A draft for adding Windows compatibility can be found in #39, it currently just gets the tests running on Windows during CI.
I'm trying to install but it fails:
λ swipl -g "pack_install(debug_adapter)" -t halt
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
Install [email protected] from https://github.com/eshelyaron/debug_adapter/releases/download/v0.2.5/debug_adapter-0.2.5.zip Y/n?
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
% "debug_adapter-0.2.5.zip" was downloaded 6 times
Package: debug_adapter
Title: Debug Adapter Protocol package for SWI-Prolog
Installed version: 0.2.5
Author: Eshel Yaron <[email protected]>
Maintainer: Eshel Yaron <[email protected]>
Packager: Eshel Yaron <[email protected]>
Home page: https://github.com/eshelyaron/debug_adapter
Download URL: https://github.com/eshelyaron/debug_adapter/releases/download/v0.2.5/debug_adapter-0.2.5.zip
Install "debug_adapter-0.2.5.zip" (91,667 bytes) Y/n?
% checking for swipl...
% /usr/lib/swipl/bin/x86_64-linux/swipl
% checking for a thread-safe mkdir -p...
% /usr/bin/mkdir -p
% checking for a BSD-compatible install...
% /usr/bin/install -c
% checking whether build environment is sane...
% yes
% checking for gawk...
% gawk
% checking whether make sets $(MAKE)...
% yes
% checking whether make supports nested variables...
% yes
% checking that generated files are newer than configure...
% done
% configure: creating ./config.status
% config.status: creating pack.pl
% config.status: creating Makefile
% config.status: creating prolog/Makefile
% config.status: creating test/Makefile
% config.status: creating test/server.plt
% cd . && /bin/sh /home/risto/.local/share/swi-prolog/pack/debug_adapter/missing automake-1.16 --foreign
ERROR: configure.ac:5: error: version mismatch. This is Automake 1.16.5,
ERROR: configure.ac:5: but the definition used by this AM_INIT_AUTOMAKE
ERROR: configure.ac:5: comes from Automake 1.16.1. You should recreate
ERROR: configure.ac:5: aclocal.m4 with aclocal and run automake again.
Warning: prolog/Makefile.am:2: warning: addprefix $(srcdir: non-POSIX variable name
Warning: prolog/Makefile.am:2: (probably a GNU make extension)
Warning: prolog/Makefile.am:4: warning: user target 'swipl_debug_adapter$(EXEEXT)' defined here ...
Warning: /usr/share/automake-1.16/am/program.am: ... overrides Automake target 'swipl_debug_adapter$(EXEEXT)' defined here
Warning: prolog/Makefile.am:1: while processing program 'swipl_debug_adapter'
% WARNING: 'automake-1.16' is probably too old.
% You should only need it if you modified 'Makefile.am' or
% 'configure.ac' or m4 files included by 'configure.ac'.
% The 'automake' program is part of the GNU Automake package:
% <https://www.gnu.org/software/automake>
% It also requires GNU Autoconf, GNU m4 and Perl in order to run:
% <https://www.gnu.org/software/autoconf>
% <https://www.gnu.org/software/m4/>
% <https://www.perl.org/>
% make: *** [Makefile:283: Makefile.in] Error 1
ERROR: -g pack_install(debug_adapter): Process "process(path(make),[all])": exit status: 2
Is there a way to get it working without autotools?
Currently (v0.6.3), the implementation of the DAP specification in da_server/1
is interwoven with logic that is specific to the use case of debugging (SWI-)Prolog programs.
It seems desirable to separate these concerns into two components, say dap_server
and dap_swipl
, such that dap_server
will implement only the generic framework for easily adapting debuggers in a manner conforming to the DAP specs, while dap_swipl
will encapsulate the specifics of adapting the SWI-Prolog debugger with all of its nitty-gritty details.
This will allow for (re-)using the dap_server
component for creating DAP servers for any language that is implemented on top of SWI-Prolog with minimal effort, by implementing only the logic that is specific for the target language's semantics.
Such languages include s(CASP), CHR, Logtalk and probably more.
To enable debugging Prolog code from VS Code we need to implement a Debugger Extension that will communicate with the SWI-Prolog Debug Adapter Protocol server from within the IDE.
A good starting point could be an existing VS Code debugger extension, perhaps this one or this one.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.