Hacker News new | past | comments | ask | show | jobs | submit login

I have a couple of things I do depending on the code I'm working on. With the firmware I work in debugging is tricky because normally stopping the world with gdb messes up the delicate dance going on. Also the processor only has two hardware break points which isn't enough frankly.

However I do use gdb from the command line on occasion. Code I write is pretty heavy on global variable and with gdb you can poke about and see what they are. You can also use gdb to look at internal processor modules.

To get around the limits of not being able to use break points I have a command line interface built into the firmware, which I use to poke and prod for debugging. I'm dimly aware that almost no one else does this, but can't for the life of me figure out how people get by without it.

I also have a critical error handler that can save information off to a no init section of memory and then reset, recover and then log the error via the serial port on startup and via the radio. This is useful because for instance I have that hooked into the bus fault interrupt, so I can pull the offending instructions address off the call stack. The binutils program addr2line.exe rats out the offending line of code about 99% of the time.

For timing related stuff I make heavy use of toggling port pins and watching what happens with an oscilloscope.

For networking stuff sometimes I use wireshark.

For C#/.net development I use Visual Studio and logging either to a window or to a file. However I've noticed that when other programmers work on my code they immediately delete that stuff and switch to printing to 'stderror'.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: