npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bugs

v0.1.0

Published

A unified interface to common debuggers (gdb, jdb, pdb, ...)

Downloads

114

Readme

bugs.js

A NodeJS library providing a unified interface to common debuggers (gdb, jdb, pdb, ...). It's meant for building developer tools (debug tools, IDEs, etc ...), built for Codebox

Supported debuggers

  • gdb : c/c++ (and any native binaries really)
  • jdb : java (and anything running on the JVM)
  • pdb : python
  • rdb : ruby
  • Feel free to send Pull Requests for more

Right now we interface with the current debugger through their command line programs and smartly writing and reading from their stdout/stdin.

Install

:warning: Warning: bugs is not yet published to npm

npm install bugs

Examples

python with pdb

var bugs = require('bugs');

// Use pdb to debug a python file
var dbg = bugs.pdb('./some_file.py');

// Debug "main" function
dbg.init()
.then(function() {
    return dbg.break('main');
})
.then(function() {
    // Run debugger
    return dbg.run();
})
.then(function() {
    // Get backtrace
    return dbg.backtrace();
})
.then(function(trace) {
    // Display trace & quit
    console.log('trace =', trace)
    return dbg.quit();
})
.done();

Native binaries with gdb

var bugs = require('bugs');

// Use gdb to unix "ls" binary
var dbg = bugs.gdb('ls');

// Debug "main" function
dbg.init()
.then(function() {
    return dbg.break('main');
})
.then(function() {
    // Run "ls" on a given folder
    return dbg.run('-al /tmp');
})
.then(function() {
    // Get backtrace
    return dbg.backtrace();
})
.then(function(trace) {
    // Display trace & quit
    console.log('trace =', trace)
    return dbg.quit();
})
.done();

Commands

General

.run(arg1, arg2, ...)

Run file to debug with given args

.restart()

Restart program

.quit()

Quit current instance of the debugger (this isn't terribly useful)

Movement

.finish()

Run until current method returns.

.step()

Execute and step into function

.stepi()

Execute current instruction

.continue()

Keep running from here

.next()

Run to the next line of the current function

.up()

Move one level up in the stack trace

.down()

Move one level down in the stack trace

Examination

.eval(code)

Evaluate a string of code and print the result

.backtrace()

Print backtrace of current stack

.list()

List source code of current location

.locals()

Get local variables of current stack

.globals()

Get global variables

Breakpoints

.breakpoints()

Lists currently set breakpoints

.breakpoint(location)

Set a new breakpoint at location (location can be a line number, function address ...)

.clear(location)

Clear breakproint for location (see above for location)

Aliases

.start()

Alias to run

.stop()

Alias to quit

Events

started

Signals when the debugger is ready to receive commands. .init() resolves when started is emitted (you should probably use that).

update

Provides updates when state of process changes. And updates not request or results of commands executed.