hi: maybe this should not be here! the test code: eh3.cpp int main() { try { throw 34; } catch (int) { } catch (char) { } catch (bool) { } } compile with g++ -S -dA eh3.cpp -o eh3.s the except table of the eh3.s 106 .section .gcc_except_table,"a", at progbits 107 .align 4 108 .LLSDA2: 109 .byte 0xff # @LPStart format (omit) 110 .byte 0x0 # @TType format (absolute) 111 .uleb128 .LLSDATT2-.LLSDATTD2 # @TType base offset 112 .LLSDATTD2: 113 .byte 0x1 # call-site format (uleb128) 114 .uleb128 .LLSDACSE2-.LLSDACSB2 # Call-site table length 115 .LLSDACSB2: 116 .uleb128 0x0 # region 0 landing pad 117 .uleb128 0x5 # action 118 .LLSDACSE2: 119 .byte 0x1 # Action record table 120 .byte 0x0 121 .byte 0x2 122 .byte 0x7d 123 .byte 0x3 124 .byte 0x7d 125 .align 4 126 .long _ZTIi 127 .long _ZTIc 128 .long _ZTIb 129 .LLSDATT2: ok: my problem is the action(line 117) how to index to the action record table? in Action record table , why there are the magic 0x7d?. $ g++ -v $ Using built-in specs. $ Target: i686-pc-linux-gnu $ Configured with: ../gcc-4.3.2/configure --prefix=~/gcc-4.3.2-install --enable-languages=c,c++ --with-mpfr=~/mpfr-2.4.1-install --enable-sjlj-exceptions $ Thread model: posix $ gcc version 4.3.2 (GCC)
Hi,> maybe this should not be here!does this have anything to do with LLVM?> int main() > { > try { > throw 34; > } > catch (int) { > } > catch (char) { > } > catch (bool) { > } > }The action is 0x5, this refers to 123 .byte 0x3 124 .byte 0x7d where 0x3 means that the typeinfo is _ZTIi (int). The 0x7d says that if the typeinfo doesn't match, then the next action to consider is at offset -3 from here. In other words, it will continue with 121 .byte 0x2 122 .byte 0x7d i.e. it will then try and match with _ZTIc. If this doesn't match then the next action to consider is offset -3 from here (0x7d), i.e. it will next examine 119 .byte 0x1 # Action record table 120 .byte 0x0 i.e. it will try and match with _ZTIb. If this doesn't match then it is all over (0x0).> 116 .uleb128 0x0 # region 0 landing pad > 117 .uleb128 0x5 # action > 118 .LLSDACSE2: > 119 .byte 0x1 # Action record table > 120 .byte 0x0 > 121 .byte 0x2 > 122 .byte 0x7d > 123 .byte 0x3 > 124 .byte 0x7d > 125 .align 4 > 126 .long _ZTIi > 127 .long _ZTIc > 128 .long _ZTIb > 129 .LLSDATT2: > > > ok: my problem is the action(line 117) how to index to the action record table? > in Action record table , why there are the magic 0x7d?.Ciao, Duncan.
Hi, 123 .byte 0x3 124 .byte 0x7d where 0x3 means that the typeinfo is _ZTIi (int). The 0x7d says that if the typeinfo doesn't match, then the next action to consider is at offset -3 from here. In other words, it will continue with 2009/3/13 Duncan Sands <baldrick at free.fr>:> Hi, > >> maybe this should not be here! > > does this have anything to do with LLVM?>> int main() >> { >> try { >> throw 34; >> } >> catch (int) { >> } >> catch (char) { >> } >> catch (bool) { >> } >> } > > The action is 0x5, this refers to > > 123 .byte 0x3 > 124 .byte 0x7d > > where 0x3 means that the typeinfo is _ZTIi (int). > The 0x7d says that if the typeinfo doesn't match, > then the next action to consider is at offset -3 > from here. In other words, it will continue with>> > > 121 .byte 0x2 > 122 .byte 0x7d > > i.e. it will then try and match with _ZTIc. If this > doesn't match then the next action to consider is > offset -3 from here (0x7d), i.e. it will next examine > > 119 .byte 0x1 # Action record table > 120 .byte 0x0 > > i.e. it will try and match with _ZTIb. If this > doesn't match then it is all over (0x0). > >> 116 .uleb128 0x0 # region 0 landing pad >> 117 .uleb128 0x5 # action >> 118 .LLSDACSE2: >> 119 .byte 0x1 # Action record table >> 120 .byte 0x0 >> 121 .byte 0x2 >> 122 .byte 0x7d >> 123 .byte 0x3 >> 124 .byte 0x7d >> 125 .align 4 >> 126 .long _ZTIi >> 127 .long _ZTIc >> 128 .long _ZTIb >> 129 .LLSDATT2: >> >> >> ok: my problem is the action(line 117) how to index to the action record table? >> in Action record table , why there are the magic 0x7d?. > > Ciao, > > Duncan. >