On Fri, 21 Jun 2024, YunQiang Su wrote: > Linux and We use the code of conditional trap instructions to emit > signals other than simple SIGTRAP. Currently, code 6 (overflow), > 7 (div by zero) are supported. It means that if code 7 is used with > a conditional trap instruction, a SIGFPE instead of SIGTRAP will emit. > > But when `gen_trap` we didn't pass the code as we use `generate_exception`, > which has no info about the code. Let's introduce a new function > `generate_exception_code` for it.
I haven't touched this stuff for ages, but AFAICT the code is already passed where applicable via the environment for `do_tr_or_bp' to handle, so I can't understand why your change is needed. What problem are you trying to solve? Maciej