<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<blockquote
cite="mid:CAL+pkpfAU1UisMgc_nH0RYpHfoxB9f7ORoXk44cDNwjmj2QHmw@mail.gmail.com"
type="cite">
<div class="gmail_quote">c)lets say for a program a.c i use gcc -S
a.c ...do we have some other command to generate <br>
somewhat more clear assembly code, may be with some comments in
english <br>
<br>
</div>
</blockquote>
Not sure if this is of any help, but the kernel build system (no
idea how to do this for user space programs) offers to generate a
listing that interleaves the c code into assembly making it better
readable. So if your function is e.g. in kernel/rtmutex.c you could
do the following:<br>
<br>
andi@PC63:~/working_git/linux-next$ make kernel/rtmutex.lst<br>
SYSHDR
arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h<br>
SYSHDR
arch/x86/syscalls/../include/generated/uapi/asm/unistd_64.h<br>
<SNIP><br>
HOSTCC scripts/asn1_compiler<br>
MKLST kernel/rtmutex.lst<br>
No System.map<br>
andi@PC63:~/working_git/linux-next$ <br>
<br>
here is one function from the resulting rtmutex.lst file:<br>
<br>
static void fixup_rt_mutex_waiters(struct rt_mutex *lock)<br>
{<br>
70: e8 00 00 00 00 callq 75
<fixup_rt_mutex_waiters+0x5><br>
71: R_X86_64_PC32
__fentry__+0xfffffffffffffffc<br>
75: 55 push %rbp<br>
76: 48 ff 05 00 00 00 00 incq 0x0(%rip) # 7d
<fixup_rt_mutex_waiters+0xd><br>
79: R_X86_64_PC32
.bss+0x6fc<br>
7d: 48 89 e5 mov %rsp,%rbp<br>
80: 53 push %rbx<br>
81: 48 89 fb mov %rdi,%rbx<br>
if
(!rt_mutex_has_waiters(lock))<br>
84: e8 8e ff ff ff callq 17
<rt_mutex_has_waiters><br>
89: 48 ff 05 00 00 00 00 incq 0x0(%rip) # 90
<fixup_rt_mutex_waiters+0x20><br>
8c: R_X86_64_PC32 .bss+0x704<br>
90: 85 c0 test %eax,%eax<br>
92: 75 0c jne a0
<fixup_rt_mutex_waiters+0x30><br>
}<br>
<br>
btw. you can for example generate the pre-processed code in the same
way:<br>
<br>
andi@PC63:~/working_git/linux-next$ make kernel/rtmutex.i<br>
<br>
or the assembly code:<br>
<br>
andi@PC63:~/working_git/linux-next$ make kernel/rtmutex.s<br>
<br>
this is especially helpful, as it also contains a list of all the
flags used for compiling.<br>
<br>
regards,<br>
andi<br>
<br>
<br>
<blockquote
cite="mid:CAL+pkpfAU1UisMgc_nH0RYpHfoxB9f7ORoXk44cDNwjmj2QHmw@mail.gmail.com"
type="cite">
<div class="gmail_quote">Any kind of help in understanding this
will be appreciated ..<br>
<br>
Thanks<span class="HOEnZb"><font color="#888888"><br>
Nidhi<br>
<br>
<br>
</font></span></div>
<br>
<br clear="all">
<br>
-- <br>
Thanks & Regards <br>
Nidhi Mittal Hada<br>
<br>
<a moz-do-not-send="true"
href="http://nidhi-searchingmyself.blogspot.com/"
target="_blank">http://nidhi-searchingmyself.blogspot.com/</a><br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kernelnewbies mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a>
<a class="moz-txt-link-freetext" href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a>
</pre>
</blockquote>
<br>
</body>
</html>