Cannot exit Debugging Cleanly

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot exit Debugging Cleanly

1,890 Views
aeroengineer1
Contributor II

Sorry, there is no real great way to write the title of this to give the complete sense of the issue.  Pertinent details:

  • KDS 3.0 
  • KSDK 1.2
  • KL03 Freedom Board with on board debugger
  • Win 7-64 Pro

 

The issue happens as follows.  I go in and will flash a board with the code, and can flash it with out any issues.  Then I might decide to go into the debug mode to check some of the registers as is usual when debugging.  When I want to exit the debugging mode, I hit the stop button.  If I try to go back and then reflash the microcontroller, I will get a message in the console window that states:

 

"Temporary breakpoint 1, main () at ../Sources/main.c:54

54      unsigned int count = 0;"

 

I also get an error message that pops up in the main coding window area that states:

 

"No source available for "0X4e8"

 

I then have to close KDS and relaunch it to be able to flash the device again.  I have had a few times where I was able to cleanly exit the debug mode and be able to go back into the hardware perspective and work there, but they are few and far between.  As a note for future improvement; I would really love to see a button that allowed me to exit debugging and then return me to the perspective I had been using before starting to debug.

 

Adam

Labels (1)
0 Kudos
Reply
4 Replies

1,193 Views
aeroengineer1
Contributor II

Erich,

Sorry for the late reply, I have been having issues trying to log into the forum.  First off thanks for the detailed reply.  It seems that it is somewhat unfortunate that eclipse seems to be missing a basic feature of debugging.

Despite this, this is just a small issue, the bigger issue is the, "No source for XXXXX".  This is a consistent problem when trying to exit debugging for me.  As I mentioned, I have to completely exit KDS and restart to get it to work.  How might one go about extending the GDB script?  I have to admit that I am a bit of a novice when it comes to the inner workings of an IDE.

Thanks again,

Adam

0 Kudos
Reply

1,193 Views
BlackNight
NXP Employee
NXP Employee

Hi Adam,

I have to say that I don't see the problem you are describing (about exit debugging and that you have to exit KDS).

Yes, sometimes GDB server is stuck (especially if I try to debug while an existing debug sessions is going on). But I do not have to exit KDS, I simply can kill the GDB server (see GDB Client and Server: Unlocking GDB | MCU on Eclipse).

May you post a screenshot and the GDB log of your (problem) debug session? Are you using P&E, Segger or OpenOCD firmware?

Maybe a few words about the "No source for xxxxx" message: what usually happens is that the GDB server reports a PC (Program counter value, PC register). And then the client (Eclipse) tries to find the source for that PC location. If that source cannot be found, that message is shown. This might typically happen right after reset, but really it should not be any harm.

I hope this helps,

Erich

0 Kudos
Reply

1,193 Views
aeroengineer1
Contributor II

Erich,

Thanks for your information.  Perhaps it is just a matter of personal expectation as to this being a large bug or a minor annoyance.  I really, though do appreciate the workaround, though indeed, I would consider it a work around.  The KDS experience has been getting better with each release, though it still has a beta feel to it.  Compared to the first release, though it is much better.

I look forward to continuing to use it, and to future versions.

Adam

0 Kudos
Reply

1,193 Views
BlackNight
NXP Employee
NXP Employee

Hi Adam,

The temporary breakpoint is set because of a setting in the debug configuration here:

pastedImage_0.png

The above screenshot shows this for P&E, but is in a similar place for Segger J-Link and OpenOCD.

"No source for xxxx" shows up if GDB is not able to locate a source file for that PC register value. I had noticed this one too, but was never a problem to me. You might be able to get rid of it if you extend the GDB script to set the PC.

Lastly, the thing to return to the previous perspective after debug is a long lasting Eclipse thing, and discussed there for years I believe. The Eclipse maintainers say that you can get to the debug perspective from any other perspective, but the framework is not that way that it stores from where it is coming. And they did not want to change this. But these posts might help you:

How to make Eclipse (C++) switch from/to Debug perspective automatically? - Stack Overflow

In Eclipse, how do I change perspectives after terminating a process? - Stack Overflow

You might have a look at the 'SwitchPerspective' plugin, but this one did not work for me.

I hope this helps,

Erich

0 Kudos
Reply