Author Topic: asm("int3"); /*trap*/ query  (Read 1876 times)

Offline Wkerry

  • Multiple posting newcomer
  • *
  • Posts: 77
asm("int3"); /*trap*/ query
« on: February 01, 2025, 02:20:32 am »
In the code there are a few of the following calls:
asm("int3"); /*trap*/

This works for x86 based CPU's, but when I use google to check what the arm equivalent it is not the same.

I have seen some historical posts of people building C::B on a RPi. As such it may be an idea to add protection around the asm("int3"); for x86 CPU's only and add support for ARM so that in the future when/if C::B does officially support running on RPi or other ARM SBC's/PC's then the code should hopefully then require less changes.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2839
Re: asm("int3"); /*trap*/ query
« Reply #1 on: February 01, 2025, 06:45:10 am »
In the code there are a few of the following calls:
asm("int3"); /*trap*/

This works for x86 based CPU's, but when I use google to check what the arm equivalent it is not the same.

I have seen some historical posts of people building C::B on a RPi. As such it may be an idea to add protection around the asm("int3"); for x86 CPU's only and add support for ARM so that in the future when/if C::B does officially support running on RPi or other ARM SBC's/PC's then the code should hopefully then require less changes.

Which code do you see the int3's in that are unprotected?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6070
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: asm("int3"); /*trap*/ query
« Reply #2 on: February 01, 2025, 06:54:56 am »
Hi, Pecan, my guess is that your recent to commits have some code change related to the "int3" instruction.

Maybe, we can find a way for both X86 based CPU and ARM based CPU.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Wkerry

  • Multiple posting newcomer
  • *
  • Posts: 77
Re: asm("int3"); /*trap*/ query
« Reply #3 on: February 01, 2025, 10:42:31 am »
It was in the latest SVN change, but I am 1000% confident the same int 3 is in other places as I have included it in apps I have done where I enable it in a debug build.

This is some thing to thin about when you see an "int 3".

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2839
Re: asm("int3"); /*trap*/ query
« Reply #4 on: February 01, 2025, 07:32:39 pm »
It was in the latest SVN change, but I am 1000% confident the same int 3 is in other places as I have included it in apps I have done where I enable it in a debug build.

This is some thing to thin about when you see an "int 3".

All use of "int3" has been commented out. SVN revision 13608

Offline Wkerry

  • Multiple posting newcomer
  • *
  • Posts: 77
Re: asm("int3"); /*trap*/ query
« Reply #5 on: February 02, 2025, 08:20:34 am »
Thanks.