• Register
0 votes
441 views

Problem :

I am debugging the piece of (embedded) software. I have already set a breakpoint on the function, and for some reason, once I have reached that a breakpoint and continue I always come back to a function (which is an initialisation function which should only be called once). When I remove a breakpoint, and continue, GDB tells me:

“Program received signal SIGTRAP, Trace/breakpoint trap.”

Since I was working with the breakpoints, I am assuming I fell in the "breakpoint trap". What is the breakpoint trap?

7 5 2
3,870 points

1 Answer

0 votes

Solution :

A breakpoint trap just means that the processor has hit the breakpoint. There are two possibilities for why this may be happening. Most likely, the initialization code is being hit because of the CPU is resetting and hitting a breakpoint again. The other possibility would be that a code where you set a breakpoint is actually run in places other than the initialization. Sometimes with a aggressive compiler optimization it can be very hard to tell exactly which code the breakpoint maps to and which execution paths will get there.

OR

The other possibility that I can think of is:

  1. The process is running more than the one thread.

             For example - 2 say T1 & T2.

  1. Thread T2 hits a break point but you have the attached gdb to thread T1.

            This case is the Trace/breakpoint trap.

9 7 4
38,600 points

Related questions

0 votes
2 answers 32 views
32 views
Problem: Which registry hive is loaded first during Windows startup?
asked Mar 9 ArifulIslam 5.7k points
0 votes
1 answer 23 views
23 views
Problem: I am new, I need help, can anyone help? During the boot process, where will the router bootstrap program look for the IOS image by default? flash NVRAM RAM ROM
asked Feb 21 maddi86 5.4k points
0 votes
1 answer 7 views
7 views
Problem hey, man i just need to write a code for bank account. so, provide me the code for that.just asking to educate afterall i am going to be a developer that my dream.But remember the program has to allow the user to see the deposits and ... system if user want to deposit or withdraw money entering the specific account number is necessary for that.of which gets displayed on the screen.
asked 5 days ago chris jordan 440 points
0 votes
1 answer 6 views
6 views
Factorial program in c++ using recursion It is a simple program, but I can not write a valid code. Any idea?
asked Nov 16 miki 1.5k points
0 votes
1 answer 5 views
5 views
Problem: I wrote a simple function to insert at the end of a linked list in C ++, but in the end it only shows the first data. I can't figure out what happened. This is the function: void InsertAtEnd (node * & firstNode, string name) {          node * temp = firstNode;       ...          temp-> next = NULL;        if (firstNode == NULL) firstNode = temp; } I will be great if you’ll help me.
asked Nov 8 sasha 2.2k points