PATCH multi-arch GET_LONGJMP_TARGET

Richard Earnshaw rearnsha@arm.com
Tue Feb 19 02:42:00 GMT 2002


> > 
> > This patch makes that
> > GET_LONGJMP_TARGET is always defined for all mutiarched target
> > (even partial !).
> > 
> > Thus it breaks compilation of Cygwin native GDB,
> > because JB_PC and JB_ELEMENT_SIZE are not defined for these targets.
> > (and several other i386 targets)
> > 
> > The correct fix would be to add these values to gdbarch ...
> > 
> > The following was committed as an obvious fix.
> 
> Ah, sorry about that.
> 
> Perhaps it would also be sensible to check GET_LONGJMP_TARGET_P() in that 
> code and always return 0 if it is false.
> 
> I'll go around the other tdep files and clean those up as well.
> 
> R.
> 

Thinking about it, the cleanest way to handle this for now is to change 
the test for a definition of JB_PC, since unless that is defined the code 
won't compile, and even if it did it would give the wrong answer.

As far as I can tell, apart from i386, only two further ports define 
GET_LONGJMP_TARGET: arc and sparc.  Arc seems never to use the code 
(there's only one .h file for that port and it doesn't define 
GET_LONGJMP_TARGET or JB_PC); Sparc seems to define it for pretty much all 
configurations I can think of.

Anyone object to the following patch?  I'll leave the x86 code as is for 
now, since you've already fixed that.

R.

<date>  Richard Earnshaw  <rearnsha@arm.com>

	* arc-tdep.c (get_longjmp_target): Only compile this function if
	JB_PC is defined.
	* sparc-tdep.c (get_longjmp_target): Likewise.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdb-jbpc.patch
Type: text/x-patch
Size: 1918 bytes
Desc: gdb-jbpc.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20020219/79830603/attachment.bin>


More information about the Gdb-patches mailing list