nakst / gf

A GDB frontend for Linux.
MIT License
1.82k stars 61 forks source link

feat: added the ability to enable, disable and delete multiple breakpoints at once #123

Closed s4my closed 1 year ago

s4my commented 1 year ago

This PR adds the ability to delete, enable and disable multiple selected breakpoints at once. The user can select multiple breakpoints by holding the CTRL key and clicking with the left mouse button on the desired breakpoints in the Breakpoint window, or by holding down the SHIFT key and selecting a desired range or breakpoints. Then if they choose in the right click menu to Delete, Enable or Disable, the action will affect all the selected breakpoints.

nakst commented 1 year ago

I think it would make more sense if the selectedBreakpoints array stored the number of the breakpoints, rather than their internal indices, so that adding/removing breakpoints from the command input does not upset the selection.

s4my commented 1 year ago

I think it would make more sense if the selectedBreakpoints array stored the number of the breakpoints, rather than their internal indices, so that adding/removing breakpoints from the command input does not upset the selection.

That does cause a problem but only for removing breakpoints. Saving the breakpoint numbers is a more robust solution, but we still need the indices for the SHIFT functionality. I have made the changes to get CTRL selection work in this "wip" commit d9d04499eea68a99841304e97028ba2bb73de5a0, but i was wondering if there's a way to get the indices of the selected entries without me having to keep track of them manually ? i can't seem to find a way to do so naively in luigi

nakst commented 1 year ago

but i was wondering if there's a way to get the indices of the selected entries without me having to keep track of them manually ? i can't seem to find a way to do so naively in luigi

Unfortunately, UITable is a very low-level control, so it does not include such feature support. You have to do it manually (I've gone and done this myself in 2fc60fc).

s4my commented 1 year ago

but i was wondering if there's a way to get the indices of the selected entries without me having to keep track of them manually ? i can't seem to find a way to do so naively in luigi

Unfortunately, UITable is a very low-level control, so it does not include such feature support. You have to do it manually (I've gone and done this myself in 2fc60fc).

I figured as much because i exhaust my search and i didn't find anything before i asked. I started working on a solution using MapShort, but it seems incomplete, there is no Delete() method, and there's no way to get a key associated with a value, no Length() method (which can be as simple as size_t Length() { return used } and btw i think used should be renamed to size, and i think adding a key = 0 seems to cause a problem, but am not so sure).

I feel like you just merged my dirty laundry. you should of told me to remove the part relating to shift (since you're gonna implement it yourself) and clean up the commit message to state clearly what the commit actually does (multi selection with CTRL) before you merged my work in progress commits, but oh well i hope i was of help and am glad because of this Array has evolved functionality now.

nakst commented 1 year ago

I feel like you just merged my dirty laundry. you should of told me to remove the part relating to shift (since you're gonna implement it yourself) and clean up the commit message to state clearly what the commit actually does (multi selection with CTRL) before you merged my work in progress commits, but oh well i hope i was of help and am glad because of this Array has evolved functionality now.

Do not worry, your pull requests are helpful =)