Author Topic: Copy Debug Watch variable content to clipboard  (Read 9801 times)

Offline rogeriodec

  • Multiple posting newcomer
  • *
  • Posts: 50
Copy Debug Watch variable content to clipboard
« on: March 21, 2018, 03:19:30 pm »
It is often interesting to get values that appear in "Watches" to do external calculations.
However it does not seem possible to use Ctrl + C to copy these values.
Is there any way to copy these values to the clipboard?
Windows 8.1

SVN 11400

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Copy Debug Watch variable content to clipboard
« Reply #1 on: March 21, 2018, 03:59:43 pm »
Have you tried Right click -> Copy?
The global ctrl-c is used for accelerator for the editor and so it is not really possible to use it in other windows.
This is how things worked in wxWidgets the last time I've investigated this.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline rogeriodec

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: Copy Debug Watch variable content to clipboard
« Reply #2 on: March 21, 2018, 04:46:46 pm »
There is no "copy" option right clicking on watched variable as the attatched image.
Where can I find this option?
Windows 8.1

SVN 11400

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Copy Debug Watch variable content to clipboard
« Reply #3 on: March 21, 2018, 05:10:18 pm »
I guess the read only values cannot be copied.
You can post a request on the tickets sections about this.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline rogeriodec

  • Multiple posting newcomer
  • *
  • Posts: 50
Windows 8.1

SVN 11400

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: Copy Debug Watch variable content to clipboard
« Reply #5 on: August 07, 2021, 11:43:50 am »
I have added support for copying watch data in my unofficial release, which you can read up on following thread:
https://forums.codeblocks.org/index.php/topic,24592.0.html

An example of the copied data for a wxString  example is:
"Copy data to clipboard"
0x25b21e4a4a0 L"ConfigurationName1 : %s"

"Copy row to clipboard"
[symbol =_M_p] , [value =0x25b21e4a4a0 L"ConfigurationName1 : %s"]


"Copy tree to clipboard"
[symbol =test1]
[value =]
[children = 3]
[child 0]
    [symbol =static npos]
    [value =18446744073709551615]
[child 1]
    [symbol =m_impl]
    [value =]
    [children = 4]
    [child 0]
        [symbol =static npos]
        [value =18446744073709551615]
    [child 1]
        [symbol =_M_dataplus]
        [value =]
        [children = 2]
        [child 0]
            [symbol =<std::allocator<wchar_t>>]
            [value =]
            [children = 2]
            [child 0]
                [symbol =<__gnu_cxx::new_allocator<wchar_t>>]
                [value =]
                [children = 1]
                [child 0]
                    [symbol =[0]]
                    [value =<No data fields>]
            [child 1]
                [symbol =[1]]
                [value =<No data fields>]
        [child 1]
            [symbol =_M_p]
            [value =0x25b21e4a4a0 L"ConfigurationName1 : %s"]
    [child 2]
        [symbol =_M_string_length]
        [value =23]
    [child 3]
        [symbol =[3]]
        [value =]
        [children = 2]
        [child 0]
            [symbol =_M_local_buf]
            [value =L"\027\000\000\000\250\024\x1c2e\375\177"]
        [child 1]
            [symbol =_M_allocated_capacity]
            [value =23]
[child 2]
    [symbol =m_convertedToChar]
    [value =]
    [children = 2]
    [child 0]
        [symbol =m_str]
        [value =0x0]
    [child 1]
        [symbol =m_len]
        [value =0]
--------------------


Attached is the updated context menu.

Offline cacb

  • Lives here!
  • ****
  • Posts: 539
Re: Copy Debug Watch variable content to clipboard
« Reply #6 on: August 07, 2021, 01:33:56 pm »
Great work! Improving debugger capabilities is important IMHO.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6035
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Copy Debug Watch variable content to clipboard
« Reply #7 on: August 07, 2021, 02:17:12 pm »
Great work!
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Copy Debug Watch variable content to clipboard
« Reply #8 on: August 08, 2021, 06:54:14 pm »
I think this view should be removed in 2021. In 2009 it was useful when I was working on the watches dlg, but in 2021 is more than useless. :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Copy Debug Watch variable content to clipboard
« Reply #9 on: August 08, 2021, 10:49:23 pm »
I think this view should be removed in 2021.
What view?

I have added support for copying watch data in my unofficial release, which you can read up on following thread:
Can you post a patch on SF?

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: Copy Debug Watch variable content to clipboard
« Reply #10 on: August 09, 2021, 12:45:04 am »
@BlueHazzard Sorry for this rant (which is not your fault) as I have noticed that if your not in the IN crowd the SF tickets patches is allot of cases go no where or you have to jump through so many crazy hoops that people give up or they are not looked at or ignored or etc , so I upload a patch will get  get looked at?

If you have a Github branch I can create a PR from my https://github.com/acotty/codeblocks_sf/tree/AC-WatchsCopyData branch to it so you can look at it. If I put a PR to your master it shows 7 files changes, as your master is not up to date.


The changed files are:
    src/src/watchesdlg.cpp
    src/src/watchesdlg.h

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Copy Debug Watch variable content to clipboard
« Reply #11 on: August 09, 2021, 08:47:48 am »
What view?
The view used to implement the copy function. It it shown by pressing the [...] button in the watch (I can never remember if pressing ctrl or shitf is required, see the tooltip).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: Copy Debug Watch variable content to clipboard
« Reply #12 on: August 10, 2021, 01:03:03 pm »
Check out reply #5 above.