From 3c358547a99147b8477a5b1632cae0c740e452a8 Mon Sep 17 00:00:00 2001 From: Eugene Tarassov Date: Wed, 12 Aug 2020 17:22:38 -0700 Subject: Bug 565993 - Modules view with dedicated module name column --- .../debug/ui/model/TCFColumnPresentationModules.java | 6 +++++- .../eclipse/tcf/internal/debug/ui/model/TCFNodeModule.java | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFColumnPresentationModules.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFColumnPresentationModules.java index 788634f3e..9e22536ff 100644 --- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFColumnPresentationModules.java +++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFColumnPresentationModules.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Wind River Systems, Inc. and others. + * Copyright (c) 2011-2020 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -26,6 +26,7 @@ public class TCFColumnPresentationModules implements IColumnPresentation { */ public static final String COL_NAME = "Name", + COL_FILE = "File", COL_ADDRESS = "Address", COL_SIZE = "Size", COL_FLAGS = "Flags", @@ -34,6 +35,7 @@ public class TCFColumnPresentationModules implements IColumnPresentation { private static String[] cols_all = { COL_NAME, + COL_FILE, COL_ADDRESS, COL_SIZE, COL_FLAGS, @@ -42,6 +44,7 @@ public class TCFColumnPresentationModules implements IColumnPresentation { }; private static String[] headers = { + "Name", "File Name", "Address", "Size", @@ -52,6 +55,7 @@ public class TCFColumnPresentationModules implements IColumnPresentation { private static String[] cols_ini = { COL_NAME, + COL_FILE, COL_ADDRESS, COL_SIZE }; diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeModule.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeModule.java index e7c455e21..52844a95d 100644 --- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeModule.java +++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeModule.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2015 Wind River Systems, Inc. and others. + * Copyright (c) 2011-2020 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -76,9 +76,19 @@ public class TCFNodeModule extends TCFNode implements IDetailsProvider { update.setLabel(r.getFileName(), 0); } else { - for (int i=0; i < col_ids.length; ++i) { + for (int i = 0; i < col_ids.length; i++) { String col_id = col_ids[i]; if (TCFColumnPresentationModules.COL_NAME.equals(col_id)) { + String name = r.getFileName(); + if (name != null) { + int j0 = name.lastIndexOf('/'); + int j1 = name.lastIndexOf('\\'); + if (j0 > j1) name = name.substring(j0 + 1); + else if (j0 < j1) name = name.substring(j1 + 1); + } + update.setLabel(name, i); + } + else if (TCFColumnPresentationModules.COL_FILE.equals(col_id)) { update.setLabel(r.getFileName(), i); } else if (TCFColumnPresentationModules.COL_ADDRESS.equals(col_id)) { -- cgit v1.2.3