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

Feature request: protongbd #378

Closed
zany130 opened this issue Dec 15, 2021 · 14 comments
Closed

Feature request: protongbd #378

zany130 opened this issue Dec 15, 2021 · 14 comments

Comments

@zany130
Copy link
Collaborator

zany130 commented Dec 15, 2021

May be useful to have this as an option for debugging proton games
https://github.com/Joshua-Ashton/protongdb

@frostworx
Copy link
Collaborator

Good idea, let's see how complicated it is to implemented it to work ootb for the user without any configuration

@frostworx
Copy link
Collaborator

Hm, two issues on that one:

  • the project itself has no release or tag
  • it depends on protontricks

Doesn't make much sense then to add support for it as

  • protongdb would require an own package (at least for Arch/AUR) (which might be ok-ish to create/maintain one when it had a release)
  • depending on a wip script with some python lines which wrap some Steam variables around gdb and also pulls in protontricks (which probably does nothing what steamtinkerlaunch does as well - no idea) seems to be more work as it helps.

I like the idea though to have gdb support, so I might(!) add gdb support directly instead -nothing promised. :)

Meanwhile you might want to play with the already implemented x64dbg instead (I hope it still works, haven't touched it for a while, but there were also no bug-reports)

Leaving this open until I decided if I'll add native gdb support (or until it is added :D)

@frostworx
Copy link
Collaborator

Heh, just have seen that protongbd calls steam.exe through proton (assuming the dummy one in
$COMPATDATA/pfx/drive_c/Program Files (x86)/Steam/)
which might be interesting for other things.
It is not needed though when gdb is integrated in steamtinkerlaunch, as you should be able to simply enable USEGDB
(f.e. by dragging it into a Steam Category GDB) and then start the game through gdb regularly by simply starting it through steam (should be run through a terminal automatically though, no idea if this could become problematic)

Still nothing promised, but I think it is pretty simple to implement gdb support into steamtinkerlaunch (though not sure yet with the terminal mentioned above)

@frostworx
Copy link
Collaborator

frostworx commented Dec 16, 2021

Not sure yet how to best open a terminal on game launch (is there are mime-type for bash scripts, so xdg-open can be option number one?), but I'll add gdb support.

Edit: by default xdg-open ignores shebang and ".sh" filename suffix, so this doesn't seem to be an option :(

@frostworx
Copy link
Collaborator

🙄

@zany130
Copy link
Collaborator Author

zany130 commented Dec 18, 2021

yeah, might be difficult to implement. My knowledge is really limited but couldn't you do something like konsole -e gdb if the gdb option is set? the problem would be figuring out what terminal the user has, but maybe that can be done in the global config?

@frostworx
Copy link
Collaborator

frostworx commented Dec 18, 2021

You have a good timing. I already implemented the core part (offline). The only thing left is the terminal :)
fortunately, the "-e" option is more or less an option for every terminal emulator available, so I set this at least as default.
Initially, I considered to autodetect available terminals and choose one, but I think I will just use a global variable and let the user set it manually (I do not think anyway that many people will use the gdb feature, so this wouldn't be worth the effort).

For autodetecting available terminals a rough grep -i TerminalEmulator /usr/share/applications/* might be a good starting point, but... well... no.

The final launch command of gdb will look something like this:
"$USETERM" "$TERMARGS" "bash -c \"$GDBRUN\""

Where USETERM is the terminal emulator program
TERMARGS are the command line arguments ;D (by default simply -e)
and GDBRUN is the auto-generated gdb launch script, which uses the same args as protongbd

The game launch process is started similar like in protongbd as well, but using my own functions and not protontricks
and also taking care of older proton versions which had the "dist/" paths instead of "files/".

The feature might be ready for a wip commit within the next days, but not sure yet.

@zany130
Copy link
Collaborator Author

zany130 commented Dec 18, 2021

That might be a good way to do it especially if later you want to do some other function in the terminal though can't really think of any use case for calling a terminal other then debugging. Also agree wouldn't be worth auto detecting the term as i think this is a nice to have but won't be used as much as other options as this would only be used by people with some Debugging knowledge.

@frostworx
Copy link
Collaborator

hehe, I wondered the same :)
Maybe for only opening the terminal instead of the game to adjust things manually.
Game specific vars would be set then and pwd would be the game dir automatically but that's pretty much all :)

@frostworx

This comment has been minimized.

@frostworx
Copy link
Collaborator

I just pushed the initial gdb support with this commit
and updated the wiki accordingly. have fun!

@zany130
Copy link
Collaborator Author

zany130 commented Dec 20, 2021

so just tried it out a couple of things.

  1. it wasn't launching with Konsole (KDE Terminal) until I installed xterm for some reason don't know why (didn't have xterm on my system) so maybe making xterm at least an optional dependcy in the aur package might be nice (don't know if you already did that though EDIT: don't see it also I don't know if gdb is included by default on most distros but I think it would be pretty obvious that it is needed for this function 😄 )

  2. If used in combination with game mode, the game is not launched with game mode which is strange here is a log
    Trails of Cold Steel.log (long-ass game about to finish lol)

like you said this is a low priority feature so if it is too difficult to solve maybe just making a note on the wiki would be enough for now? I'll test with protongdb script to see if the same issue is there as I feel like it might be

@frostworx
Copy link
Collaborator

  1. I don't use kde, no idea which arguments are required for konsole to immediately start a bash script
    I'll add gdb in the pkgbuild as optdepend for sure, but not a bunch of terminals - yes, maybe xterm - no idea
  2. this was intended as I see no reason to start anything besides the game and it would have bloated the code anyway

The feature is not really difficult to add (see the commit), but the general functionality seems to be a bit hacky.
I don't think I will expand the README again, but please don't hesitate to enhance it.

@zany130
Copy link
Collaborator Author

zany130 commented Dec 20, 2021

  1. Yeah agreed not a good idea to mark different terminals as a optional dep just maybe xterm as that would be one of the ones that is most likely installed anyway and compatible

  2. Makes sense the main use case for this would be debugging some crash or issue so normally you would want to run a vanilla as possible. I was running game mode as i use it to setup my displays for gaming. Most people wouldn't need this though.

Anyway i think this can be closed now as gdb was implemented and is working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants