Commit 4eb62ae
Ronny Hansen
fix DAP disassembler reads D-space instead of I-space with split I/D
When the kernel runs with PTM=1 (split I/D), the DAP disassembler and
instruction-scanning helpers read memory through the runtime MMS path
which can resolve to D-space. This causes overlay code disassembly to
show garbage (D-space data/BSS content) instead of actual instructions.
Fix:
- Add Dbg_MapVirtualToPhysical() that explicitly selects I-space (PT)
or D-space (APT) from the PCR, bypassing the STS_PTM+UseAPT logic.
No traps generated, no PGU/WIP side effects.
- New functions: Dbg_ReadVirtualMemoryISpace/DSpace,
Dbg_WriteVirtualMemoryISpace/DSpace
- cmd_disassemble and all instruction-scanning code now uses
Dbg_ReadVirtualMemoryISpace() for instruction fetches
- cmd_read_memory/cmd_write_memory support ispace:/dspace: address
prefixes (via updated libdap) alongside existing phys: prefix
- Update libdap submodule with I-space/D-space enum + prefix parsing1 parent 0f32210 commit 4eb62ae
3 files changed
Lines changed: 138 additions & 14 deletions
- ai-improvements.md+94
- libdap/include/dap_types.h+3-1
- libdap/src/dap_client.c+22-10
- libdap/src/dap_server_cmds.c+18-4
- mcp-dap-server/mcp_dap_server/server.py+7-4
- src/dap_debugger/dap_debugger_main.c+139-152
- start-mcp-server.sh+8
- todo-mock.md+191
- tools/dap-debugger/dap_gui_debugger.ini+160
- tools/dap-debugger/src/debugger_client.cpp+8-4
- tools/dap-debugger/src/debugger_client.h+1-1
- tools/dap-debugger/src/ui/panel_breakpoints.cpp+5
- tools/dap-debugger/src/ui/panel_memory.cpp+7-4
- tools/dap-debugger/src/ui/panel_source.cpp+34
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
960 | 960 | | |
961 | 961 | | |
962 | 962 | | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
963 | 1066 | | |
964 | 1067 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
568 | 568 | | |
569 | 569 | | |
570 | 570 | | |
571 | | - | |
| 571 | + | |
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
594 | | - | |
| 594 | + | |
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
768 | | - | |
| 768 | + | |
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
| |||
878 | 878 | | |
879 | 879 | | |
880 | 880 | | |
881 | | - | |
| 881 | + | |
882 | 882 | | |
883 | 883 | | |
884 | 884 | | |
| |||
3894 | 3894 | | |
3895 | 3895 | | |
3896 | 3896 | | |
3897 | | - | |
3898 | | - | |
3899 | | - | |
3900 | | - | |
3901 | | - | |
| 3897 | + | |
| 3898 | + | |
| 3899 | + | |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
3902 | 3906 | | |
3903 | 3907 | | |
3904 | 3908 | | |
3905 | | - | |
3906 | | - | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
3907 | 3918 | | |
3908 | 3919 | | |
3909 | 3920 | | |
| |||
3991 | 4002 | | |
3992 | 4003 | | |
3993 | 4004 | | |
| 4005 | + | |
| 4006 | + | |
| 4007 | + | |
| 4008 | + | |
3994 | 4009 | | |
3995 | 4010 | | |
3996 | 4011 | | |
3997 | 4012 | | |
3998 | 4013 | | |
3999 | 4014 | | |
4000 | 4015 | | |
| 4016 | + | |
| 4017 | + | |
| 4018 | + | |
| 4019 | + | |
| 4020 | + | |
| 4021 | + | |
4001 | 4022 | | |
4002 | 4023 | | |
4003 | 4024 | | |
| |||
4084 | 4105 | | |
4085 | 4106 | | |
4086 | 4107 | | |
4087 | | - | |
| 4108 | + | |
4088 | 4109 | | |
4089 | 4110 | | |
4090 | 4111 | | |
| |||
4553 | 4574 | | |
4554 | 4575 | | |
4555 | 4576 | | |
4556 | | - | |
| 4577 | + | |
4557 | 4578 | | |
4558 | 4579 | | |
4559 | 4580 | | |
| |||
0 commit comments