Author Topic: VAC3.65 / 3.08 inline assembly? How to insert INT 3?  (Read 15218 times)

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: VAC3.65 / 3.08 inline assembly? How to insert INT 3?
« Reply #15 on: December 24, 2017, 10:36:09 pm »
_interrupt(3) will very likely encode an "int 3" instruction as a 2 Byte opcode (0xCD 0x03).
Just verified with a test sample and it decodes correctly to 0xCC. This is with VAC3.65 and icc /Ti. Idebug stops and the popup says 'A program-generated breakpoint was encountered'.

OK in that case Everything is fine. Thanks for the Feedback.
« Last Edit: December 24, 2017, 10:40:09 pm by Lars »

Andi B.

  • Hero Member
  • *****
  • Posts: 811
  • Karma: +11/-2
    • View Profile
Re: VAC3.65 / 3.08 inline assembly? How to insert INT 3?
« Reply #16 on: December 26, 2017, 11:58:37 am »
And the best thing is ICAT stops as well of course. Now I can remotely single step through xwlan source code widget loading code  :)

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: VAC3.65 / 3.08 inline assembly? How to insert INT 3?
« Reply #17 on: December 26, 2017, 08:28:03 pm »
If you have the source code, can't you just compile xwlan with source debugging info (ICAT knows CODEVIEW and HLL where unfortunately it no longer understands the CODEVIEW variant that Watcom produces) and then set breakpoints from ICAT ?
If you set a breakpoint via ICAT, that's exactly what it will do: replace the first byte of an instruction with the 0xCC (int3) instruction.
At least that's what I have done over and over again with the USB driver source code.
Of course, the source code will have to be on your ICAT machine (along with the binary with debug info). The binary with debug info will (also, of course) have to go to the MUT.