{"_id":"bugs","_rev":"11-c0d092b7d0edb3d86799066d7dd12136","name":"bugs","description":"A unified interface to common debuggers (gdb, jdb, pdb, ...) ","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.1":{"name":"bugs","version":"0.0.1","description":"A unified interface to common debuggers (gdb, jdb, pdb, ...) ","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/FriendCode/bugs.git"},"keywords":["gdb","pdb","jdb","bugs","debugger"],"author":{"name":"Aaron O'Mullan","email":"aaron.omullan@friendco.de"},"dependencies":{"q":"1.0.0","lodash":"2.4.1","event-stream":"3.1.0","pty.js":"0.2.3"},"bugs":{"url":"https://github.com/FriendCode/bugs/issues"},"_id":"bugs@0.0.1","dist":{"shasum":"e9897a65515eb3a6d93550e137015344efaa48a6","tarball":"https://registry.npmjs.org/bugs/-/bugs-0.0.1.tgz","integrity":"sha512-QIPTMcidZtVLD+I7yM8tteGPqmkXYk1nr5RxlpYPLk8YOOgWL5ZLtuaGcL8oACJzvgoGe2fTHZuQXOmLvhSYRQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzqX35pdXQsO4IDAVqHjlT5C7L/XwtDA9C+4UppNF2OwIgM4mjmTNacqQsvIEL1mgF64SnHSDQqVRtpveNSw9Q/LU="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"aarono","email":"aaron.omullan@gmail.com"},"maintainers":[{"name":"aarono","email":"aaron.omullan@gmail.com"}]},"0.1.0":{"name":"bugs","version":"0.1.0","description":"A unified interface to common debuggers (gdb, jdb, pdb, ...) ","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/FriendCode/bugs.git"},"keywords":["gdb","pdb","jdb","bugs","debugger"],"author":{"name":"Aaron O'Mullan","email":"aaron.omullan@friendco.de"},"dependencies":{"q":"1.0.0","lodash":"2.4.1","event-stream":"3.1.0","pty.js":"0.2.3"},"bugs":{"url":"https://github.com/FriendCode/bugs/issues"},"_id":"bugs@0.1.0","dist":{"shasum":"f638419670a6694e6dd60c3a471b0876b4608528","tarball":"https://registry.npmjs.org/bugs/-/bugs-0.1.0.tgz","integrity":"sha512-stHIYGT3o4lOIPSRY+0C0x2V2HiRQFATupIxkJDZKGFh17RhqytKuYzomxIwSD+XEAQkQDiK+uzcFWfh88Ut1A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEKcp536Ab0ComJ1v702bzwyvESiJypX0xI1yxI91KGgIgfK2Z27NSxhp9a1Q0zgm96eJOuZftBlqodOTe+HASuSY="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"aarono","email":"aaron.omullan@gmail.com"},"maintainers":[{"name":"aarono","email":"aaron.omullan@gmail.com"}]}},"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 & 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 & 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","maintainers":[{"name":"aarono","email":"aaron.omullan@gmail.com"}],"time":{"modified":"2022-06-13T05:15:56.254Z","created":"2014-03-11T01:03:04.428Z","0.0.1":"2014-03-11T01:03:06.167Z","0.1.0":"2014-03-16T05:13:52.079Z"},"readmeFilename":"README.md","keywords":["gdb","pdb","jdb","bugs","debugger"],"repository":{"type":"git","url":"https://github.com/FriendCode/bugs.git"},"author":{"name":"Aaron O'Mullan","email":"aaron.omullan@friendco.de"},"bugs":{"url":"https://github.com/FriendCode/bugs/issues"},"users":{"samypesse":true}}