Disabling stack access for remote targets?

Joakim Tjernlund joakim.tjernlund@transmode.se
Sun Jun 3 17:21:00 GMT 2012

Jan Kratochvil <jan.kratochvil@redhat.com> wrote on 2012/06/03 18:58:13:
> On Sun, 03 Jun 2012 18:42:10 +0200, Joakim Tjernlund wrote:
> > Not quite, I don't see memeor attribute "no-access", just ro, wo, and rw.
> There is "set mem inaccessible-by-default" for that purpose, default "on",
> just do not definy any memory area in that range you do not want to touch.

That could work, I need to test that though.

> > Testing for sp == 0 (or sp == ~0) would be much nicer. It would automatically
> > disable/enable stack access.
> sp == 0 or sp == ~0 are perfectly valid stack addresses on embedded targets.

In theory yes, I think you will have a very hard time finding a system using
0 or ~0(which is odd too).
If that is still a concern one could make the address configurable.
I think this feature would be really nice to have because it adapts
dynamically without the user having to know about mem regions.


More information about the Gdb mailing list