From: tobias@gambas-buch.de (Tobias Boege)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Fwd: Understanding disassembly x86 + understanding function call + parameter pass and stack frame
Date: Tue, 6 Aug 2013 12:30:24 +0200 [thread overview]
Message-ID: <20130806103024.GB542@aurora> (raw)
In-Reply-To: <CAL+pkpfAU1UisMgc_nH0RYpHfoxB9f7ORoXk44cDNwjmj2QHmw@mail.gmail.com>
On Tue, 06 Aug 2013, nidhi mittal hada wrote:
> ---------- Forwarded message ----------
> From: nidhi mittal hada <nidhimittal19@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@nl.linux.org>
> Cc: Mulyadi Santosa <mulyadi.santosa@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?
Not necessarily on the stack. The AMD64 ABI [0] should help you here.
However, without knowledge of assembly I doubt you can achieve very much.
> b)Which registers are used, if some registers play some spl. role ?
You'll see in [0].
> 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
>
Never heard of such a thing. Actually without optimisation, the generated
assembly code from gcc (from all I have seen and remember) is very clear -
sometimes a little bit clumsy, but clear. You should in fact practice with
something like -O2 if you are about to disassemble kernel functions...
> Any kind of help in understanding this will be appreciated ..
Regards,
Tobi
[0] http://www.uclibc.org/docs/psABI-x86_64.pdf
next prev parent reply other threads:[~2013-08-06 10:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAL+pkpfXRUPUK9phHEt_auM0zCC97yzkgD0e1TRsFzSMfnrb3g@mail.gmail.com>
2013-08-06 9:06 ` Fwd: Understanding disassembly x86 + understanding function call + parameter pass and stack frame nidhi mittal hada
2013-08-06 9:43 ` Saket Sinha
2013-08-06 10:16 ` Anuz Pratap Singh Tomar
2013-08-06 10:30 ` Tobias Boege [this message]
2013-08-06 13:43 ` Matthias Brugger
2013-08-09 19:19 ` Tayade, Nilesh
2013-08-09 21:40 ` neha naik
2013-08-12 11:58 ` nidhi mittal hada
2013-08-12 12:51 ` Tobias Boege
2013-08-12 14:44 ` Tobias Boege
2013-08-12 15:07 ` amit mehta
2013-08-13 12:17 ` nidhi mittal hada
2013-08-13 12:32 ` amit mehta
2013-08-14 10:21 ` nidhi mittal hada
2013-08-14 10:44 ` nidhi mittal hada
2013-08-14 11:35 ` Valdis.Kletnieks at vt.edu
2013-09-03 9:16 ` nidhi mittal hada
2013-09-15 18:13 ` Tobias Boege
2013-08-14 10:55 ` Valdis.Kletnieks at vt.edu
2013-08-06 14:13 ` Fwd: " Andreas Platschek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130806103024.GB542@aurora \
--to=tobias@gambas-buch.de \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).