This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

arm-elf:thumb and exception


Hello.

I have a question. Does Arm's thumb instruction set support the
exception of C++?
The follwing sample code does not run correctly.

The program counter does not reach to the tail of the main(), even on
the simulator of the gdb.
When all of the modules of the sample are compiled as arm instruction
set, The sample runs OK.

regards.

t_tanaka
--- environment ---
gcc:
Configured with: ../gcc-3.3.2/configure
--prefix=/work/linux/tool/Linux-i686
 --target=arm-unknown-elf --enable-interwork --with-gnu-as --with-gnu-ld
 --disable-threads --enable-languages=c,c++
Thread model: single
gcc version 3.3.2
as:
GNU assembler version 2.14 (arm-unknown-elf) using BFD version 2.14 20030612
ld:
GNU ld version 2.14 20030612

--- command line ---
/work/linux/tool/Linux-i686/bin/arm-unknown-elf-g++ -g -O0 -c
-mthumb-interwork exp16bit.cc -o exp16bit.o
/work/linux/tool/Linux-i686/bin/arm-unknown-elf-g++ -g -O0 -c
-mthumb-interwork -mthumb expon16.cc -o expon16.o
/work/linux/tool/Linux-i686/bin/arm-unknown-elf-g++ -g -O0 -c
-mthumb-interwork expon32.cc -o expon32.o
/work/linux/tool/Linux-i686/bin/arm-unknown-elf-gcc -o exp16bit
exp16bit.o expon32.o expon16.o misc.o -lstdc++ -lgcc

--- exp16bit.cc ---
#include "exp16bit.h"

int main()
{
	expon32();
	expon16();
	return 0;
}
--- exp16bit.h ---
int expon16();
int expon32();
--- expon16.cc ---
#include "exp16bit.h"

class Err16{};

int sub16()
{
	throw Err16();
	return 0;
}

int expon16()
{
	try{
		sub16();
	}
	catch( Err16 a){
	}
	return 0;
}
--- expon16.cc ---
#include "exp16bit.h"

class Err32{};

int sub32()
{
	throw Err32();
	return 0;
}

int expon32()
{
	try{
		sub32();
	}
	catch( Err32 a){
	}
	return 0;
}
-------------------


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]