我正在使用WF4活动设计器调试工作流程。使用设计器进行调试,如何在运行时访问工作流实例状态以检查变量值?
例如,如何在以下屏幕中检查bool softwareFlashRequired的值:
非常感谢任何帮助!感谢。
答案 0 :(得分:0)
我创建了一个CodeActivity,它接受变量,然后在其中有一个断点。您可以使用预处理器打开和关闭断点。例如:example.cpp
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/xmemory0(840): error C2280: 'std::unique_ptr<int,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)': attempting to reference a deleted function
with
[
_Ty=int
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/memory(1857): note: see declaration of 'std::unique_ptr<int,std::default_delete<_Ty>>::unique_ptr'
with
[
_Ty=int
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/xmemory0(959): note: see reference to function template instantiation 'void std::allocator<_Other>::construct<_Objty,const std::unique_ptr<int,std::default_delete<_Ty>>&>(_Objty *,const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' being compiled
with
[
_Other=std::_List_node<std::unique_ptr<int,std::default_delete<int>>,void *>,
_Objty=std::unique_ptr<int,std::default_delete<int>>,
_Ty=int
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/xmemory0(959): note: see reference to function template instantiation 'void std::allocator<_Other>::construct<_Objty,const std::unique_ptr<int,std::default_delete<_Ty>>&>(_Objty *,const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' being compiled
with
[
_Other=std::_List_node<std::unique_ptr<int,std::default_delete<int>>,void *>,
_Objty=std::unique_ptr<int,std::default_delete<int>>,
_Ty=int
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/xmemory0(1097): note: see reference to function template instantiation 'void std::allocator_traits<_Alloc>::construct<_Ty,const std::unique_ptr<int,std::default_delete<int>>&>(std::allocator<_Other> &,_Objty *,const std::unique_ptr<int,std::default_delete<int>> &)' being compiled
with
[
_Alloc=std::allocator<std::_List_node<std::unique_ptr<int,std::default_delete<int>>,void *>>,
_Ty=std::unique_ptr<int,std::default_delete<int>>,
_Other=std::_List_node<std::unique_ptr<int,std::default_delete<int>>,void *>,
_Objty=std::unique_ptr<int,std::default_delete<int>>
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/xmemory0(1096): note: see reference to function template instantiation 'void std::allocator_traits<_Alloc>::construct<_Ty,const std::unique_ptr<int,std::default_delete<int>>&>(std::allocator<_Other> &,_Objty *,const std::unique_ptr<int,std::default_delete<int>> &)' being compiled
with
[
_Alloc=std::allocator<std::_List_node<std::unique_ptr<int,std::default_delete<int>>,void *>>,
_Ty=std::unique_ptr<int,std::default_delete<int>>,
_Other=std::_List_node<std::unique_ptr<int,std::default_delete<int>>,void *>,
_Objty=std::unique_ptr<int,std::default_delete<int>>
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/list(853): note: see reference to function template instantiation 'void std::_Wrap_alloc<std::allocator<_Other>>::construct<_Ty,const std::unique_ptr<int,std::default_delete<int>>&>(_Ty *,const std::unique_ptr<int,std::default_delete<int>> &)' being compiled
with
[
_Other=std::_List_node<std::unique_ptr<int,std::default_delete<int>>,void *>,
_Ty=std::unique_ptr<int,std::default_delete<int>>
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/list(851): note: see reference to function template instantiation 'void std::_Wrap_alloc<std::allocator<_Other>>::construct<_Ty,const std::unique_ptr<int,std::default_delete<int>>&>(_Ty *,const std::unique_ptr<int,std::default_delete<int>> &)' being compiled
with
[
_Other=std::_List_node<std::unique_ptr<int,std::default_delete<int>>,void *>,
_Ty=std::unique_ptr<int,std::default_delete<int>>
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/list(1086): note: see reference to function template instantiation 'std::_List_node<std::unique_ptr<int,std::default_delete<_Ty>>,void *> *std::_List_buy<std::unique_ptr<_Ty,std::default_delete<_Ty>>,_Alloc>::_Buynode<const std::unique_ptr<_Ty,std::default_delete<_Ty>>&>(std::_List_node<std::unique_ptr<_Ty,std::default_delete<_Ty>>,void *> *,std::_List_node<std::unique_ptr<_Ty,std::default_delete<_Ty>>,void *> *,const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' being compiled
with
[
_Ty=int,
_Alloc=std::allocator<std::unique_ptr<int,std::default_delete<int>>>
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/list(1085): note: see reference to function template instantiation 'std::_List_node<std::unique_ptr<int,std::default_delete<_Ty>>,void *> *std::_List_buy<std::unique_ptr<_Ty,std::default_delete<_Ty>>,_Alloc>::_Buynode<const std::unique_ptr<_Ty,std::default_delete<_Ty>>&>(std::_List_node<std::unique_ptr<_Ty,std::default_delete<_Ty>>,void *> *,std::_List_node<std::unique_ptr<_Ty,std::default_delete<_Ty>>,void *> *,const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' being compiled
with
[
_Ty=int,
_Alloc=std::allocator<std::unique_ptr<int,std::default_delete<int>>>
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/list(1463): note: see reference to function template instantiation 'void std::list<std::unique_ptr<int,std::default_delete<_Ty>>,std::allocator<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>::_Insert<const std::unique_ptr<_Ty,std::default_delete<_Ty>>&>(std::_List_unchecked_const_iterator<std::_List_val<std::_List_simple_types<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>,std::_Iterator_base0>,const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' being compiled
with
[
_Ty=int
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/list(1463): note: see reference to function template instantiation 'void std::list<std::unique_ptr<int,std::default_delete<_Ty>>,std::allocator<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>::_Insert<const std::unique_ptr<_Ty,std::default_delete<_Ty>>&>(std::_List_unchecked_const_iterator<std::_List_val<std::_List_simple_types<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>,std::_Iterator_base0>,const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' being compiled
with
[
_Ty=int
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/list(1423): note: see reference to function template instantiation 'void std::list<std::unique_ptr<int,std::default_delete<_Ty>>,std::allocator<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>::_Insert_range<_Iter>(std::_List_unchecked_const_iterator<std::_List_val<std::_List_simple_types<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>,std::_Iterator_base0>,_Iter,_Iter,std::forward_iterator_tag)' being compiled
with
[
_Ty=int,
_Iter=std::_List_const_iterator<std::_List_val<std::_List_simple_types<std::unique_ptr<int,std::default_delete<int>>>>>
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/list(1422): note: see reference to function template instantiation 'void std::list<std::unique_ptr<int,std::default_delete<_Ty>>,std::allocator<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>::_Insert_range<_Iter>(std::_List_unchecked_const_iterator<std::_List_val<std::_List_simple_types<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>,std::_Iterator_base0>,_Iter,_Iter,std::forward_iterator_tag)' being compiled
with
[
_Ty=int,
_Iter=std::_List_const_iterator<std::_List_val<std::_List_simple_types<std::unique_ptr<int,std::default_delete<int>>>>>
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/list(939): note: see reference to function template instantiation 'std::_List_iterator<std::_List_val<std::_List_simple_types<std::unique_ptr<int,std::default_delete<_Ty>>>>> std::list<std::unique_ptr<_Ty,std::default_delete<_Ty>>,std::allocator<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>::insert<std::_List_const_iterator<std::_List_val<std::_List_simple_types<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>>>(std::_List_const_iterator<std::_List_val<std::_List_simple_types<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>>,_Iter,_Iter)' being compiled
with
[
_Ty=int,
_Iter=std::_List_const_iterator<std::_List_val<std::_List_simple_types<std::unique_ptr<int,std::default_delete<int>>>>>
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/list(939): note: see reference to function template instantiation 'std::_List_iterator<std::_List_val<std::_List_simple_types<std::unique_ptr<int,std::default_delete<_Ty>>>>> std::list<std::unique_ptr<_Ty,std::default_delete<_Ty>>,std::allocator<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>::insert<std::_List_const_iterator<std::_List_val<std::_List_simple_types<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>>>(std::_List_const_iterator<std::_List_val<std::_List_simple_types<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>>,_Iter,_Iter)' being compiled
with
[
_Ty=int,
_Iter=std::_List_const_iterator<std::_List_val<std::_List_simple_types<std::unique_ptr<int,std::default_delete<int>>>>>
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/list(935): note: while compiling class template member function 'std::list<std::unique_ptr<int,std::default_delete<_Ty>>,std::allocator<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>::list(const std::list<std::unique_ptr<_Ty,std::default_delete<_Ty>>,std::allocator<std::unique_ptr<_Ty,std::default_delete<_Ty>>>> &)'
with
[
_Ty=int
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/xmemory0(840): note: see reference to function template instantiation 'std::list<std::unique_ptr<int,std::default_delete<_Ty>>,std::allocator<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>::list(const std::list<std::unique_ptr<_Ty,std::default_delete<_Ty>>,std::allocator<std::unique_ptr<_Ty,std::default_delete<_Ty>>>> &)' being compiled
with
[
_Ty=int
]
<source>(10): note: see reference to class template instantiation 'std::list<std::unique_ptr<int,std::default_delete<_Ty>>,std::allocator<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>' being compiled
with
[
_Ty=int
]
/opt/compiler-explorer/windows/19.10.25017/lib/native/include/memory(1857): note: 'std::unique_ptr<int,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)': function was explicitly deleted
with
[
_Ty=int
]
Microsoft (R) C/C++ Optimizing Compiler Version 19.10.25017 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
Compiler exited with result code 2
我把活动放到了工作流程之前。
为了便于在工作流程中使用,我将所有变量放在容器中,这样我的Debug CodeActivity只需要有一个InArgument,在断点处你可以看到所有变量的状态。