我有一个申请MyApp.exe。MyAssembly1.dll此应用程序使用本身引用的程序集MyAssembly2.dll。在其中MyAssembly2,我有一个MyClass有方法的类MyMethod。在用户经历几个对话框等之后调用此方法。
如果我从 Windbg 中启动此应用程序,是否可以通过某种方式在此方法上放置断点?问题是我不知道MyAssembly2CLR 何时加载该方法并且该方法得到 JITted?
如果我运行下面调用 Test1() 的代码,VS2012 将在该行很好地中断并准确显示发生了什么。如果我注释掉 Test1 并放入 Test2,那么 try catch 不会停止在线,它只是将其注销到控制台。
我怎样才能让 VS2012 停止在错误行上,即使它被 try catch 语句包围?
private void Button_Click(object sender, RoutedEventArgs e)
{
//Test1(); // No try catch - stops on error line dividing by zero.
Test2(); // Try catch - Just writes out to console.
}
private void MakeError()
{
int i = -1;
i += 1;
int j = 1 / i;
Console.WriteLine(j.ToString());
}
void Test1()
{
Console.WriteLine("MakeError in Test1");
MakeError();
}
void Test2()
{
Console.WriteLine("MakeError in Test2"); …Run Code Online (Sandbox Code Playgroud) 有没有办法配置 IntelliJ Java 异常断点,使其仅在堆栈跟踪中的底层类是特定类时触发?例如,对于下面的堆栈跟踪,我只想在底行包含 class 时中断ComputeLCAInBinaryTreeSpec。
java.lang.IndexOutOfBoundsException: Index: 4, Size: 4
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at com.common.BinaryTreeNode.buildBinaryTree(BinaryTreeNode.groovy:62)
at com.common.BinaryTreeNode.buildBinaryTree(BinaryTreeNode.groovy:76)
at com.common.BinaryTreeNode.buildBinaryTrees_closure1(BinaryTreeNode.groovy:53)
at groovy.lang.Closure.call(Closure.java:426)
at com.common.BinaryTreeNode.buildBinaryTrees(BinaryTreeNode.groovy:51)
at com.elementsofprogramminginterviews.binarytrees.ComputeLCAInBinaryTreeSpec.computes LCA of two nodes of a binary tree_closure1(ComputeLCAInBinaryTreeSpec.groovy:65)
at groovy.lang.Closure.call(Closure.java:426)
at groovy.lang.Closure.call(Closure.java:442)
at com.elementsofprogramminginterviews.binarytrees.ComputeLCAInBinaryTreeSpec.computes LCA of two nodes of a binary tree(ComputeLCAInBinaryTreeSpec.groovy:47)
Run Code Online (Sandbox Code Playgroud) java breakpoints exception intellij-idea conditional-statements
使用 Microsoft Visual Studio Professional 2019 版本 16.4.2
解决方案配置设置为“调试”,
在“项目属性”->“构建 - 优化代码”下未选中
“高级构建设置”->“调试信息”设置为“完整”
步骤:
1. 清理解决方案
2. 重建解决方案
3. 发布适当的项目
4. IISReset
5. 附加到进程 (w3wp.exe)
在“调试”->“Windows”->“模块”中验证 dll 的“符号已加载”。
我可以在某些行上设置断点,但不能在其他行上设置断点。
得到:
“断点绑定失败”
在代码的下一行,可以设置断点并且它可以工作(并中断)。
另外,当我在下一行中断并尝试使用 Quick Watch on 时billingAmountsDue,accountNumbers或者User我得到:
“无法获取局部变量或参数的值,因为它在此指令指针处不可用,可能是因为它已被优化掉。”
public IEnumerable<Account> GetAllAccounts()
{
var user = GetCurrentUser(); //Breakpoint doesn't work on these 3 lines
var accountNumbers = GetAccountNumbersForUser(user);
var billingAmountsDue = AsyncHelpers.RunSync(() => _billingService.GetBillingForAccounts(accountNumbers.ToArray()));
//Breakpoint on following line works
var accounts = user.Accounts.Join(billingAmountsDue, b => …Run Code Online (Sandbox Code Playgroud) 我尝试运行一个未在gdbLinux 中使用 -g 选项编译的程序(例如 /bin/ls)。gdb运行该程序(顺便说一句,lldb不运行)。我想知道是否可以通过机器指令单步执行程序si(原则上我不明白为什么不可以)。但问题是:如何设置断点?如果您只是运行该程序,它就会执行并退出。
如何更改网站JavaScript代码中的变量值?
我想知道,因为我现在正在建立一个网站,作为代码的一部分,我有一个变量,其价值对网站的功能有重要影响.因此,我希望知道某人如何能够改变这一价值(即使它只影响该用户所看到的网站).
我对学习如何在Google Chrome中执行此操作特别感兴趣.
javascript debugging google-chrome breakpoints google-chrome-devtools
我正在写我的字符串类版本,当我尝试重载+运算符时,析构函数会在程序执行时触发断点
功能:
String operator+(const String & s, const String & st)
{
int k = s.len + st.len + 1;
char* x = new char[k];
x = s.str;
for (int i = 0, j = k - st.len - 1; j < k; j++, i++)
{
x[j] = st.str[i];
}
return String(x);
}
Run Code Online (Sandbox Code Playgroud)
析构函数:
String::~String()
{
delete[] str;
}
Run Code Online (Sandbox Code Playgroud)
主要:
int main()
{
String x("cos");
String y("cos");
String z = x + y;
std::cout << z;
}
Run Code Online (Sandbox Code Playgroud)
感谢帮助