Giter Site home page Giter Site logo

Comments (2)

rohanrhu avatar rohanrhu commented on May 7, 2024

It is actually usable with importing gdbfrontend module in any GDB session when you install it with PIP but I must do something for that usage.

Can you explain more?

from gdb-frontend.

0400H avatar 0400H commented on May 7, 2024

It is actually usable with importing gdbfrontend module in any GDB session when you install it with PIP but I must do something for that usage.

Can you explain more?

For example

https://github.com/rohanrhu/gdb-frontend/tree/master/api
https://github.com/rohanrhu/gdb-frontend/blob/master/plugins/hello/hello.py
import importlib
import json

import plugin
import api

gdb = importlib.import_module("gdb")

class HelloPlugin(plugin.GDBFrontendPlugin):
    def __init__(self):
        plugin.GDBFrontendPlugin.__init__(self)

    def loaded(self):
        gdb.events.new_objfile.connect(self.gdb_on_new_objfile)

    def unloaded(self):
        gdb.events.new_objfile.disconnect(self.gdb_on_new_objfile)

    def gdb_on_new_objfile(self, event):
        print("[HELLO] GDB Event: new_objfile:", event)
    
    def event(self, client, event, message):
        print("[HELLO] GDBFrontend Event Client#%d: %s: %s" % (client.client_id, event, message))

        for _client in api.globalvars.httpServer.ws_clients:
            _client.wsSend(json.dumps({
                "event": "hello",
                "replt_to": event
            }))

Maybe can remove http parts of hello.py(module parser), just keep I/O Interface.
Establish unit testing for module parser.
Rewrite the API/HTTP parts to load all module parser.

Just like

|- api
  |- module
       |- __init__.py
       |- modules
       |- test
  |- http
|- ...

from gdb-frontend.

Related Issues (20)

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.