All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Alessandro Pittaluga <xpit@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] gdb and heaps
Date: Sat, 25 Mar 2006 11:52:51 +0100	[thread overview]
Message-ID: <44252103.2010604@domain.hid> (raw)
In-Reply-To: <1143279446.13244.257499314@domain.hid>

Alessandro Pittaluga wrote:
> Hi,
> 
> When trying to access with gdb to variables allocated on a shared heap,
> the following message is returned:
> (gdb) print mypointer
> $5 = (MYTYPE *) 0xb7dc4020
> (gdb) print *mypointer
> Cannot access memory at address 0xb7dc4020
> 
> All the applications (kernel and userland) are accessing correctly to
> the  heap-allocated memory. 
> 
> Is this the expected behaviour or there's something wrong in my
> installation?
>

Your installation is correct, GDB and Xenomai are too; unfortunately, 
the following explanation is still accurate, i.e. a restriction in the 
ptrace support:
http://sourceware.redhat.com/ml/gdb/2004-01/msg00152.html

Since you can call routines inside your program from the GDB cli, the 
best solution at hand would be to implement the suggestion found in this 
post: e.g.

void print_heap (void)
{
	... output the heap contents...
}

and,

(gdb) call print_heap()

You could even pass arguments to print_heap() for customizing your output.

A possible option to work around that would be to stop having heaps 
marked as I/O regions though, but the kernel-provided remapping helper 
we use currently forces this property. I'll look at this when time allows.

> Many Thanks
> Alessandro


-- 

Philippe.


  reply	other threads:[~2006-03-25 10:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-25  9:37 [Xenomai-help] gdb and heaps Alessandro Pittaluga
2006-03-25 10:52 ` Philippe Gerum [this message]
2006-03-25 19:18   ` Philippe Gerum

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=44252103.2010604@domain.hid \
    --to=rpm@xenomai.org \
    --cc=xenomai@xenomai.org \
    --cc=xpit@domain.hid \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.