News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Copy Debug Watch variable content to clipboard

Started by rogeriodec, March 21, 2018, 03:19:30 PM

Previous topic - Next topic

rogeriodec

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

oBFusCATed

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!]

rogeriodec

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

oBFusCATed

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!]

rogeriodec

Windows 8.1

SVN 11400

AndrewCot

I have added support for copying watch data in my unofficial release, which you can read up on following thread:
https://forums.next.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.

cacb

Great work! Improving debugger capabilities is important IMHO.

ollydbg

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.

oBFusCATed

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!]

BlueHazzard

Quote from: oBFusCATed on August 08, 2021, 06:54:14 PM
I think this view should be removed in 2021.
What view?

Quote from: AndrewCot 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:
Can you post a patch on SF?

AndrewCot

@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

oBFusCATed

Quote from: BlueHazzard on August 08, 2021, 10:49:23 PM
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!]

AndrewCot