[GSoC weekly report#1]Reading source code and build a debugger demo in Hurd(not complete yet)

Honestly to say, these days I haven't enough time to do the gsoc stuff. The school work had taken almost all of my time. And I am so sorry to that I haven't got any significant progress at the beginning week.

I am reading the gdb source code, and the gnu-nat.c file has captured my eyes. According to the mach's exception model, I have tried to write a debugger demo on Hurd (not completed yet).  But I got some puzzles below:

1) What is the S_exception_raise_request()?

The exception model says: victim raise, victim wait, handler catch, handler take action. In my knowledge, handler catch the notification by invoking mach_msg(), and I finally found this invoke in gun_wait() function. But, I also found something strange like S_exception_raise_request(). The comment says ""The rpc handler called by exc_server ". What is the exc_server? And how to understand this why seems two place to catch the exception notification?

2) what is the role of ptrace in gdb port on Hurd?

I have found only one place to use ptrace like ptrace(PTRACE_TRACEME,..).  The rest directly use the vm_read,vm_write to access the inferior's memory instead of ptrace(PTRACE_PEEKDATA). what's plus, I have found the implementation of ptrace support PTRACE_PEEKDATA under Hurd in glibc.

Next week goal:

1. finish the debugger demo which support modifying the debugged process's memory and inserting breakpoint.

2. continue to read the source code. get clearly with the above questions.

2 thoughts on “[GSoC weekly report#1]Reading source code and build a debugger demo in Hurd(not complete yet)

  1. 说实在的,我这几天实在是没时间弄gsoc的东西。学校里的事儿我都快顾不过来了。很抱歉这第一周里我没有什么重大进展。

    我最近在读gdb源码,感觉gnu-nat.c这个文件有点儿意思。根据mach的异常模型,我试着给Hurd写了一个debugger demo(未完成版)。但是我遇到了一些谜题:

    1) S_exception_raise_request()是什么?

    异常模型说: 受害者抛出,受害者等待,处理者捕获,处理者采取行动。据我所知,处理者通过invoking mach_msg()捕获通知,我后来也在gun_wait()里找到了这个invoke。但是我还发现了一些很诡异的东西,像是S_exception_raise_request()。注释说"rpc handler 被exc_server调用"。exc_server是什么?我应该怎么理解这种一个异常提醒被两处捕获的情况?

    2) ptrace 在 向Hurd移植gdb的过程中扮演的是何种角色?

    我只找到一处使用ptrace的地方,ptrace(PTRACE_TRACEME,...)。
    其余的部分是直接用的vm_read, vm_write 来访问ingerior的内存,而不是ptrace(PTRACE_PEEKDATA)。 还有啊,我发现ptrace的实现支持Hurd下的glibc(译注:这句没看懂)。

    下周目标:

    1. 完成debugger的demo。这个demo将支持修改被调试过的过程的内存,以及插入断点。

    2. 继续阅读源代码。搞清楚上面的问题。

    • 这翻译完全就是我平时说话的口吻,赞!

      I have found the implementation of ptrace support PTRACE_PEEKDATA under Hurd in glibc. 我想表达的意思是:我发现hurd中的glibc实现的ptrace调用支持PTRACE_PEEKDATA。 不知道对不对

      kira v587

Leave a Reply to kira Cancel reply

Your email address will not be published.


*