Пример #1
0
        void read_note_section()
        {
            threads = new ArrayList();
            foreach (Bfd.Section section in core_bfd.Sections)
            {
                if (!section.name.StartsWith(".reg/"))
                {
                    continue;
                }

                int            pid    = Int32.Parse(section.name.Substring(5));
                CoreFileThread thread = new CoreFileThread(this, pid);
                OnThreadCreatedEvent(thread);
                threads.Add(thread);
            }

#if FIXME
            TargetReader reader = core_bfd.GetSectionReader("note0");
            while (reader.Offset < reader.Size)
            {
                long offset = reader.Offset;
                int  namesz = reader.ReadInteger();
                int  descsz = reader.ReadInteger();
                int  type   = reader.ReadInteger();

                string name = null;
                if (namesz != 0)
                {
                    char[] namebuf = new char [namesz];
                    for (int i = 0; i < namesz; i++)
                    {
                        namebuf [i] = (char)reader.ReadByte();
                    }

                    name = new String(namebuf);
                }

                byte[] desc = null;
                if (descsz != 0)
                {
                    desc = reader.BinaryReader.ReadBuffer(descsz);
                }

                // Console.WriteLine ("NOTE: {0} {1:x} {2}", offset, type, name);
                // Console.WriteLine (TargetBinaryReader.HexDump (desc));

                reader.Offset += 4 - (reader.Offset % 4);
            }
#endif
        }
Пример #2
0
 public CoreFileTargetAccess(CoreFileThread thread)
 {
     this.Thread = thread;
 }
Пример #3
0
 public CoreFileTargetAccess(CoreFileThread thread)
 {
     this.Thread = thread;
 }
Пример #4
0
        void read_note_section()
        {
            threads = new ArrayList ();
            foreach (Bfd.Section section in core_bfd.Sections) {
                if (!section.name.StartsWith (".reg/"))
                    continue;

                int pid = Int32.Parse (section.name.Substring (5));
                CoreFileThread thread = new CoreFileThread (this, pid);
                OnThreadCreatedEvent (thread);
                threads.Add (thread);
            }

            #if FIXME
            TargetReader reader = core_bfd.GetSectionReader ("note0");
            while (reader.Offset < reader.Size) {
                long offset = reader.Offset;
                int namesz = reader.ReadInteger ();
                int descsz = reader.ReadInteger ();
                int type = reader.ReadInteger ();

                string name = null;
                if (namesz != 0) {
                    char[] namebuf = new char [namesz];
                    for (int i = 0; i < namesz; i++)
                        namebuf [i] = (char) reader.ReadByte ();

                    name = new String (namebuf);
                }

                byte[] desc = null;
                if (descsz != 0)
                    desc = reader.BinaryReader.ReadBuffer (descsz);

                // Console.WriteLine ("NOTE: {0} {1:x} {2}", offset, type, name);
                // Console.WriteLine (TargetBinaryReader.HexDump (desc));

                reader.Offset += 4 - (reader.Offset % 4);
            }
            #endif
        }