{"id":22976502,"url":"https://github.com/interviewstreet/bugs","last_synced_at":"2025-09-05T11:32:33.918Z","repository":{"id":148354867,"uuid":"74450201","full_name":"interviewstreet/bugs","owner":"interviewstreet","description":"Codeboxy-bugs","archived":false,"fork":false,"pushed_at":"2016-11-22T08:22:57.000Z","size":337,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":43,"default_branch":"master","last_synced_at":"2025-02-07T23:27:09.396Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interviewstreet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-22T08:20:30.000Z","updated_at":"2016-12-13T09:40:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"f7f39f19-30d5-4fd4-863f-e10355a83e73","html_url":"https://github.com/interviewstreet/bugs","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interviewstreet%2Fbugs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interviewstreet%2Fbugs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interviewstreet%2Fbugs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interviewstreet%2Fbugs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interviewstreet","download_url":"https://codeload.github.com/interviewstreet/bugs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246777791,"owners_count":20832033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-15T00:51:53.633Z","updated_at":"2025-04-02T08:20:59.679Z","avatar_url":"https://github.com/interviewstreet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"bugs.js\n====\n\nA *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](https://github.com/FriendCode/codebox)\n\n## Supported debuggers\n  - `gdb` : `c/c++` (and any native binaries really)\n  - `jdb` : `java` (and anything running on the JVM)\n  - `pdb` : `python`\n  - `rdb` : `ruby`\n  - Feel free to send Pull Requests for more\n\nRight now we interface with the current debugger through their command line programs and smartly writing and reading from their `stdout`/`stdin`.\n\n## Install\n:warning: *Warning*: `bugs` is not yet published to npm\n```\nnpm install bugs\n```\n\n## Examples\n\n#### `python` with `pdb`\n\n```js\nvar bugs = require('bugs');\n\n// Use pdb to debug a python file\nvar dbg = bugs.pdb('./some_file.py');\n\n// Debug \"main\" function\ndbg.init()\n.then(function() {\n    return dbg.break('main');\n})\n.then(function() {\n    // Run debugger\n    return dbg.run();\n})\n.then(function() {\n    // Get backtrace\n    return dbg.backtrace();\n})\n.then(function(trace) {\n    // Display trace \u0026 quit\n    console.log('trace =', trace)\n    return dbg.quit();\n})\n.done();\n```\n\n#### Native binaries with `gdb`\n\n```js\nvar bugs = require('bugs');\n\n// Use gdb to unix \"ls\" binary\nvar dbg = bugs.gdb('ls');\n\n// Debug \"main\" function\ndbg.init()\n.then(function() {\n    return dbg.break('main');\n})\n.then(function() {\n    // Run \"ls\" on a given folder\n    return dbg.run('-al /tmp');\n})\n.then(function() {\n    // Get backtrace\n    return dbg.backtrace();\n})\n.then(function(trace) {\n    // Display trace \u0026 quit\n    console.log('trace =', trace)\n    return dbg.quit();\n})\n.done();\n```\n\n# Commands\n\n## General\n\n### `.run(arg1, arg2, ...)`\nRun file to debug with given args\n\n### `.restart()`\nRestart program\n\n### `.quit()`\nQuit current instance of the debugger (this isn't terribly useful)\n\n\n## Movement\n\n### `.finish()`\nRun until current method returns.\n\n### `.step()`\nExecute and step into function\n\n### `.stepi()`\nExecute current instruction\n\n### `.continue()`\nKeep running from here\n\n### `.next()`\nRun to the next line of the current function\n\n### `.up()`\nMove one level up in the stack trace\n\n### `.down()`\nMove one level down in the stack trace\n\n\n## Examination\n\n### `.eval(code)`\nEvaluate a string of `code` and print the result\n\n### `.backtrace()`\nPrint backtrace of current stack\n\n### `.list()`\nList source code of current location\n\n### `.locals()`\nGet local variables of current stack\n\n### `.globals()`\nGet global variables\n\n\n## Breakpoints\n\n### `.breakpoints()`\nLists currently set breakpoints\n\n### `.breakpoint(location)`\nSet a new breakpoint at `location` (`location` can be a line number, function address ...)\n\n### `.clear(location)`\nClear breakproint for `location` (see above for `location`)\n\n## Aliases\n\n### `.start()`\nAlias to `run`\n\n### `.stop()`\nAlias to `quit`\n\n# Events\n\n### `started`\nSignals when the debugger is ready to receive commands.\n`.init()` resolves when `started` is emitted (you should probably use that).\n\n### `update`\nProvides updates when state of process changes. And updates not request or results of commands executed.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterviewstreet%2Fbugs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterviewstreet%2Fbugs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterviewstreet%2Fbugs/lists"}