From e8294e869978acb20e1f5636afb9d184d522fa6d Mon Sep 17 00:00:00 2001 From: Fredrik Osterlind Date: Fri, 9 Mar 2012 14:57:21 +0100 Subject: [PATCH] added objcopy external tools configuration changed nm command to sort numerically, and changed regexpressions to accept output from newer gcc versions added more debugging info under help menu --- platform/cooja/Makefile.cooja | 6 ++--- .../cooja/config/external_tools_win32.config | 11 ++++---- tools/cooja/java/se/sics/cooja/GUI.java | 27 ++++++++++++------- .../se/sics/cooja/dialogs/CompileContiki.java | 1 + 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/platform/cooja/Makefile.cooja b/platform/cooja/Makefile.cooja index e79fdbf1b..d4e80f182 100644 --- a/platform/cooja/Makefile.cooja +++ b/platform/cooja/Makefile.cooja @@ -106,9 +106,9 @@ ifdef SYMBOLS endif ## SYMBOLS ifdef REDEF_PRINTF @echo Redefining printf - -$(foreach OBJ,$^, objcopy --redefine-sym printf=log_printf $(OBJ); ) - -$(foreach OBJ,$^, objcopy --redefine-sym puts=log_puts $(OBJ); ) - -$(foreach OBJ,$^, objcopy --redefine-sym putchar=log_putchar $(OBJ); ) + -$(foreach OBJ,$^, $(OBJCOPY) --redefine-sym printf=log_printf $(OBJ); ) + -$(foreach OBJ,$^, $(OBJCOPY) --redefine-sym puts=log_puts $(OBJ); ) + -$(foreach OBJ,$^, $(OBJCOPY) --redefine-sym putchar=log_putchar $(OBJ); ) endif ## REDEF_PRINTF $(LINK_COMMAND_1) $^ $(LINK_COMMAND_2) diff --git a/tools/cooja/config/external_tools_win32.config b/tools/cooja/config/external_tools_win32.config index dd0477ec9..c35ab48cb 100644 --- a/tools/cooja/config/external_tools_win32.config +++ b/tools/cooja/config/external_tools_win32.config @@ -6,6 +6,7 @@ PATH_AR=ar PATH_SHELL = sh PATH_C_COMPILER = gcc PATH_OBJDUMP=objdump +PATH_OBJCOPY=objcopy OBJDUMP_ARGS=-h CMD_GREP_PROCESSES = grep '^PROCESS_THREAD[ ]*([^,]*,[^,]*,[^)]*)' -o -d skip -D skip -H -r REGEXP_PARSE_PROCESSES = ([^/]*.c):PROCESS_THREAD[ ]*\\(([^,]*),[^,]*,[^)]*\\) @@ -24,7 +25,7 @@ PATH_JAVAC = javac DEFAULT_PROJECTDIRS = [CONTIKI_DIR]/tools/cooja/apps/mrm;[CONTIKI_DIR]/tools/cooja/apps/mspsim;[CONTIKI_DIR]/tools/cooja/apps/avrora;[CONTIKI_DIR]/tools/cooja/apps/serial_socket;[CONTIKI_DIR]/tools/cooja/apps/collect-view PARSE_WITH_COMMAND = true -PARSE_COMMAND=nm -C $(LIBFILE) +PARSE_COMMAND=nm -n -C $(LIBFILE) MAPFILE_DATA_START = ^.data[ \t]*0x([0-9A-Fa-f]*)[ \t]*0x[0-9A-Fa-f]*[ \t]*$ MAPFILE_DATA_SIZE = ^.data[ \t]*0x[0-9A-Fa-f]*[ \t]*0x([0-9A-Fa-f]*)[ \t]*$ MAPFILE_BSS_START = ^.bss[ \t]*0x([0-9A-Fa-f]*)[ \t]*0x[0-9A-Fa-f]*[ \t]*$ @@ -35,7 +36,7 @@ MAPFILE_VAR_ADDRESS_2 = [ \t]*$ MAPFILE_VAR_SIZE_1 = ^ MAPFILE_VAR_SIZE_2 = [ \t]*(0x[0-9A-Fa-f]*)[ \t]*[^ ]*[ \t]*$ COMMAND_VAR_NAME_ADDRESS = ^([0-9A-Fa-f][0-9A-Fa-f]*)[ \t][^Tt][ \t]([^ ._][^ ]*) -COMMAND_DATA_START = ^([0-9A-Fa-f]*)[ \t]D[ \t]_data_start__$ -COMMAND_DATA_END = ^([0-9A-Fa-f]*)[ \t]D[ \t]_data_end__$ -COMMAND_BSS_START = ^([0-9A-Fa-f]*)[ \t]B[ \t]_bss_start__$ -COMMAND_BSS_END = ^([0-9A-Fa-f]*)[ \t]B[ \t]_bss_end__$ +COMMAND_DATA_START = ^([0-9A-Fa-f]*)[ \t]D[ \t].*_data_start__$ +COMMAND_DATA_END = ^([0-9A-Fa-f]*)[ \t]D[ \t].*_data_end__$ +COMMAND_BSS_START = ^([0-9A-Fa-f]*)[ \t]B[ \t].*_bss_start__$ +COMMAND_BSS_END = ^([0-9A-Fa-f]*)[ \t]B[ \t].*_bss_end__$ diff --git a/tools/cooja/java/se/sics/cooja/GUI.java b/tools/cooja/java/se/sics/cooja/GUI.java index 67628b0f8..091592634 100644 --- a/tools/cooja/java/se/sics/cooja/GUI.java +++ b/tools/cooja/java/se/sics/cooja/GUI.java @@ -245,6 +245,7 @@ public class GUI extends Observable { "PATH_LINKER", "LINK_COMMAND_1", "LINK_COMMAND_2", "PATH_AR", "AR_COMMAND_1", "AR_COMMAND_2", "PATH_OBJDUMP", "OBJDUMP_ARGS", + "PATH_OBJCOPY", "PATH_JAVAC", "CONTIKI_STANDARD_PROCESSES", @@ -929,7 +930,7 @@ public class GUI extends Observable { menuItem.setToolTipText("Not available in applet version"); } - menuItem = new JMenuItem("Compiler configuration wizard"); + menuItem = new JMenuItem("Contiki mote configuration wizard"); menuItem.setActionCommand("configuration wizard"); menuItem.addActionListener(guiEventHandler); menu.add(menuItem); @@ -940,14 +941,6 @@ public class GUI extends Observable { menu.add(new JMenuItem(showBufferSettingsAction)); - menu.addSeparator(); - - menuItem = new JMenuItem("Java version: " - + System.getProperty("java.version") + " (" - + System.getProperty("java.vendor") + ")"); - menuItem.setEnabled(false); - menu.add(menuItem); - /* Help */ menu = new JMenu("Help"); menu.setMnemonic(KeyEvent.VK_H); @@ -957,6 +950,22 @@ public class GUI extends Observable { menu.add(checkBox); menuBar.add(menu); + menu.addSeparator(); + + menuItem = new JMenuItem("Java version: " + + System.getProperty("java.version") + " (" + + System.getProperty("java.vendor") + ")"); + menuItem.setEnabled(false); + menu.add(menuItem); + menuItem = new JMenuItem("System's \"os.arch\": " + + System.getProperty("os.arch")); + menuItem.setEnabled(false); + menu.add(menuItem); + menuItem = new JMenuItem("System's \"sun.arch.data.model\": " + + System.getProperty("sun.arch.data.model")); + menuItem.setEnabled(false); + menu.add(menuItem); + // Mote plugins popup menu (not available via menu bar) if (menuMotePluginClasses == null) { menuMotePluginClasses = new Vector>(); diff --git a/tools/cooja/java/se/sics/cooja/dialogs/CompileContiki.java b/tools/cooja/java/se/sics/cooja/dialogs/CompileContiki.java index 3234a6cdc..abc9c31bc 100644 --- a/tools/cooja/java/se/sics/cooja/dialogs/CompileContiki.java +++ b/tools/cooja/java/se/sics/cooja/dialogs/CompileContiki.java @@ -495,6 +495,7 @@ public class CompileContiki { env.add(new String[] { "COOJA_SOURCEDIRS", "" }); env.add(new String[] { "COOJA_SOURCEFILES", "" }); env.add(new String[] { "CC", GUI.getExternalToolsSetting("PATH_C_COMPILER") }); + env.add(new String[] { "OBJCOPY", GUI.getExternalToolsSetting("PATH_OBJCOPY") }); env.add(new String[] { "EXTRA_CC_ARGS", ccFlags }); env.add(new String[] { "LD", GUI.getExternalToolsSetting("PATH_LINKER") }); env.add(new String[] { "LINK_COMMAND_1", link1 });