如何在MonoDevelop中进入框架源代码

发布于 2024-09-10 13:08:03 字数 98 浏览 4 评论 0原文

在 MonoDevelop 中调试项目时,如何进入 Mono Framework 源代码?

我正在运行 openSUSE 11.3 中的普通 MonoDevelop。

While debugging a project in MonoDevelop how can I step into Mono Framework source code?

I'm running the vanilla MonoDevelop from openSUSE 11.3.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

↘紸啶 2024-09-17 13:08:03

这是一篇旧帖子,但我今天偶然发现它寻找答案,所以希望它对其他人有帮助。除非您的 PDB/MDB 文件指向的位置有源代码,否则仅取消选中“不要进入框架代码”是行不通的。在我的盒子上,它正在“/usr/src/packages/BUILD/mono-2.10”寻找源代码。

为了明确它应该去哪里,生成并注销一个异常,其中包含涉及框架的堆栈跟踪(例如 new SqlConnection(null)),它将向您显示在其中查找源的文件位置。 例如:

  at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) [0x00065] in /usr/src/packages/BUILD/mono-2.10/mcs/class/System/System.Net.Sockets/NetworkStream.cs:369 
  at Mono.Data.Tds.Protocol.TdsComm.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in /usr/src/packages/BUILD/mono-2.10/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs:630 
  --- End of inner exception stack trace ---

This is an old post, but I stumbled upon it looking for the answer today, so hopefully it will help someone else out. Just unchecking the "Do not step into framework code" doesn't work unless you have the source in the location the PDB/MDB files point to. On my box, it was looking for the source at "/usr/src/packages/BUILD/mono-2.10".

In order to find out specifically where it should go for you, generate and log out an exception that contains a stack trace involving the framework (new SqlConnection(null) for example) and it will show you the file location its looking for the source in. For example:

  at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) [0x00065] in /usr/src/packages/BUILD/mono-2.10/mcs/class/System/System.Net.Sockets/NetworkStream.cs:369 
  at Mono.Data.Tds.Protocol.TdsComm.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in /usr/src/packages/BUILD/mono-2.10/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs:630 
  --- End of inner exception stack trace ---
つ低調成傷 2024-09-17 13:08:03

如果您只是设置 Mono 环境,那么答案的关键部分是安装源文件的位置。对于 Ubuntu Natty 上的标准 Mono 构建,这是 /build/buildd。因此,要获取 mono 2.6.7(Ubuntu 版本)的源代码,请执行以下操作:

sudo mkdir /build
cd /build
sudo mkdir buildd
cd buildd
sudo apt-get source mono
sudo apt-get install mono-dbg

然后确保在 monodevelop 中未选中“不要进入框架代码”,它应该能够找到源代码。

A key part of the answer if you're just setting up a Mono environment is where to install the source files. For the standard Mono build on Ubuntu Natty, this is /build/buildd. So to get the source of mono 2.6.7 (the Ubuntu build), do:

sudo mkdir /build
cd /build
sudo mkdir buildd
cd buildd
sudo apt-get source mono
sudo apt-get install mono-dbg

Then ensure you have "Do not step into framework code" unchecked in monodevelop and it should be able to find the sources.

木森分化 2024-09-17 13:08:03

首先,您的 Mono 类库必须具有指向框架源文件的调试符号。然后,您应该取消选中 MD 调试器选项中的“不要单步执行框架代码”选项。

Firstly, your Mono class libraries must have debug symbols pointing to the framework source files. Then you should uncheck the "Do not step into framework code" option in MD debugger options.

孤独陪着我 2024-09-17 13:08:03

我在 Arch Linux 中没有 apt-get source 选项,所以我以 root 身份执行此操作:

# git clone https://github.com/mono/mono.git /opt/mono-src
# mkdir -p /build/mono/src
# ln -s /opt/mono-src /build/mono/src/mono-4.6.1

而不是这些 /build 路径,而是使用您自己的路径 格雷格的回答

I don't have the apt-get source option in Arch Linux, so I did this as root:

# git clone https://github.com/mono/mono.git /opt/mono-src
# mkdir -p /build/mono/src
# ln -s /opt/mono-src /build/mono/src/mono-4.6.1

Instead of these /build paths use your own accordingly to Greg's answer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文