【问题标题】:How to get rid of Debug Current Instruction Pointer如何摆脱调试当前指令指针
【发布时间】:2012-02-06 19:23:06
【问题描述】:

当前指令指针..当我将调试器放在特定位置时,它会开始调试上一步,然后到达当前位置。调试器启动时,我可以在另一个位置看到带有调试器图标的当前指令指针。

请帮帮我,我这两天一直在努力摆脱它。

这是场景:

我已将调试器放在 viewattachment 上。它位于 openattachment 之后。 但是当我点击 openattachment 时,它开始被调试,然后当我点击 viewattachment 时,它开始调试..

为什么要打开附件?它对我来说是一个开销。有人可以帮我吗?

如果我的问题不清楚,请告诉我。

代码如下............

   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;
                }
            }
        }

【问题讨论】:

  • 这只是我遇到此问题的代码中的位置....我想知道如何删除当前位置指针..在放置断点时会调试其他行同班的其他地方.....

标签: eclipse


【解决方案1】:

只需右键单击源文件,您将在“执行”选项中选择该选项,当它运行时,在控制台窗口中您可以单击停止(红色按钮),这将删除“调试当前指令指针”

【讨论】:

    【解决方案2】:

    据我所知,在 Eclipse 中调试时不能移动当前位置。如果您更改了当前正在调试的方法的来源(并且热代码替换正在运行),调试器将返回到方法的开头以允许您继续使用更改后的方法执行。

    我仍然看不到“viewattachment”和“openattachment”在您提供的代码中的位置。

    我希望这能回答你的问题。

    【讨论】:

    • @FrancisUpton 我也被这个问题困住了,突出显示了一行,我不知道如何摆脱它。为什么它不消失?我没有调试任何东西。我一遍又一遍地关闭一切。我已经从 webapp 和 main 方法运行了这个类。我就是不明白。
    猜你喜欢
    • 1970-01-01
    • 2019-07-30
    • 2011-03-02
    • 1970-01-01
    • 2012-12-05
    • 1970-01-01
    • 2012-10-03
    • 2020-06-01
    • 1970-01-01
    相关资源
    最近更新 更多