thumb_skip_prologue too adventurous

Jonathan Larmour jlarmour@redhat.co.uk
Sat Mar 18 14:14:00 GMT 2000


Hi Fernando,

You checked in the following change to arm-tdep.c:

revision 1.46
date: 2000/01/28 15:32:04;  author: fnasser;  state: Exp;  lines: +84 -22
2000-01-28  Fernando Nasser  <fnasser@totem.to.cygnus.com>
        * arm-tdep.c (thumb_skip_prologue, thumb_scan_prologue): Add
        support for new style thumb prologues.

However this has broken small functions, e.g. void foo() { for (;;); }  etc.
because such functions contain no prologue. e.g. for foo(), there is only
one instruction which is a branch to itself. However thumb_skip_prologue
will continue past the end of this small function and into the next one.
Thus breakpoints, etc. get set in completely the wrong place.

The essential issue is that thumb_skip_prologue must not be allowed to
continue on after the end of the function, even if it hasn't found the
prologue.

The attached patch certainly fixes things for me, but I'm not sure if it's
the right answer. If it is, please check it in; if not, tell me what I
should do :-).

Thanks,

Jifl

2000-03-18  Jonathan Larmour  <jlarmour@redhat.co.uk>

	* arm-tdep.c (thumb_skip_prologue): Take function end addr argument
	so that we can stop searching for the prologue past the function end
	(arm_skip_prologue): Call thumb_skip_prologue with function end addr


-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault


More information about the Gdb-patches mailing list