Recent

Author Topic: FpDebug feature request on Copy  (Read 698 times)

440bx

  • Hero Member
  • *****
  • Posts: 5077
FpDebug feature request on Copy
« on: January 31, 2025, 10:05:29 am »
Hello,

Please refer to the attachment.

When copying a value from the watches window, it seems there is no option that will copy an address in "raw" form, i.e., without a "$" and without any additional information that may be shown due to formatting.

It would often be useful to have the option of copying the raw address, i.e., without any ornaments into the clipboard so it can be used by external, non-Pascal based, tools.

In the attachment, copying AI_ADDRESS into the clipboard yields the value shown in the first "Jump to address" box.   Ideally, there would be an option (which is what's being requested in this post) to cause the copy of AI_ADDRESS in the clipboard to be what is shown in the second "Jump to address" box.

Thank you for reading.
« Last Edit: January 31, 2025, 10:09:55 am by 440bx »
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10917
  • Debugger - SynEdit - and more
    • wiki
Re: FpDebug feature request on Copy
« Reply #1 on: January 31, 2025, 10:21:53 am »
Please report as a feature request.

It is easy to change (but to be added to the IDE, needs an option)

ide\packages\idedebugger\watchesdlg.pp
LINE 1686
inside TDbgTreeViewWatchValueMgr.GetFieldAsText
case ....
   vdfDataAddress: begin

Just replace the '$' + IntToHex(
and the "nil"

That will affect display too.



Or in
TWatchesDlg.actCopyAddrExecute
de-parse the $ string.



Actually, when you make the feature request, should it be
- an extra menu entry
  - maybe if some of those many "copy..." entries are grouped into a sub menu...
     but that means more clicks to reach them.
  - maybe context menu with modifier key?
- an option to toggle the existing entry
- ?

440bx

  • Hero Member
  • *****
  • Posts: 5077
Re: FpDebug feature request on Copy
« Reply #2 on: January 31, 2025, 10:31:40 am »
It's great to have the code that needs to be changed.  I can change the version of Lazarus I'm using which spares me from having to configure a new/different version. :)  Thank you very much for that Martin.

Please report as a feature request.
Will do after posting this.

Actually, when you make the feature request, should it be
- an extra menu entry
  - maybe if some of those many "copy..." entries are grouped into a sub menu...
     but that means more clicks to reach them.
  - maybe context menu with modifier key?
- an option to toggle the existing entry
- ?
The thought of having the "copy" entries grouped into a submenu is unappealing because of the extra clicks needed and the fact that the options are not immediately visible.

I would prefer an additional entry or the option to toggle the operation of an existing entry, the "Copy RAW value" seems like a good candidate to me because I interpret "RAW" as being "unadorned".

Again, thank you.




ETA:

feature request: 41385
link: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41385
« Last Edit: January 31, 2025, 10:49:50 am by 440bx »
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10917
  • Debugger - SynEdit - and more
    • wiki
Re: FpDebug feature request on Copy
« Reply #3 on: January 31, 2025, 12:08:47 pm »
Maybe group some items into a submenu?

Like "Copy all", "Copy raw value", "Copy Data Address (raw)"

440bx

  • Hero Member
  • *****
  • Posts: 5077
Re: FpDebug feature request on Copy
« Reply #4 on: January 31, 2025, 02:08:56 pm »
Maybe group some items into a submenu?

Like "Copy all", "Copy raw value", "Copy Data Address (raw)"
Here is a thought...

Have all the "Copy" options grouped in a submenu _but_ any option that is eventually chosen from the submenu is, as a result of having been chosen, "promoted" to the higher level menu.  That way, the option(s) that are commonly used become available without having to constantly go into the submenu to get them.

How does that sound to you ?

One thought I really like is to allow up to 3 (or some other number) lines in the main popup menu for the common "Copy" options.  That way, the 3 most commonly (and/or recently) used copy options would be available without any additional clicks.  if a different option than the top 3 is later chosen from the submenu then that option would automatically replace the least used of the 3 primary options.  Basically, a dynamic list that combines "most used" with "most recently used".

All that said, I'll be perfectly happy with just having one additional line in the current popup menu. In that case, I'd like to have the option closer to the top of the list than the bottom.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018