Giter VIP home page Giter VIP logo

dbgp's Introduction

dbgp

DBGp client scripts for AutoHotkey.

These scripts run on AutoHotkey v2.0-beta.7+, but can receive connections from AutoHotkey v1 and possibly other debugger engines.

dbgp.ahk

Contains client functions for use by other scripts.

dbgp_console.ahk

Implements a basic debugger client using a command-line interface. This isn't very user-friendly; it's main uses are testing debugger engines and learning the protocol.

dbgp_listvars.ahk

Demonstrates asynchronous commands and variable retrieval.

This script is AutoHotkey-specific. It posts the AHK_ATTACH_DEBUGGER registered window message to all running scripts. Each script may respond by initiating a debugger connection. If there are successful connections, this test script queries and lists the variables of each connected script.

Note: AutoHotkey v1.1.09+ allows any command other than run/step to be sent asynchronously, but the spec does not require this. If a command is unavailable because the debugger is not in a break state, error 5 is returned.

dbgp_test.ahk

Demonstrates basic usage of the dbgp library.

When a connection is made, the client (this script) steps into the script being debugged. Each time the debugger breaks, the client logs the current line and instructs the debugger to step over one line. Stderr is redirected so that if OutputDebug is called, the output will be sent to the client.

Aside from basic usage, this test script hints at some possible uses for DBGp functions in a script. For example, this script could be extended to log variable values each time the debugger breaks, or at specific lines.

dbgp_benchmark.ahk

Implements a simple benchmark to measure overhead for simple commands, especially those SciTE4AutoHotkey uses when setting up a session.

dbgp's People

Contributors

lexikos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dbgp's Issues

`DBGp_StartListening` does not give useful error information

In the event of an error in DBGp_StartListening it calls the closesocket dll func before checking the WinSocket error code. However, closesocket resets the error code so the information is lost.

DBGp_StartListening(localAddress="127.0.0.1", localPort=9000)
{
    ...
    
    ; An error occurred.
    DllCall("ws2_32\closesocket", "ptr", s)
    return DBGp_WSAE()
}

This prevents the library user from correctly reporting or attempting to resolve errors. For example, the following code should increment the port when the desired one is in use (perhaps by another debugger) but in the case of an error it goes directly to the exception with ErrorLevel of 0.

port := 9000
while (!DBGp_StartListening(, port))
{
	if (ErrorLevel == "WSAE:10048") ; WSAEADDRINUSE
		port++
	else
		throw Exception("Failed to start debugger",, ErrorLevel)
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.