I am looking into gdb, for breakpoint implementation. For ease I took the very first GDB release 2.51 (released 1988). I see the break point insert data as –
#define BREAKPOINT {0x4e, 0x4f}
what is 0x4e and 0x4f ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The 0x4E 0x4F is the Motorola 68000 machine instruction for “TRAP #15”. The TRAP instruction forces an exception to occur, and on certain platforms trap #15 is defined as a breakpoint exception. This is why 0x4E and 0x4F appear in your GDB 2.51 source for handling platforms such as sun3.
References:
This Motorola M68000 Family Programmer’s Reference Manual contains the details of the TRAP instruction on page 4-188. Specifically, the instruction is represented by the 12-bit value 010011100100 followed by the 4-bit “vector” (in this case, 1111). So “TRAP #15” is represented by 0x4E 0x4F. Sun specifically uses vector 15 for breakpoint/tracing — a Google search reveals numerous comments and source code examples.