Annotation of nono/debugger/debugger_memory.h, revision 1.1

1.1     ! root        1: //
        !             2: // nono
        !             3: // Copyright (C) 2020 nono project
        !             4: // Licensed under nono-license.txt
        !             5: //
        !             6: 
        !             7: // デバッガからのメモリアクセス
        !             8: 
        !             9: // 今の所定義の依存関係の都合でこのファイルを直接読むことはできない?
        !            10: 
        !            11: #pragma once
        !            12: 
        !            13: #include "debugger_private.h"
        !            14: 
        !            15: class DebuggerMD;
        !            16: 
        !            17: class DebuggerMemoryStream
        !            18: {
        !            19:  public:
        !            20:        // コンストラクタ
        !            21:        DebuggerMemoryStream(const DebuggerMD *md_, const saddr_t& laddr_,
        !            22:                MemoryMode access_mode, MMULookupMode lookup_mode);
        !            23:        // コンストラクタ (lookup 省略)
        !            24:        DebuggerMemoryStream(const DebuggerMD *md_, const saddr_t& laddr_,
        !            25:                MemoryMode access_mode)
        !            26:                : DebuggerMemoryStream(md_, laddr_, access_mode, MMULookupMode::None)
        !            27:        {
        !            28:        }
        !            29:        // コンストラクタ (mode, lookup 省略)
        !            30:        DebuggerMemoryStream(const DebuggerMD *md_, const saddr_t& laddr_)
        !            31:                : DebuggerMemoryStream(md_, laddr_, MemoryMode::Logical)
        !            32:        {
        !            33:        }
        !            34: 
        !            35:        // 現在のアドレスを表示用に整形して str に代入する。
        !            36:        // アドレス変換でバスエラーが起きたら false を返す。
        !            37:        bool FormatAddr(std::string& str);
        !            38: 
        !            39:        // アドレスをリセットする。
        !            40:        void ResetAddr(uint32 newaddr);
        !            41: 
        !            42:        // 以下 Peek*()/Fetch*() はいずれも読み込んだデータを返す。
        !            43:        // (uint64)-1 ならアクセスの結果バスエラー。
        !            44:        // (uint64)-2 ならアドレス変換でバスエラー。
        !            45: 
        !            46:        // laddr から単位命令語を読み込むが、アドレスは進めない。
        !            47:        uint64 PeekInst();
        !            48: 
        !            49:        // laddr から単位命令語を読み込んで、アドレスを進める。
        !            50:        uint64 FetchInst();
        !            51: 
        !            52:        // laddr から1バイト読み込んで、アドレスを進める。
        !            53:        uint64 Fetch8();
        !            54: 
        !            55:  public:
        !            56:        saddr_t laddr {};               // (論理)アドレス
        !            57:        uint32 paddr {};                // 物理アドレス
        !            58: 
        !            59:  private:
        !            60:        const DebuggerMD *md {};
        !            61:        bool lookup {};                 // MMU テーブルサーチを行うなら true
        !            62: 
        !            63:        bool translate {};              // アドレス変換が必要なら true
        !            64:        bool pageover {};               // 256バイト境界をまたいだら true
        !            65: 
        !            66: };

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.