From: Manish Katiyar <mkatiyar@gmail.com>
To: Glynn Clements <glynn@gclements.plus.com>
Cc: Holger Kiehl <Holger.Kiehl@dwd.de>, linux-c-programming@vger.kernel.org
Subject: Re: Question about core files
Date: Sat, 10 Oct 2009 14:38:00 +0530 [thread overview]
Message-ID: <ea11fea30910100208g1f4b7713k29742d94f7540f46@mail.gmail.com> (raw)
In-Reply-To: <19152.18236.807486.755513@cerise.gclements.plus.com>
On Sat, Oct 10, 2009 at 2:05 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:
>
> Holger Kiehl wrote:
>
>> How can I find which register is fsa_pos?
>
> fsa_pos is a parameter, and doesn't appear to be changed within the
> function, so I would expect "print fsa_pos" to give the correct value.
>
> AFAICT, the following portion of the disassembly:
>
> 0x0000000000404b49 <start_process+121>: movslq 0x24(%rsp),%rax
> 0x0000000000404b4e <start_process+126>: imul $0x8f8,%rax,%r14
> 0x0000000000404b55 <start_process+133>: mov %r14,%rax
> 0x0000000000404b58 <start_process+136>: add 0x225441(%rip),%rax # 0x629fa0 <fsa>
> 0x0000000000404b5f <start_process+143>: mov 0xec(%rax),%edx
> 0x0000000000404b65 <start_process+149>: test $0x1,%dl
>
> corresponds to the expression
>
> fsa[fsa_pos].host_status & DO_NOT_DELETE_DATA
>
> 0x24(%rsp) is fsa_pos, $0x8f8 (2296) is the size of each element of
> fsa[], 0x225441(%rip) is fsa, 0xec is the offset of the host_status
> field.
>
> So:
>
> movslq 0x24(%rsp),%rax # %rax = fsa_pos
> imul $0x8f8,%rax,%r14 # %r14 = fsa_pos * sizeof(fsa[i]) = &fsa[fsa_pos] - &fsa[0]
> mov %r14,%rax # %rax = &fsa[fsa_pos] - &fsa[0]
> add 0x225441(%rip),%rax # %rax = &fsa[fsa_pos]
> mov 0xec(%rax),%edx # %edx = fsa[fsa_pos].host_status
>
> Based upon this, %r14 should contain fsa_pos * 2296, so:
>
>> (gdb) info registers
>> r14 0xfffffffffffff708 -2296
>
> Which suggests that fsa_pos is -1.
Excellent Glynn .... thanks :-) . I was having trouble deciphering it .
>
> --
> Glynn Clements <glynn@gclements.plus.com>
>
--
Thanks -
Manish
==================================
[$\*.^ -- I miss being one of them
==================================
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-10-10 9:08 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-06 14:04 Question about core files Holger Kiehl
2009-10-06 14:41 ` Manish Katiyar
2009-10-07 13:28 ` Holger Kiehl
2009-10-07 13:54 ` Manish Katiyar
2009-10-07 14:21 ` Holger Kiehl
2009-10-07 17:36 ` Manish Katiyar
2009-10-08 18:47 ` Manish Katiyar
2009-10-09 12:09 ` Holger Kiehl
2009-10-09 12:15 ` Manish Katiyar
2009-10-09 12:43 ` Holger Kiehl
2009-10-10 8:35 ` Glynn Clements
2009-10-10 9:08 ` Manish Katiyar [this message]
2009-10-10 16:56 ` Holger Kiehl
2009-10-07 4:45 ` Glynn Clements
2009-10-07 13:43 ` Holger Kiehl
2009-10-08 0:28 ` Glynn Clements
2009-10-09 12:12 ` Holger Kiehl
2009-10-07 4:58 ` vinit dhatrak
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=ea11fea30910100208g1f4b7713k29742d94f7540f46@mail.gmail.com \
--to=mkatiyar@gmail.com \
--cc=Holger.Kiehl@dwd.de \
--cc=glynn@gclements.plus.com \
--cc=linux-c-programming@vger.kernel.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).