Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] Calling the AGK compiler in debug mode

Author
Message
gosukiwi
AGK Tool Maker
3
Years of Service
User Offline
Joined: 24th May 2020
Location: Argentina
Posted: 1st Jun 2020 23:22 Edited at: 2nd Jun 2020 00:19
So, I'm working on an Atom package supporting AGK. So far I managed to have syntax highlighting and basic compilation (compile and compile+run) working. It even uses a linter to show you the line where compilation failed and highlight it

Something I have no idea how it works though is the debugger. It seems that the compiler only has two flags: -agk and -run, as discussed here: https://forum.thegamecreators.com/thread/218915

Does anyone here have any idea how I can work with the debugger? It would be great to have it integrate with Atom somehow.

Thanks!

The author of this post has marked a post as an answer.

Go to answer

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 1st Jun 2020 23:33
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 2nd Jun 2020 00:18
gosukiwi
AGK Tool Maker
3
Years of Service
User Offline
Joined: 24th May 2020
Location: Argentina
Posted: 2nd Jun 2020 01:09 Edited at: 2nd Jun 2020 01:11
Thanks guys. Unfortunately both threads cover only how to run the compiler to generate an executable, but nothing about running it in debug mode as in the IDE I'm not even sure the IDE uses that compiler to debug, as it seems to have only two options, -agk and -run. The only other executable is for broadcasting so I'm at a total loss.
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 2nd Jun 2020 02:18 Edited at: 2nd Jun 2020 02:18
gosukiwi, In such a sequence and with such parameters, programs are called when clicking on debug.

Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 2nd Jun 2020 02:57 Edited at: 2nd Jun 2020 03:04
All debug logic is in Geany.
https://github.com/TheGameCreators/AGKIDE
View this file: AGKIDE-master\src\build.c It writes about breakpoints, etc.

gosukiwi, can you share what you did for the atom?
gosukiwi
AGK Tool Maker
3
Years of Service
User Offline
Joined: 24th May 2020
Location: Argentina
Posted: 2nd Jun 2020 04:26 Edited at: 2nd Jun 2020 04:27
Thanks Qugurun! That seems to be the way it's done.

I tried running the command "C:\Program Files (x86)\The Game Creators\AGK2\Tier 1\Editor\bin\gspawn-win32-helper.exe
9 10 z 5 7 C:\Users\User\Documents\AGK Projects\Test y y - C:\Program Files (x86)\The Game Creators\AGK2\Tier 1\Compiler\AGKCompiler.exe -agk main.agc" but it does nothing not sure if I'm doing something wrong (I tried with a local demo project but still got nothing).

I don't even know what gspawn-win32-helper does. It seems to be a helper to spawn processes in windows but that's as far as I can tell, particularly without knowing much C. It seems to be part of gnome/geany but I couldn't find any documentation on it or the command line options.

For the Atom plugin, no worries I will share it here once it's more mature. Even without a debugger it should be a decent development environment, but if I could get some documentation on how the debugger works that would be awesome
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 2nd Jun 2020 04:32
paths need to be wrapped in quotation marks - " "
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 2nd Jun 2020 05:38 Edited at: 2nd Jun 2020 05:45
This post has been marked by the post author as the answer.
@gosukiwi: i've already sent you a personal message. only then did i notice this thread.

Now the same answer for everyone.

Quote: "Debugging and broadcasting behave in the same way. You can also start the broadcasting tool yourself. You can find this under '$(AGK_INSTALLFOLDER)\Tier1\Compiler'. A commandline box will appear where you can enter commands. With 'help' the possible commands are listed.
"


This is the case for the classic version. I don't know how it is with 'AGK-Studio'.


EDIT:
Debugging is Broadcasting to your self - connect to '127.0.0.1'
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 2nd Jun 2020 06:18
Is there any documentation for controlling the debugger?
What to send/receive over the network?
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 2nd Jun 2020 11:14
I haven't found any. I learned all this just by trying.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
gosukiwi
AGK Tool Maker
3
Years of Service
User Offline
Joined: 24th May 2020
Location: Argentina
Posted: 2nd Jun 2020 18:00
Thanks MadBit! I managed to get it working using the broadcaster's CLI. I'll see how much I can automate with Atom

I'll post here once it's in a decent state.

Cheers!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 2nd Jun 2020 21:57
Quote: "I haven't found any. I learned all this just by trying."

Some tips would be great if you have any!
gosukiwi
AGK Tool Maker
3
Years of Service
User Offline
Joined: 24th May 2020
Location: Argentina
Posted: 2nd Jun 2020 22:29
So far what I've learned is that the AGKBroadcast executable opens it's own command line, or you can spawn the process with `-nowindow` to hide it. Then use the stdio pipe to send commands to it programatically. You can see all the commands and general usage by opening the exe and typing "help". The broadcaster requires the interpreter to be open before it runs though, the interpreter is in the "C:\...\App Game Kit 2\Tier 1\Compiler\interpreters" folder.

Also the compiler only accepts two args when running it, `-agk` and `-run`. The first compiles the project, the second also runs the generated executable.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 6th Jun 2020 02:53 Edited at: 6th Jun 2020 04:07
Quote: "So far what I've learned is that the AGKBroadcast executable opens it's own command line, or you can spawn the process with `-nowindow` to hide it. Then use the stdio pipe to send commands to it programatically."


That is correct, use in order "setproject <path-no-quotes>, connect 127.0.0.1, debug" but you will need to compile the project before sending it to the debugger to check for errors, the debugger will run the last compiled bytecode file, and you will need the -nowindow flag or it throws a fit and shuts everything down, you can set break points and watch lists on the fly.

I'm curious to know if you get this working from Atom as it took me a whole tonn of work to achieve something I thought would be pretty easy.

The 1 thing I cant figure out is how to get the result of the "Log()" function, I assume this is sent directly to the editor from the interpreter, any ideas?

Edit: "The 1 thing I cant figure out...."

Nevermind I got it, I didnt take my own advice and compile the project after adding the Log() call so indeed I got no feedback, thats what coding for 16 hours gets me, I got everything I need now to make a pretty complete stand alone debugger for my editor once I finish the lexer.

Login to post a reply

Server time is: 2024-04-19 02:08:14
Your offset time is: 2024-04-19 02:08:14