Skip to content

Commit

Permalink
DWARF Extension (#587)
Browse files Browse the repository at this point in the history
* - Debug Info Stage for Explorer

* - Added methods to return method regions to source code

* - Added methods to return method regions to source code

* - Minor fixes

* - Minor fixes

* Merge branch '027-dwarf'

Corrected conflicts, bugs, and formatting issues
  • Loading branch information
tgiphil committed Feb 6, 2019
1 parent d447003 commit c8b1741
Show file tree
Hide file tree
Showing 36 changed files with 1,142 additions and 138 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ build.force
# exclude test directory
.test/

.gdb_history
5 changes: 5 additions & 0 deletions Demos/unix/debug-helloworld-internal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

# This file will be invoked from the gdb script. For internal use only.

qemu-system-i386 -kernel bin/Mosa.HelloWorld.x86.bin -S -gdb stdio
29 changes: 29 additions & 0 deletions Demos/unix/debug-helloworld.gdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#######################
# general configuration

set history remove-duplicates unlimited
set disassembly-flavor intel

define hook-quit
# kill
set confirm off
end

define hook-kill
set confirm off
end

########################
# specific configuration

file bin/Mosa.HelloWorld.x86.bin
target remote | Demos/unix/debug-helloworld-internal.sh
b *0x0
# b *0xc010609f

hbreak System.Void Mosa.HelloWorld.x86.Boot::Main()

####################
# continue debugging

continue
44 changes: 44 additions & 0 deletions Source/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Tool.Compiler",
"type": "mono",
"request": "launch",
"program": "${workspaceRoot}/../bin/Mosa.Tool.Compiler.exe",
"args": [
"-o",
"Mosa.HelloWorld.x86.bin",
"-a",
"x86",
"--mboot",
"v1",
"--map",
"Mosa.HelloWorld.x86.map",
"--debug-info",
"Mosa.HelloWorld.x86.debug",
"--x86-irq-methods",
"--base-address",
"0x00500000",
"mscorlib.dll",
"Mosa.Plug.Korlib.dll",
"Mosa.Plug.Korlib.x86.dll",
"Mosa.HelloWorld.x86.exe"
],
"cwd": "${workspaceRoot}/../bin",
"internalConsoleOptions": "openOnSessionStart"
}
/*
{
"name": "Attach",
"type": "mono",
"request": "attach",
"address": "localhost",
"port": 55555
}
*/
]
}
53 changes: 53 additions & 0 deletions Source/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build solution",
"type": "shell",
"command": "msbuild",
"args": [
"/property:GenerateFullPaths=true",
"/t:build"
],
"group": "build",
"presentation": {
"reveal": "always"
},
"problemMatcher": "$msCompile"
},
{
"label": "build tool.compiler",
"type": "shell",
"command": "msbuild",
"args": [
"/property:GenerateFullPaths=true",
"/t:build",
"Mosa.Tool.Compiler/Mosa.Tool.Compiler.csproj"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always"
},
"problemMatcher": "$msCompile"
},
{
"label": "build solution",
"type": "shell",
"command": "msbuild",
"args": [
"/property:GenerateFullPaths=true",
"/t:build"
],
"group": "build",
"presentation": {
"reveal": "always"
},
"problemMatcher": "$msCompile"
},
]
}
28 changes: 27 additions & 1 deletion Source/MOSA.sln
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mosa.Kernel.ESP32", "Mosa.K
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DeviceSystem", "DeviceSystem", "{88676490-5035-4424-812B-22FC1A70555E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CorLib", "CorLib", "{079CE6E3-8038-44F5-B18A-2D586A827D95}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{AFAB2795-9E00-4798-ACE9-54170BFD9192}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mosa.Compiler.Extension.Dwarf", "Mosa.Compiler.Extension.Dwarf\Mosa.Compiler.Extension.Dwarf.csproj", "{F8264668-E0CE-46C1-9AA8-B710D564264D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1245,6 +1251,24 @@ Global
{5C002A6C-9FF8-40C2-88AD-539642B31E65}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{5C002A6C-9FF8-40C2-88AD-539642B31E65}.Release|x86.ActiveCfg = Release|Any CPU
{5C002A6C-9FF8-40C2-88AD-539642B31E65}.Release|x86.Build.0 = Release|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Debug|x86.ActiveCfg = Debug|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Debug|x86.Build.0 = Debug|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Description|Any CPU.ActiveCfg = Debug|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Description|Any CPU.Build.0 = Debug|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Description|Mixed Platforms.ActiveCfg = Debug|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Description|Mixed Platforms.Build.0 = Debug|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Description|x86.ActiveCfg = Debug|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Description|x86.Build.0 = Debug|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Release|Any CPU.Build.0 = Release|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Release|x86.ActiveCfg = Release|Any CPU
{F8264668-E0CE-46C1-9AA8-B710D564264D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -1260,7 +1284,7 @@ Global
{D89972FD-A930-4D0C-B393-1895E78FAFAB} = {88676490-5035-4424-812B-22FC1A70555E}
{6509477A-7360-4937-A1B9-26FED0A75CDA} = {88676490-5035-4424-812B-22FC1A70555E}
{BE9A5A27-22C4-4664-A8BD-388B30B5972C} = {D032B24A-CE3A-4881-BACE-CC4FE0AFD69D}
{631BC4F3-E2D8-4319-814C-13904CAA17CE} = {E808AF53-3054-497B-B7C5-DEA4FDED0806}
{631BC4F3-E2D8-4319-814C-13904CAA17CE} = {079CE6E3-8038-44F5-B18A-2D586A827D95}
{FF099D48-3FA5-4ED6-BBA0-1497D734962A} = {FF773BDF-A20C-4A5F-BFF9-F422C2AFF3CE}
{A47B7998-4EE8-4AF8-9373-C664FDEDDC65} = {3C5A2C4B-FD05-42B3-B6C6-C366DF978A62}
{0B1011A6-8FCD-4F9E-BBB8-8DB86E23D2E8} = {DDBC7F79-A2A1-4D92-9AE7-ADDC838F1E5E}
Expand Down Expand Up @@ -1311,6 +1335,8 @@ Global
{599D1C00-7C78-4211-A958-1285C4CB77C9} = {3C5A2C4B-FD05-42B3-B6C6-C366DF978A62}
{889162C2-B68B-4A89-B66F-7779BABD927F} = {57A405DF-CCB3-4C9E-A88D-478E35042A84}
{5C002A6C-9FF8-40C2-88AD-539642B31E65} = {FF773BDF-A20C-4A5F-BFF9-F422C2AFF3CE}
{AFAB2795-9E00-4798-ACE9-54170BFD9192} = {DDBC7F79-A2A1-4D92-9AE7-ADDC838F1E5E}
{F8264668-E0CE-46C1-9AA8-B710D564264D} = {AFAB2795-9E00-4798-ACE9-54170BFD9192}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C22A5C94-6B05-4B1B-845A-A2EA7615E093}
Expand Down
19 changes: 19 additions & 0 deletions Source/Mosa.Compiler.Extension.Dwarf/DwarfCompilerExtension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using Mosa.Compiler.Framework;
using Mosa.Compiler.Framework.CompilerStages;

namespace Mosa.Compiler.Extensions.Dwarf
{
public class DwarfCompilerExtension : BaseCompilerExtension
{
public override void ExtendCompilerPipeline(Pipeline<BaseCompilerStage> pipeline)
{
pipeline.InsertBefore<LinkerFinalizationStage>(new DwarfCompilerStage());
}

public override void ExtendMethodCompilerPipeline(Pipeline<BaseMethodCompilerStage> pipeline)
{
}
}
}

0 comments on commit c8b1741

Please sign in to comment.