Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: rogeriodec 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?
-
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.
-
There is no "copy" option right clicking on watched variable as the attatched image.
Where can I find this option?
-
I guess the read only values cannot be copied.
You can post a request on the tickets sections about this.
-
Ticked opened: https://sourceforge.net/p/codeblocks/tickets/654/
-
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.
-
Great work! Improving debugger capabilities is important IMHO.
-
Great work!
-
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. :(
-
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?
-
@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
-
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).
-
Check out reply #5 above.