Understanding disassembly x86 + understanding function call + parameter pass and stack frame

Anuz Pratap Singh Tomar chambilkethakur at gmail.com
Tue Aug 6 06:16:41 EDT 2013


On Tue, Aug 6, 2013 at 10:43 AM, Saket Sinha <saket.sinha89 at gmail.com>wrote:

> Actually I need to ask you something rather than offering a solution.
> Actually I have a similar sort of situation so I think I would ask here.
>
>
Please don't do this. Ask the question separately. There are better chances
of getting answer from looking at the topic of mail then piggybacking at
some else's mail. Not to mention it is just bad mailing list netiquettes.
Secondly do not top post. I don't understand why is so hard to follow a
simple rule which is pretty much a norm on all open source mailing list.
May be this will help
http://kernelnewbies.org/mailinglistguidelines

> The issue I am facing is that I have been developing a filesystem
> driver(over x86) which has become  "unstable"  by which I mean ,  at
> compile time it is building but during runtime it fails when I call the
> corresponding APIs from the user-space.
>
> In order to find out exactly where it is failing, I need to debug the
> driver.
> I am very new to kernel development. I have heard about KGDB and KDB but
> it takes quite a lot to get them working so waht are the other tools
> available?
>
> Well if you are debugging a kernel driver at filesystem level it will take
time, there are really no shortcuts and kgdb might be your best bet.
You can have a look at debugfs which might be useful
http://www.linuxforu.com/2010/10/debugging-linux-kernel-with-debugfs/
Another link I found by simple search
http://confluence.jetbrains.com/display/~roman.shevchenko/Debugging+native+file+system+watcher+for+Linux

Lastly there was some discussion on Filesystem debugging on *this* very
mailing list, so I would suggest you search in archives.


 Regards,
> Saket Sinha
>
>
>
>
> On Tue, Aug 6, 2013 at 2:36 PM, nidhi mittal hada <nidhimittal19 at gmail.com
> > wrote:
>
>>
>>
>> ---------- Forwarded message ----------
>> From: nidhi mittal hada <nidhimittal19 at gmail.com>
>> Date: Tue, Aug 6, 2013 at 2:16 PM
>> Subject: Understanding disassembly x86 + understanding function call +
>> parameter pass and stack frame
>> To: Kernelnewbies <kernelnewbies at nl.linux.org>
>> Cc: Mulyadi Santosa <mulyadi.santosa at gmail.com>
>>
>>
>> Hi All,
>>
>> I am using crash tool to analyze core dump obtained from red hat linux on
>> x86_64 platform.
>>
>> And crash tool gives a stack trace of panic.
>> But its does not show function parameters which were passed in this stack
>> trace.
>>
>> So i have to disassemble and understand the value of parameters passed to
>> these functions, while it panicked.
>> Which i am not able to understand much.
>>
>> I would request help in knowing, how to understand disassembled function
>> call , on x86_64 arch.
>>
>> Putting some of the doubts..
>>
>> a)like which sequence the parameters, return address, etc are pushed on
>> stack?
>> b)Which registers are used, if some registers play some spl. role ?
>> c)lets say for a program a.c i use gcc -S a.c ...do we have some other
>> command to generate
>> somewhat more clear assembly code, may be with some comments in english
>>
>> Any kind of help in understanding this will be appreciated ..
>>
>> Thanks
>> Nidhi
>>
>>
>>
>>
>>
>> --
>> Thanks & Regards
>> Nidhi Mittal Hada
>>
>> http://nidhi-searchingmyself.blogspot.com/
>>
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>


-- 
Thank you
Warm Regards
Anuz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130806/3f3728b6/attachment.html 


More information about the Kernelnewbies mailing list