English 中文(简体)
页: 1 气温排放物中的pl?
原标题:Perl: what does checkstack.pl in linux source do?

I am doing a project in linux kernel and I wanted to know what does this checkstack.pl do? I have never studied perl so cant understand the program. It will be great if I could understand the program conceptually if not line by line. Any effort appreciated.

Source: link text

那些想写一下我自己 t的手法,就可以在一项C方案中书写。 我的主要问点是:为什么这一法典是书面的,还是应该用纸面书写?

最佳回答

该清单列出了各功能在舱内所使用的梯度范围(即每个功能用于当地变数的当地平方位总数和没有的面积)。

The way it does this is by going through the disassembly of the kernel and looking for 2 things: function names and instructions which adjust the stack. It looks for function names by looking for lines that match $funcre (qr/^$x* <(.*)>:$/), and it looks for stack adjustment instructions that match $re or $dre; the latter two depend highly on what architecture the kernel was compiled for, which is what the first big block if if/else statements is checking for. $re searches for functions which adjust the stack by a fixed amount (the vast majority of functions), and $dre searches for functions which adjust the stack by a variable amount (rare).

binutils;objdump -d是指示拆卸物体档案的一部分。 该文字的用法是将陶器(objdump -d vmlinux)和管道产出分解成文字。 文字的输出是按最大等级划分的纸浆中所有功能的清单。 我假定该书的用意是,纸浆商能够避免支流,痛苦地确保一切的打脚架尽可能小,而且这一文字允许他们核实这一点。

问题回答

正如上文已经解释的那样,用Perl字母来发现使用方言代码的分数,我认为,由于按C代码对<代码>objdump-d<<>/code”的产出进行分类,因此Perl的使用非常容易。

你们可以发现, run忙的用法,处理第一种论点和最后的当地变数的地址,然后将其抛开,例如:

int stack_usage_func(char i)
{
    int j,k,l;

    char buf[256];
    char m;
    unsigned long stack_use = &i - &m;
    //do all processing
    return stack_use
}

职能的恢复应使你能够及时使用,我没有编辑该守则,因此,如果该守则造成汇编错误,那么该逻辑就应当发挥作用。





相关问题
Why does my chdir to a filehandle not work in Perl?

When I try a "chdir" with a filehandle as argument, "chdir" returns 0 and a pwd returns still the same directory. Should that be so? I tried this, because in the documentation to chdir I found: "...

How do I use GetOptions to get the default argument?

I ve read the doc for GetOptions but I can t seem to find what I need... (maybe I am blind) What I want to do is to parse command line like this myperlscript.pl -mode [sth] [inputfile] I can use ...

Object-Oriented Perl constructor syntax and named parameters

I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...

Where can I find object-oriented Perl tutorials? [closed]

A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...