Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tcf-dev] Setting break point programmatically
  • From: Gidi Gal <gidigal@xxxxxxxxxxx>
  • Date: Mon, 13 Jan 2020 18:43:30 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c0fnBeNS0x7t7jfiM8CU9wHYcCFwL4JE1owRjAbsU3U=; b=EodjyZF7QpXZfkKX/lZmFqbshKFAj5okEDsvgjB0BZnULxSTtz+sWW0p43gHEzr3mN3fdH8hoXQebpymYPBaZJXjtraLD0RHxkn+KdwqXuCeAYVr6pwMl/1M9zeOzngJwHqdwCgUdfLuVJDsviBuvygutDa+GcAI4/J/WkxE/gb+L1lSKalpPkvTnnK3jP7b2ewjBeZep1CQdueCBLnhTnpbB32G68Ll726zqJVlrd0siu+J8CPSkrfIZGz9k7ryQqjATSbYBEhYanDz8NCWaJ3MjYTMal3AHSaBIVsqgGlo6+DF6UwESj5J8XHHJxV3yUf73mNCAWwqd2U9FlY/Gg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ft46EJmjuQ25QsrOcJgNDhIRoycH1pcxAtMAH969tjm5CdkcCbstztGjHxXt49pYJ4QcYsojNRR0X58KjxyeeSZ2GsgW8Mk2CO5IuMHiixbvd7Rx5aBwqtpve3SqKkouS0CVedrkydzE7jln+Uh6v4ITPkByLNQaAkpGQTUphiZ4H8CiytEM0dDIbdXO7MaaJHK+0h5AvtNv1CCTw5w8LEBkvQQVaihPX36G4jqLyQ+JYJvNol/jP/03+j6ThJMMggSeyl0q85aK8IenugJLP7wydCTj5OSLLvkY4wqjQFEtcYVtqKd8h0gz0NU4ro/C4CaypyQ0XwShN2SYpXyIng==
  • Delivered-to: tcf-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/tcf-dev>
  • List-help: <mailto:tcf-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/tcf-dev>, <mailto:tcf-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/tcf-dev>, <mailto:tcf-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHVyj7dGyf4Iw5wVUyrH6mn0nNTaQ==
  • Thread-topic: Setting break point programmatically

Hello,

I am trying to add a break point using TCF API. Here is the code I am using :

private void createAnimBreakpointUsingTCF(final String sourceHandle, int line) {

         Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(IBreakpoints.PROP_FILE, sourceHandle);
         properties.put(IBreakpoints.PROP_TYPE, "Auto");
         properties.put(IBreakpoints.PROP_ID, UUID.randomUUID().toString());
         properties.put(IBreakpoints.PROP_LINE, line);
         properties.put(IBreakpoints.PROP_ENABLED, true);
         //m_animBreakpoint stores IBreakpoints service which is received from IChannel. The method is called after testing that the channel is in state IChannel.STATE_OPEN
         this.m_animBreakpoint = this.m_breakpoints.add(properties, new DoneCommand() {
                   @Override
                   public void doneCommand(IToken token, Exception error) {
                               if (error != null) {
                                     //TODO report error
                                     System.out.println("test");
                              }                                     
                    }         
          });
}

The breakpoint is not set correctly. When I look in its properties I see in the status page the report "Error: unresolved source line information".
When I add the break point manually, it is added successfully.
I tried to debug the manual addition of the break point, I don't see differences between the path to the path that I send in my code and the debugged path. I tried also this code, which is called higher in the call stack, in the process of manually adding a break point:

private void createAnimBreakpointUsingCDI(final String sourceHandle, final int line) {
             Display.getDefault().asyncExec(new Runnable() {
             @Override
              public void run() {
                           Map<String, Object> attributes = new HashMap<String, Object>();
                           ICLineBreakpoint lineBp = CDIDebugModel.createBlankLineBreakpoint();
                           CDIDebugModel.setLineBreakpointAttributes(attributes, sourceHandle, 0, line, true, 0, "" ); //$NON-NLS-1$
                           //The file in focus is not part of Eclipse project.
                           IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
                            try {
                                      CDIDebugModel.createBreakpointMarker(lineBp, root, attributes, true);
                            } catch (CoreException e) {
                                    e.printStackTrace();
                            }
               }
               });
}

The break point is added with an error icon near it, tool tip is showing the error: failed to plant: Unresolved source line information.

I'll try to build a small test that reproduces this issue. If you have any idea how to solve it, I'll be grateful for your reply.

Thanks,
Gidi


Back to the top