Exemple #1
0
		public MapFactor( MapFactor data )
		{
			VariableName = data.VariableName;
			Address = data.Address;
			Size = data.Size;
			
		}
		public static bool Interpret(string[] textArray, List<MapFactor> mapList)
		{
			int foundIndex = 0;

			string searchWord = RmVersion;
			bool detectFlg = false;

			foundIndex = textArray[0].IndexOf(searchWord);

			if (foundIndex != -1)
			{
				detectFlg = true;

			}

			if (detectFlg == true)
			{
				for (int i = 1; i < textArray.Length; i++)
				{
					string[] splitLine = textArray[i].Split(' ');

					if (splitLine.Length == 3)
					{
						var data = new MapFactor();

						data.VariableName = splitLine[0];
						data.Address = splitLine[1];
						data.Size = splitLine[2];

						mapList.Add(data);

					}
					
				}

			}

			bool ret = false;

			if (mapList.Count != 0)
			{
				ret = true;

			}

			return ret;
		}
Exemple #3
0
        public static bool Interpret(string[] textArray, List <MapFactor> mapList)
        {
            int foundIndex = 0;

            string searchWord = RmVersion;
            bool   detectFlg  = false;

            foundIndex = textArray[0].IndexOf(searchWord);

            if (foundIndex != -1)
            {
                detectFlg = true;
            }

            if (detectFlg == true)
            {
                for (int i = 1; i < textArray.Length; i++)
                {
                    string[] splitLine = textArray[i].Split(' ');

                    if (splitLine.Length == 3)
                    {
                        var data = new MapFactor();

                        data.VariableName = splitLine[0];
                        data.Address      = splitLine[1];
                        data.Size         = splitLine[2];

                        mapList.Add(data);
                    }
                }
            }

            bool ret = false;

            if (mapList.Count != 0)
            {
                ret = true;
            }

            return(ret);
        }
Exemple #4
0
        private void variableTextBox_KeyDown(object sender, KeyPressEventArgs args)
        {
            // http://stackoverflow.com/questions/1698437/why-does-pressing-the-return-key-not-trigger-a-keypressevent-in-my-gtk-entry

            if (args.Event.Key == Gdk.Key.Return)
            {
                if (SubViewCtrl.myComponents.MapList != null)
                {
                    string tmpVariable = entryVariable.Text;

                    MapFactor result = SubViewCtrl.myComponents.MapList.Find(item => item.VariableName == tmpVariable);

                    if (result != null)
                    {
                        entryAddress.Text = result.Address;
                        entrySize.Text    = result.Size;
                    }
                }
            }
        }
		public static bool Interpret(string[] textArray, List<MapFactor> mapList)
		{
			int foundIndex = 0;

			string searchWord = "armlink";
			bool detectFlg = false;

			for (int i = 0; i < textArray.Length; i++)
			{
				if ((detectFlg == false) &&
					(i > 10))
				{
					break;
				}
				else
				{
					foundIndex = textArray[i].IndexOf(searchWord);

					if (foundIndex != -1)
					{
						detectFlg = true;

					}

				}

			}

			if (detectFlg == true)
			{
				string symbolPhrase = "Image Symbol Table";
				bool symbolFoundFlg = false;

				for (int i = 0; i < textArray.Length; i++)
				{
					foundIndex = textArray[i].IndexOf(symbolPhrase);

					if (foundIndex != -1)
					{
						symbolFoundFlg = true;
					}

					if (symbolFoundFlg == true)
					{
						var modifiedLine = Regex.Replace(textArray[i], @" +", " ");

						string[] splitLine = modifiedLine.Split(' ');

						if (splitLine.Length == 6)
						{
							var data = new MapFactor();

							data.VariableName = splitLine[1];
							data.Address = splitLine[2];
							data.Size = splitLine[4];

							mapList.Add(data);

						}

					}

				}

			}

			bool ret = false;

			if (mapList.Count != 0)
			{
				ret = true;

			}

			return ret;
		}
		public static bool Interpret(string[] textArray, List<MapFactor> mapList)
		{
			int foundIndex = 0;

			string searchWord = "IAR ELF Linker";
			bool detectFlg = false;

			for (int i = 0; i < textArray.Length; i++)
			{
				if ((detectFlg == false) &&
					(i > 10))
				{
					break;
				}
				else
				{
					foundIndex = textArray[i].IndexOf(searchWord);

					if (foundIndex != -1)
					{
						detectFlg = true;

					}

				}

			}

			if (detectFlg == true)
			{
				string symbolPhrase = "ENTRY LIST";
				bool symbolFoundFlg = false;

				for (int i = 0; i < textArray.Length; i++)
				{
					foundIndex = textArray[i].IndexOf(symbolPhrase);

					if (foundIndex != -1)
					{
						symbolFoundFlg = true;
					}

					if (symbolFoundFlg == true)
					{
						var modifiedLine = Regex.Replace(textArray[i], @" +", " ");

						string[] splitLine = modifiedLine.Split(' ');

						if (splitLine.Length == 7)
						{
							var data = new MapFactor();
							
							splitLine[2] = splitLine[2].Replace("0x", "");

							string decimalSize = "1";

							if (Regex.IsMatch(splitLine[2], @"^[0-9a-fA-F]+$"))
							{
								decimalSize = Convert.ToInt64(splitLine[2], 16).ToString();

							}

							data.VariableName = splitLine[0];
							data.Address = splitLine[1];
							data.Size = decimalSize;

							mapList.Add(data);

						}

					}

				}

			}

			bool ret = false;

			if (mapList.Count != 0)
			{
				ret = true;

			}

			return ret;
		}
Exemple #7
0
        public static bool Interpret(string[] textArray, List <MapFactor> mapList)
        {
            int foundIndex = 0;

            string searchWord = "ELF Header";
            bool   detectFlg  = false;

            for (int i = 0; i < textArray.Length; i++)
            {
                if ((detectFlg == false) &&
                    (i > 10))
                {
                    break;
                }
                else
                {
                    foundIndex = textArray[i].IndexOf(searchWord);

                    if (foundIndex != -1)
                    {
                        detectFlg = true;
                    }
                }
            }

            if (detectFlg == true)
            {
                string symbolPhrase   = "Symbol table";
                bool   symbolFoundFlg = false;

                for (int i = 0; i < textArray.Length; i++)
                {
                    foundIndex = textArray[i].IndexOf(symbolPhrase);

                    if (foundIndex != -1)
                    {
                        symbolFoundFlg = true;
                    }

                    if (symbolFoundFlg == true)
                    {
                        var modifiedLine = Regex.Replace(textArray[i], @" +", " ");

                        string[] splitLine = modifiedLine.Split(' ');

                        if (splitLine.Length == 9)
                        {
                            var data = new MapFactor();

                            data.VariableName = splitLine[8];
                            data.Address      = "0x" + splitLine[2];
                            data.Size         = splitLine[3];

                            mapList.Add(data);
                        }
                    }
                }
            }

            bool ret = false;

            if (mapList.Count != 0)
            {
                ret = true;
            }

            return(ret);
        }
Exemple #8
0
 public MapFactor(MapFactor data)
 {
     VariableName = data.VariableName;
     Address      = data.Address;
     Size         = data.Size;
 }