Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support GDB #29

Open
orhun opened this issue Sep 14, 2024 · 19 comments
Open

Support GDB #29

orhun opened this issue Sep 14, 2024 · 19 comments
Assignees
Labels
enhancement New feature or request question Further information is requested research & design Research and design is needed

Comments

@orhun
Copy link
Owner

orhun commented Sep 14, 2024

Is your feature request related to a problem? Please describe.

Quoting from @[email protected]:

If I were to request some feature it would be a TUI front end to GDB similar to how PWNDBG or GEF does it, but that would probably be way too ambitious

Describe the solution you'd like

Throwing this here for brainstorming purposes.

Describe alternatives you've considered

None.

Additional context

@orhun orhun added the enhancement New feature or request label Sep 14, 2024
@orhun orhun self-assigned this Sep 14, 2024
@TornaxO7
Copy link

Suggestion: Maybe we could go even further and create something like an interface for debuggers so that we can probably call something like bugstalker instead of gdb.

@orhun
Copy link
Owner Author

orhun commented Sep 15, 2024

That's a very good idea!

In fact I would like to invite the author of bugstalker @godzie44 here for asking his opinion and potentially collaborating on this :)

@godzie44
Copy link
Contributor

Hey! I also think that this is a cool idea, and I am ready to help in its implementation.

I think it would be nice to have a command like binsider inside bs. But, maybe you have a different vision of such integration.

@orhun
Copy link
Owner Author

orhun commented Sep 17, 2024

I was thinking more like having a separate tab inside binsider for running bs with a TUI somehow. In some prompt you can enter debugger commands and get the output.

Also, see what I did for heh, we can potentially use the whole app as a TUI widget inside bs :)

What do you think?

@godzie44
Copy link
Contributor

I like both options. But I'm not sure how ready bs is to work as a widget, because it relies heavily on the tuirealm framework. I'll try to do some RND on that.

@godzie44
Copy link
Contributor

About bs in binsider

Unfortunately, as i expect, the possibility to integrate tui of bs into tui of binsider looks difficult to implement, because bs uses tuirealm (with ratatui 26) and binsider uses latest ratatui. It seems that such integration requires a very large refactoring of bs.

About binsider in bs

It seems like it would be much easier to do this. Especially, If binsider introduce interface like heh. I'm trying to integrate bs with heh and it's looks cool (and easy for implement), see godzie44/BugStalker@1757c1c.

A small demo:

render1726586514897

@orhun
Copy link
Owner Author

orhun commented Sep 18, 2024

That's cool! I would want to see this implemented in two ways at the end of the day but putting binsider in bs seems like super easy and convenient :)

Especially, If binsider introduce interface like heh

Would you be interested in contributing that? 👀 As a reference: ndd7xv/heh#120

@godzie44
Copy link
Contributor

Of course, i think i can do this

@orhun
Copy link
Owner Author

orhun commented Sep 19, 2024

Perfect!

@orhun orhun assigned godzie44 and unassigned orhun Sep 19, 2024
@godzie44
Copy link
Contributor

Hey @orhun , i'm try to implement binsider as a widget, but face with the problem - binsider should reset (or re-create) a whole terminal for properly work. I think this makes a problem when binsider widget will be using in another tui (like window in window). What do you think about it? Is it possible to don't reset (re-create) a terminal? Or even, should we think about reject binsider as a widget idea, and just implement embedding into terminal application (for bugstlaker this will be enough)?

@orhun
Copy link
Owner Author

orhun commented Sep 24, 2024

should reset (or re-create) a whole terminal for properly work.

Hmm, can you expand on this a bit? Not sure if I get the problem here.

just implement embedding into terminal application (for bugstlaker this will be enough)?

What do you mean by embedding it? 👀

@godzie44
Copy link
Contributor

Hmm, can you expand on this a bit? Not sure if I get the problem here.

As i see for heh, just exposed two methods: draw and handle_input

terminal.draw(|frame| {
    heh.render_frame(frame, frame.area());
});
heh.handle_input(&ratatui::crossterm::event::Event::Key(/* */)).unwrap();

This interface give a possibility to create own Terminal instance and control it by user. In other side, binsider highly coupled with Tui structure that own a Terminal, and contains method like init/reset/exit so user of binsider widget cannot control it by its own. I'm not so good at tui as you, but i think this may be a problem, is it so?

What do you mean by embedding it? 👀

Instead of draw and handle_input just expose start_tui function for user, so binsider will control all terminal lifecycle as now. But better solution, as i see, make some refactor for decople from Tui component.

@orhun
Copy link
Owner Author

orhun commented Sep 26, 2024

Ah I see. I gave this a shot and realized it is actually possible without changing the API: #52 (just a small tweak in the prelude)

I think that's a good start. What do you think? :)

@orhun orhun added research & design Research and design is needed question Further information is requested labels Sep 27, 2024
@godzie44
Copy link
Contributor

godzie44 commented Oct 1, 2024

It's looks very good for me, and fully covers integration with bugstalker. The only downside is the rather complex interface for the caller, but I don't see any simple solutions here.

@orhun
Copy link
Owner Author

orhun commented Oct 1, 2024

yup, do you think you can give it a shot implementing it? I'm also down to simplify the API based on your usage btw

@godzie44
Copy link
Contributor

godzie44 commented Oct 2, 2024

@orhun JFYI godzie44/BugStalker#45

yup, do you think you can give it a shot implementing it? I'm also down to simplify the API based on your usage btw

yep, i can try

@godzie44
Copy link
Contributor

godzie44 commented Oct 7, 2024

@orhun please check this draft #73, if you ok with it - i will make code cleaner

@wcampbell0x2a
Copy link

FYI: I started writing an architecture agnostic gdb tui frontend. It's still in the early days of testing and performance: https://github.com/wcampbell0x2a/heretek

@orhun
Copy link
Owner Author

orhun commented Dec 11, 2024

That's awesome!

I fell a bit behind on integrating BugStalker (and overall maintenance of this project) but that's something that I want to have as a functionality in the future!

I'm not sure if you would be open to designing your API in a way that follows #52 (or #73), but if you do, definitely let me know when the project reaches semi-stable state and it would be great to discuss potential collaborations :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested research & design Research and design is needed
Projects
None yet
Development

No branches or pull requests

4 participants