All Projects → dlsniper → debugger

dlsniper / debugger

Licence: MIT license
Debugging helper for Go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to debugger

SmartDump
SmartDump - an exception and memory dump capture utility
Stars: ✭ 17 (-68.52%)
Mutual labels:  debugger, debugging
gdbundle
Minimalist plugin manager for GDB and LLDB
Stars: ✭ 72 (+33.33%)
Mutual labels:  debugger, debugging
Vimspector
vimspector - A multi-language debugging system for Vim
Stars: ✭ 2,711 (+4920.37%)
Mutual labels:  debugger, debugging
Gdb Frontend
☕ GDBFrontend is an easy, flexible and extensionable gui debugger.
Stars: ✭ 2,104 (+3796.3%)
Mutual labels:  debugger, debugging
TrackJS-Node
TrackJS Error Monitoring agent for NodeJS
Stars: ✭ 26 (-51.85%)
Mutual labels:  debugger, debugging
Frodo2
Android Library for Logging RxJava2 Components
Stars: ✭ 142 (+162.96%)
Mutual labels:  debugger, debugging
go-jwt-issuer
Microservice generates the pair of JSON web tokens - access-token and refresh-token are signed by user identifier.
Stars: ✭ 30 (-44.44%)
Mutual labels:  debugging, goland
Scala Debugger
Scala libraries and tooling utilizing the Java Debugger Interface.
Stars: ✭ 100 (+85.19%)
Mutual labels:  debugger, debugging
birdseye-pycharm
IntelliJ IDE plugin for the Python debugger birdseye
Stars: ✭ 32 (-40.74%)
Mutual labels:  debugger, debugging
Linux-Kernel-Driver-Programming
Implementation of PCI drivers, kprobe, sysfs, devfs, sensor driver, miscdevices, synchronization
Stars: ✭ 43 (-20.37%)
Mutual labels:  debugger, debugging
Rexbug
A thin Elixir wrapper for the redbug Erlang tracing debugger.
Stars: ✭ 126 (+133.33%)
Mutual labels:  debugger, debugging
react-native-debug-console
A network and console debug component and modal for react native purely in JavaScript
Stars: ✭ 17 (-68.52%)
Mutual labels:  debugger, debugging
Frodo
Android Library for Logging RxJava Observables and Subscribers.
Stars: ✭ 1,496 (+2670.37%)
Mutual labels:  debugger, debugging
Inappviewdebugger
A UIView debugger (like Reveal or Xcode) that can be embedded in an app for on-device view debugging
Stars: ✭ 1,805 (+3242.59%)
Mutual labels:  debugger, debugging
Birdseye
Graphical Python debugger which lets you easily view the values of all evaluated expressions
Stars: ✭ 1,373 (+2442.59%)
Mutual labels:  debugger, debugging
Scyllahide
Advanced usermode anti-anti-debugger. Forked from https://bitbucket.org/NtQuery/scyllahide
Stars: ✭ 2,211 (+3994.44%)
Mutual labels:  debugger, debugging
Dbgshell
A PowerShell front-end for the Windows debugger engine.
Stars: ✭ 566 (+948.15%)
Mutual labels:  debugger, debugging
Python Hunter
Hunter is a flexible code tracing toolkit.
Stars: ✭ 599 (+1009.26%)
Mutual labels:  debugger, debugging
heaptrace
helps visualize heap operations for pwn and debugging
Stars: ✭ 252 (+366.67%)
Mutual labels:  debugger, debugging
vil
Vulkan Layer for Live Introspection & Debugging. Allows to view all vulkan state live inside your application.
Stars: ✭ 39 (-27.78%)
Mutual labels:  debugger, debugging

Debugger Middleware

This package provides a debugging middleware for Go applications to enable better display of goroutines in the debugger.

It has nearly-zero performance penalty in production code when not actively used.

How this looks like in the IDE

Below you can see how this feature looks like in GoLand IDE:

Debugger labels in GoLand

How to use

Include it in your application using one of the patterns below.

Then, compile the application with -tags debugger, e.g.

go build -tags debugger

More details on how to use this can be found in this blog post: https://blog.jetbrains.com/go/2020/03/03/how-to-find-goroutines-during-debugging/

HTTP handlers

In your code, replace the HTTP handler with the Middleware function call.

Original:

router.HandleFunc("/", homeHandler)

Replacement:

router.HandleFunc("/", debugger.Middleware(homeHandler, func(r *http.Request) []string {
    return []string{
        "path", r.RequestURI,
    }
}))

Non-HTTP handlers

For normal functions/methods, you can use the SetLabels / SetLabelsCtx functions to set the debugger labels.

Original:

func sum(a, b int) int {
    return a+b
}

Replacement:

func sum(a, b int) int {
    debugger.SetLabels(func() []string {
        return []string{
            "a", strconv.Itoa(a),
            "b", strconv.Itoa(b),
        }
    })

    return a+b
}

Performance

You can asses the performance of this library by running the included benchmarks in your environment.

Here are the results from my own machine (Intel Core i7 6700HQ, 32GB RAM, Windows 10), when running with a -count=5 pass, averaged across runs.

Go 1.13.8

Without labels:

Name go 1.13.8 go 1.14 RC1
Execution count Time Execution count Time
BenchmarkWorkerWithout-8 3255558 370 ns/op 3183910 368 ns/op
BenchmarkWorkerWithOne-8 25938 45698 ns/op 25643 46479 ns/op
BenchmarkWorkerWithThree-8 15656 78222 ns/op 19754 60131 ns/op
BenchmarkWorkerWithTen-8 5776 216798 ns/op 7322 171842 ns/op
BenchmarkWorkerWithConv-8 15374 79609 ns/op 19049 63818 ns/op

License

This project is provided under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].