eclipse 如何摆脱调试当前指令指针
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8581892/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get rid of Debug Current Instruction Pointer
提问by Deepmala
Current Instruction Pointer..When I put debugger on a particular location it starts debugging its previous step and then comes to the current location. I can see Current Instruction Pointer with the debugger icon on the another location while the debugger starts.
当前指令指针..当我将调试器放在特定位置时,它开始调试其上一步,然后到达当前位置。调试器启动时,我可以在另一个位置看到带有调试器图标的当前指令指针。
Please help me I have been trying to get rid of it for last two days.
请帮助我,我过去两天一直在努力摆脱它。
This is the scenario:
这是场景:
I have put the debugger on viewattachment.which comes after openattachment. But when I click on openattachmentthis starts getting debugged and then when I click the viewattachmentthe debugging starts for it..
我已经把调试器上viewattachment后。其中谈到openattachment。但是当我点击openattachment 时,它开始被调试,然后当我点击viewattachment时,它开始调试..
Why is it going to openattachment? Its a overhead for me. can anyone help me on it?
为什么要打开附件?这对我来说是开销。有人可以帮我吗?
Please let me know if my question is not clear.
如果我的问题不清楚,请告诉我。
The code is as under..........
代码如下......
else if (getParameters().get("type") != null && getParameters().get("type")[0].equals("**viewattachment**")){
String elementUid = getParameters().get("elementUid")[0];
String target = "failure";
JSONObject obj = new JSONObject();
if (!isUserLoggedIn()){
target="session";
obj.put("result", target);
}
else{
if (!isValidUid(cardUid) || !isValidUid(elementUid)){
//return "fail";
obj.put("result", "fail");
}
else {
setMessages(msgService.WSIGetAttachments(elementUid));
if (!isAccountManager()) {
Message msg = getMessages().get(0);
HttpServletResponse response = ServletActionContext.getResponse();
try{
response.getOutputStream().print(obj.toString());
}
catch(IOException e){
log.error(e);
}
response.setContentType(msg.getAttachmentcontentType());
response.setHeader("filename", msg.getAttachmentName());
response.getWriter().print(obj);
response.getWriter().flush();
response.getWriter().close();
}
return null;
}
}
}
else if (getParameters().get("type") != null && getParameters().get("type")[0].equals("**openattachment**")){
String elementUid = getParameters().get("elementUid")[0];
if (elementUid != null) {//Conversion detail request
JSONArray array = new JSONArray();
JSONObject obj = new JSONObject();
if (!isValidUid(elementUid)){
obj.put("result", "fail");
obj.put("message", "Not a valid element");
}
else{
setMessages(msgService.WSIGetAttachments(elementUid));
obj.put("result","success");
if (getMessages() != null && getMessages().size() > 0){
for (Message m : getMessages()){
JSONObject obj1 = new JSONObject();
obj1.put("attachmentname", m.getAttachmentName());
obj1.put("elementUid", m.getElementUID());
array.add(obj1);
}
}
obj.put("messages", array);
HttpServletResponse httpResponse = ServletActionContext.getResponse();
try{
httpResponse.getOutputStream().print(obj.toString());
}
catch(IOException e){
log.error(e);
}
return null;
}
}
}
回答by tharani dharan
just right click on the source file and you will fine a "Execute" option choose that , as it runs , in the console window you can click on the stop (red button) this will remove "Debug Current Instruction Pointer"
只需右键单击源文件,您就可以选择“执行”选项,当它运行时,在控制台窗口中您可以单击停止(红色按钮)这将删除“调试当前指令指针”
回答by Francis Upton IV
As far as I know, you cannot move the current location when you are debugging in Eclipse. If you change the source of the method (and hot code replace is working) that is currently being debugged, the debugger will go back to the beginning of the method to allow you to continue execution with the changed method.
据我所知,在 Eclipse 中调试时不能移动当前位置。如果您更改当前正在调试的方法的源(并且热代码替换正在运行),调试器将返回到方法的开头,以允许您继续使用更改后的方法执行。
I still don't see where "viewattachment" and "openattachment" are in the code you have provided.
我仍然没有看到您提供的代码中的“viewattachment”和“openattachment”在哪里。
I hope this answers your question.
我希望这回答了你的问题。