• Register
0 votes
627 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

Please log in or register to answer this question.

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

1 vote
1 answer 2 views
2 views
Problem: Please help me to solve it out : program terminated with signal sigsegv, segmentation fault.
asked Mar 31 MUHAMMAD MUNEEB 80k points
0 votes
1 answer 2 views
2 views
Problem: who know this problem please help? how to create hex file in keil
asked Apr 1 Rohit kr 15k points
0 votes
2 answers 99 views
99 views
Problem: Which registry hive is loaded first during Windows startup?
asked Mar 9, 2020 ArifulIslam 7.5k points
1 vote
1 answer 4 views
4 views
Problem: I am unable to find out the solution, Please solve it : program received signal sigsegv, segmentation fault.
asked Mar 31 MUHAMMAD MUNEEB 80k points
0 votes
1 answer 19 views
19 views
Problem: the do-while loop must be terminated with a semicolon
asked Feb 25 jyoti goyal 2.1k points
0 votes
1 answer 37 views
37 views
Problem: Hello! I am a beginner, and I have a question. Why does the while() statement in the do-while loop, require a semi-colon after it? Why is this not so in the while loop? I am a bit confused. I am looking forward to a detailed answer and explanation from you. Thanks!
asked Jan 8 Code Learner 9.2k points
0 votes
1 answer 4 views
4 views
Problem: I get the following error; Task failed with exit 1 signal 0
asked Mar 21 ummesalma 22.9k points
0 votes
1 answer 62 views
62 views
Problem Process finished with exit code 139 (interrupted by signal 11: sigsegv)
asked Feb 11 charles mathews 5.5k points
0 votes
1 answer 1 view
1 view
Problem: I need assistance in resolving the following issue: round robin scheduling program in c with explanation
asked 1 day ago tuhin1 47.2k points
0 votes
1 answer 3 views
3 views
Problem: Someone help me to learn about round robin scheduling program in c with explanation.
asked 1 day ago zayed1 24.7k points