Mono.Debugger.Backend.DwarfFrameReader.CIE.read_cie C# (CSharp) Method

read_cie() private method

private read_cie ( DwarfBinaryReader reader ) : void
reader DwarfBinaryReader
return void
            void read_cie(DwarfBinaryReader reader)
            {
                long length = reader.ReadInitialLength ();
                long end_pos = reader.Position + length;
                int id = reader.ReadInt32 ();

                bool is_cie;
                if (frame.is_ehframe)
                    is_cie = id == 0;
                else
                    is_cie = id == -1;
                if (!is_cie)
                    throw new InvalidOperationException ();

                int version = reader.ReadByte ();
                if (version != 1)
                    throw new DwarfException (
                        reader.Bfd, "Unknown version {0} in CIE",
                        version);

                string augmentation = reader.ReadString ();

                if (augmentation.StartsWith ("eh")) {
                    reader.ReadAddress ();
                    augmentation = augmentation.Substring (2);
                }

                code_alignment = reader.ReadLeb128 ();
                data_alignment = reader.ReadSLeb128 ();
                return_register = reader.ReadByte ();

                for (int pos = 0; pos < augmentation.Length; pos++) {
                    if (augmentation [pos] == 'z') {
                        reader.ReadLeb128 ();
                        // has_z_augmentation = true;
                        continue;
                    }

                    if (augmentation [pos] == 'L')
                        continue;
                    else if (augmentation [pos] == 'R') {
                        encoding = reader.ReadByte ();
                        continue;
                    }
                    else if (augmentation [pos] == 'P') {
                        continue;
                    }

                    throw new DwarfException (
                        reader.Bfd, "Unknown augmentation `{0}' in CIE",
                        augmentation[pos]);
                }

                columns = new Column [return_register + 2];
                for (int i = 0; i < columns.Length; i++)
                    columns [i] = new Column (State.Undefined);

                Entry entry = new Entry (this);
                entry.Read (reader, end_pos);

                reader.Position = end_pos;
            }
DwarfFrameReader.CIE