Exemple #1
0
        /// <summary>
        /// Populates the assembler combo box.  Attempts to match the defaultAsm arg with
        /// the entries to configure the initial value.
        /// </summary>
        private void PopulateAssemblerComboBox(string defaultAsm)
        {
            //assemblerComboBox.DisplayMember = "Name";   // show this property

            assemblerComboBox.Items.Clear();
            IEnumerator <AssemblerInfo> iter = AssemblerInfo.GetInfoEnumerator();
            bool foundMatch = false;

            while (iter.MoveNext())
            {
                AssemblerInfo    info    = iter.Current;
                AssemblerVersion version = AssemblerVersionCache.GetVersion(info.AssemblerId);
                AsmComboItem     item    = new AsmComboItem(info, version);
                assemblerComboBox.Items.Add(item);
                if (item.AssemblerId.ToString() == defaultAsm)
                {
                    Debug.WriteLine("matched current " + defaultAsm);
                    assemblerComboBox.SelectedItem = item;
                    foundMatch = true;
                }
            }
            if (!foundMatch)
            {
                // Need to do this or box will show empty.
                assemblerComboBox.SelectedIndex = 0;
            }
        }
Exemple #2
0
        /// <summary>
        /// Gets a copy of the AppSettings with a standard set of formatting options (e.g. lower
        /// case for everything).
        /// </summary>
        /// <returns>New app settings object.</returns>
        private AppSettings CreateNormalizedSettings()
        {
            AppSettings settings = AppSettings.Global.GetCopy();

            // Override all asm formatting options.  We can ignore ShiftBeforeAdjust and the
            // pseudo-op names because those are set by the generators.
            settings.SetBool(AppSettings.FMT_UPPER_HEX_DIGITS, false);
            settings.SetBool(AppSettings.FMT_UPPER_OP_MNEMONIC, false);
            settings.SetBool(AppSettings.FMT_UPPER_PSEUDO_OP_MNEMONIC, false);
            settings.SetBool(AppSettings.FMT_UPPER_OPERAND_A, true);
            settings.SetBool(AppSettings.FMT_UPPER_OPERAND_S, true);
            settings.SetBool(AppSettings.FMT_UPPER_OPERAND_XY, false);
            settings.SetBool(AppSettings.FMT_ADD_SPACE_FULL_COMMENT, false);

            // Don't show the assembler ident line.  You can make a case for this being
            // mandatory, since the generated code is only guaranteed to work with the
            // assembler for which it was targeted, but I expect we'll quickly get to a
            // place where we don't have to work around assembler bugs, and this will just
            // become a nuisance.
            settings.SetBool(AppSettings.SRCGEN_ADD_IDENT_COMMENT, false);

            // Don't break lines with long labels.  That way we can redefine "long"
            // without breaking our tests.  (This is purely cosmetic.)
            settings.SetBool(AppSettings.SRCGEN_LONG_LABEL_NEW_LINE, false);

            // This could be on or off.  Off seems less distracting.
            settings.SetBool(AppSettings.SRCGEN_SHOW_CYCLE_COUNTS, false);

            // Disable label localization.  We want to be able to play with this a bit
            // without disrupting all the other tests.  Use a test-only feature to enable
            // it for the localization test.
            settings.SetBool(AppSettings.SRCGEN_DISABLE_LABEL_LOCALIZATION, true);

            IEnumerator <AssemblerInfo> iter = AssemblerInfo.GetInfoEnumerator();

            while (iter.MoveNext())
            {
                AssemblerInfo.Id asmId     = iter.Current.AssemblerId;
                AssemblerConfig  curConfig =
                    AssemblerConfig.GetConfig(settings, asmId);
                AssemblerConfig defConfig =
                    AssemblerInfo.GetAssembler(asmId).GetDefaultConfig();

                // Merge the two together.  We want the default assembler config for most
                // things, but the executable path from the current config.
                defConfig.ExecutablePath = curConfig.ExecutablePath;

                // Write it into the test settings.
                AssemblerConfig.SetConfig(settings, asmId, defConfig);
            }

            return(settings);
        }
Exemple #3
0
        private void PrintAsmVersions()
        {
            ReportProgress("\nTested assemblers:");
            IEnumerator <AssemblerInfo> iter = AssemblerInfo.GetInfoEnumerator();

            while (iter.MoveNext())
            {
                AssemblerInfo    info    = iter.Current;
                AssemblerVersion version = AssemblerVersionCache.GetVersion(info.AssemblerId);
                ReportProgress("  " + info.Name + " v" + version.VersionStr);
            }
            ReportProgress("\n");
        }