public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* EIP and VMA
@ 2005-03-18  0:57 Luca Falavigna
  0 siblings, 0 replies; 2+ messages in thread
From: Luca Falavigna @ 2005-03-18  0:57 UTC (permalink / raw)
  To: linux-kernel

Hi,
I am working on this piece of code (simplified):

void ip_vma(struct task_struct *task, struct pt_regs *regs)
{
	struct mm_struct *mm;
	struct vm_area_struct *vma;

	if(task) {
		mm = get_task_mm(task);
		if(mm) {
			vma = find_vma(mm, regs->eip);
 			if(vma) {
				/* Some code */
			}
			else
				printk("WARNING: No VMA\n");
			mmput(mm);
		}
	}
}

I would like to get instruction pointer's VMA of a task. In order to do so, I
use find_vma function, using regs->eip as instruction pointer value.
Unfortunately I always get "WARNING: No VMA" message because find_vma isn't able
to find the right VMA regs->eip address belongs to.
Is regs->eip the right place where istruction pointer is located or I should
find that value elsewhere?

Thank you,



				Luca

^ permalink raw reply	[flat|nested] 2+ messages in thread
* EIP and VMA
@ 2005-03-18  1:23 Luca Falavigna
  0 siblings, 0 replies; 2+ messages in thread
From: Luca Falavigna @ 2005-03-18  1:23 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi,
I am working on this piece of code (simplified):

void ip_vma(struct task_struct *task, struct pt_regs *regs)
{
	struct mm_struct *mm;
	struct vm_area_struct *vma;

	if(task) {
		mm = get_task_mm(task);
		if(mm) {
			vma = find_vma(mm, regs->eip);
 			if(vma) {
				/* Some code */
			}
			else
				printk("WARNING: No VMA\n");
			mmput(mm);
		}
	}
}

I would like to get instruction pointer's VMA of a task. In order to do so, I
use find_vma function, using regs->eip as instruction pointer value.
Unfortunately I always get "WARNING: No VMA" message because find_vma isn't able
to find the right VMA regs->eip address belongs to.
Is regs->eip the right place where istruction pointer is located or I should
find that value elsewhere?

Thank you,



				Luca


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-18  0:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-18  0:57 EIP and VMA Luca Falavigna
  -- strict thread matches above, loose matches on Subject: below --
2005-03-18  1:23 Luca Falavigna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox