debug
debug copied to clipboard
Support interactive `rdbg -A` when there are multiple sockets
Your proposal
Allow selecting socket files in rdbg -A when there are multiple socket files, instead of just listing them.
The UI can be similar to:

I think we can't choose the sockets without using ps or some other tools to know which socket is the correct socket. So I think this kind of UI doesn't help.
I thought it's just listing socket files and select one of them?
I implemented a demo with the cli-ui gem.
https://user-images.githubusercontent.com/5079556/180744888-553d6cda-7767-4095-8543-31142474eee5.mov
Code change:
else
- $stderr.puts "Please select a debug session:"
- files.each{|f|
- $stderr.puts " #{File.basename(f)}"
- }
- exit
+ require "cli/ui"
+ CLI::UI::Prompt.ask('Please select a debug session:') do |handler|
+ files.each do |file|
+ handler.option(file) { |selection| @s = Socket.unix(selection) }
+ end
+ end
end
Of course I'm not saying we should rely on the cli-ui for this feature. I just want to demonstrate that it should be possible.
I meant it is hard to choose the file by users with only from socket file name.
It depends on the setup because the debugger allows setting custom socket name. For example we have serverand worker in the socket names so it's helpful in my company.
And also by default the socket name is displayed at the debuggee start, so it should be helpful in general.
Yes it depends.