Menu

#654 Copy Debug Watch variable content to clipboard

Undefined
fixed
debugger (23)
Feature_Request
2022-06-16
2018-03-28
Rogerio
No

Like said in http://forums.codeblocks.org/index.php/topic,22513.0.html, 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.

Discussion

  • Teodor Petrov

    Teodor Petrov - 2018-03-30
    • labels: --> debugger
     
  • Andrew Cottrell

    Andrew Cottrell - 2021-08-10

    see the forum reply #5 for working changes as per the code in the following Github branch:
    https://github.com/acotty/codeblocks_sf/tree/AC-WatchsCopyData

     
  • Andrew Cottrell

    Andrew Cottrell - 2022-02-22

    Patch to allow copying watch data.

     
  • Tiger Beard

    Tiger Beard - 2022-05-14

    ++

     
  • Andrew Cottrell

    Andrew Cottrell - 2022-06-12

    Any chance that anyone is going to have a look at the patch from 22-FEB-2022 above?

     
  • bluehazzard

    bluehazzard - 2022-06-12

    If a apply this patch and copy and paste data, after ending debugging and at closing codeblocks i got this backtrace:

    #0 0x7ffa46d9aac1   wxAuiManager::Repaint(wxDC*) () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #1 0x7ffa4673301f   wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const() ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #2 0x7ffa4687daa4   wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #3 0x7ffa4687dc4b   wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #4 0x7ffa4687e2f0   wxEvtHandler::TryHereOnly(wxEvent&) () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #5 0x7ffa4687dd63   wxEvtHandler::DoTryChain(wxEvent&) () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #6 0x7ffa4687e452   wxEvtHandler::ProcessEvent(wxEvent&) () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #7 0x7ffa4687ffdc   wxEvtHandler::SafelyProcessEvent(wxEvent&) () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #8 0x7ffa46975001   wxWindow::HandleActivate(int, bool, HWND__*) () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #9 0x7ffa46985415   wxWindow::MSWHandleMessage(long long*, unsigned int, unsigned long long, long long) () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #10 0x7ffa469709ff  wxWindow::MSWWindowProc(unsigned int, unsigned long long, long long) () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #11 0x7ffb032be858  USER32!CallWindowProcW() (C:\Windows\System32\user32.dll:??)
    #12 0x7ffb032be3dc  USER32!DispatchMessageW() (C:\Windows\System32\user32.dll:??)
    #13 0x7ffb032d0bc3  USER32!SendMessageTimeoutW() (C:\Windows\System32\user32.dll:??)
    #14 0x7ffb03f30b74  ntdll!KiUserCallbackDispatcher() (C:\Windows\SYSTEM32\ntdll.dll:??)
    #15 0x7ffb01cb1a64  win32u!NtUserSetFocus() (C:\Windows\System32\win32u.dll:??)
    #16 0x7ffa4697a392  wxWindow::SetFocus() () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #17 0x7ffa46e08d4d  wxPropertyGrid::SetFocusOnCanvas() () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #18 0x7ffa46e08e45  wxPropertyGrid::FreeEditors() () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #19 0x7ffa46e12ae5  wxPropertyGrid::DoSelectProperty(wxPGProperty*, unsigned int) () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #20 0x7ffa46e17a88  wxPropertyGrid::~wxPropertyGrid() () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #21 0x7ffa46e1851e  wxPropertyGrid::~wxPropertyGrid() () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #22 0x7ffa46b949cd  wxWindowBase::Destroy() () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #23 0x7ffa46b94ae4  wxWindowBase::DestroyChildren() () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #24 0x7ffa4697f50b  wxWindow::~wxWindow() () ( wxWidgets-3.1.5_msys2\lib\gcc_dll\wxmsw315u_gcc_custom.dll:??)
    #25 0x7ff6b6e64b7c  wxNavigationEnabled<wxWindow>::~wxNavigationEnabled(this=0x1baf3d7ae20, __in_chrg=<optimized out>) ( wxWidgets-3.1.5_msys2\include\wx\containr.h:189)
    #26 0x7ff6b6e5349a  wxPanelBase::~wxPanelBase(this=0x1baf3d7ae20, __in_chrg=<optimized out>) ( wxWidgets-3.1.5_msys2\include\wx\panel.h:30)
    #27 0x7ff6b6e6fc6a  wxPanel::~wxPanel(this=0x1baf3d7ae20, __in_chrg=<optimized out>) ( wxWidgets-3.1.5_msys2\include\wx\msw\panel.h:19)
    #28 0x7ff6b6e505e0  WatchesDlg::~WatchesDlg(this=0x1baf3d7ae20, __in_chrg=<optimized out>) (codeblocks\src\src\watchesdlg.h:22)
    #29 0x7ff6b6e50565  WatchesDlg::~WatchesDlg(this=0x1baf3d7ae20, __in_chrg=<optimized out>) (codeblocks\src\src\watchesdlg.h:22)
    

    windows 10

     
  • Andrew Cottrell

    Andrew Cottrell - 2022-06-12

    Thanks very much for the crash report. I will need to figure out what is causing it as I did not see any crashes when I was making the changes.

    Are you using wx 3.1.5 or 3.1.6 or 3.1.7? This way if I cannot see it with 3.1.7 I will try the same version.

     
    • Andrew Cottrell

      Andrew Cottrell - 2022-06-13

      I have reworked the code to remove the return's in the clipboard code so that the wxTheClipboard->Close(); is always called if the wxTheClipboard->Open() is true. These changes do not fix the crash, but with these changes the code is more clipboard compliant.

      I tested on wx 3.1.7 and got the crash.
      I went back to wx 3.1.5 and no crash.... No code changes, apart from using 3.1.5....
      Later today I will check with 3.1.6.

      I could not see anything in the changes that should or possible could cause any crashes on exit.

       
  • bluehazzard

    bluehazzard - 2022-06-12

    wx 3.1.5 compiled with msys

     
    • Andrew Cottrell

      Andrew Cottrell - 2022-06-13

      Thanks for the info. I have created ticket [#1276] to track the crash as I have been able to crash the existing nightly svn-r12829 build and as such the patch is not the cause of the crash, but it made it easier to find.

      Attached is v2 of the patch so that wxTheClipboard->Close(); is always called if the wxTheClipboard->Open() is true.

       

      Related

      Tickets: #1276

  • bluehazzard

    bluehazzard - 2022-06-16
    • status: open --> fixed
    • assigned_to: bluehazzard
     
  • bluehazzard

    bluehazzard - 2022-06-16

    Applied in [r12838] with some modifications:
    1) Naming functions with On prefix
    2) Showing menu entries only if they make sense... If no value present it makes no sense to copy value, same if watch has no children it makes no sense to show copy tree

    thank you a lot!

     

    Related

    Commit: [r12838]


    Last edit: bluehazzard 2022-06-16
    • Andrew Cottrell

      Andrew Cottrell - 2022-06-16

      Thanks for taking the time to test the change, make the changes and apply them.

       

Log in to post a comment.