feature article
Subscribe Now

Undo Your Mistakes at the Customer’s Site

Debugging Software Now Works Remotely

“Programming will be the last job on the planet.” – Jaan Tallinn, co-creator of Skype and Kazaa

Even hardware is software these days. With a hardware-development language (HDL), you can “compile” gates, boards, and even entire systems. Not everybody does… but you could. Software determines product functionality at least as much as the hardware does, and programming is a much easier skill to learn (and to teach) than hardware engineering. We’re becoming an industry of coders.

Yet one of the big downsides to programming is that you generally spend more time debugging your code than you do creating it. That’s the consistent conclusion of repeated surveys of professional programmers from around the world: they spend more time debugging than on any other part of the job.

Or maybe that’s actually a good thing in disguise. Hardware engineers generally spend less time (as a percentage) on debugging than their coding colleagues do, but that’s likely because hardware bugs are so expensive and time-consuming to fix. You can’t just iteratively debug a new 10-million-gate SoC by fixing little things here and there every half hour. It’s got to be pretty much perfect the first time. Consequently, hardware folks spend a lot of time up front simulating and verifying their design before they push the big red button. Programmers? Not so much. We’ll fix it as we go along. Or maybe sometime after that. We’ll see.

The result is a lot of iffy code that gets shipped out to the customer, with a vague promise of a fix, an update, or an upgrade somewhere down the road. Why hold up revenue when we can patch bugs in the field? It’s the end of the quarter; let’s make our number and worry about the update later.

This all assumes that you already know where the bugs are, however. It’s all very nice to push planned updates to your customers. But what about real bugs – the unexpected kind? What happens when tech support starts getting calls and emails about some failure you’ve never heard of and never anticipated? Now you’ve got a real problem. You’ve got systems installed in the field that are failing in ways you can’t duplicate in the lab. It’s too late to call the faulty systems back. And all the units in-house seem to work just fine. What’s going on at the customers’ site that’s making these things fail?

Who you gonna call?

Undo Software, that’s who. Or at least, they’d like you to give them a chance. Undo is a very small (12-person) company in Cambridge, UK that has been peddling a debug tool for a few years. It’s not a standalone debugger itself, but an enhancement for several popular debuggers that allows you to “rewind” program execution, one instruction at a time. It’s essentially a time machine for code. You can stop execution, back it up, roll it forward again, and see every pointer, register, and machine instruction along the way. It’s an obsessive amount of detail, but sometimes that’s exactly what you want.

The tool works by logging every processor activity and memory reference and squirreling it away in a circular buffer that you set aside in your system memory. There is some processor overhead: “You can’t record everything a processor does, instruction by instruction, without incurring some overhead. But we’re clever about minimizing it,” says company cofounder Greg Law. The debug code itself occupies “a few megabytes” of code space. The size of the buffer is up to you, but a few more megabytes is a good starting point. The tool runs only on Linux or Android systems, either ARM- or x86-based.

That’s the old product. The new product, just announced this month, allows you to collapse both time and space. In other words, it lets you rewind code on a remote system – say at your customer’s site. Up until now, you could use Undo’s magic time machine only on a local system sitting in front of you. Now you can operate it remotely, too.

The remote capability gives developers a handy new tool for cracking open buggy systems that are out of reach. Simply include Undo’s special “Live Recorder” library in your shipping code, and leave it dormant until the bug day comes. Then, activate it remotely and voila! Spooky action at a distance.

The remote version logs all the same data, and gives you all the same detailed visibility, as the local version. It’s essentially a headless version of the earlier product, with the addition of up/downloading capability and some intrinsic privacy. Why privacy features on a debugger? Two reasons. One, you don’t want just any old programmer examining your detailed trace logs. Given the level of detail it records, UndoDB would be an ideal tool for reverse-engineering code. It would also be a handy cracking tool, were you so inclined.

The second reason has more to do with commerce. Undo licenses its software on an annual basis: buy one license and deploy as many copies as you like within a single project/product. No royalties; no need to count systems. That’s very convenient, but it also makes it hard for Undo to get paid. To thwart unscrupulous reuse of its code, Undo serializes each copy of Live Recorder, and the linked library will communicate only with its “twin” back at your desk. That allows you to talk to your remote system, but it keeps other people (and even other Undo Live Recorder users) out.

So now you can feel slightly less guilty about debugging code after it’s shipped to the customer. 

Leave a Reply

featured blogs
Sep 16, 2021
I was quite happy with the static platform I'd created for my pseudo robot heads, and then some mad impetuous fool suggested servos. Oh no! Here we go again......
Sep 16, 2021
CadenceLIVE, Cadence's annual user conference, has been a great platform for Cadence technology users, developers, and industry experts to connect, share ideas and best practices solve design... [[ Click on the title to access the full blog on the Cadence Community site. ]]...
Sep 15, 2021
Learn how chiplets form the basis of multi-die HPC processor architectures, fueling modern HPC applications and scaling performance & power beyond Moore's Law. The post What's Driving the Demand for Chiplets? appeared first on From Silicon To Software....
Aug 5, 2021
Megh Computing's Video Analytics Solution (VAS) portfolio implements a flexible and scalable video analytics pipeline consisting of the following elements: Video Ingestion Video Transformation Object Detection and Inference Video Analytics Visualization   Because Megh's ...

featured video

Product Update: Complete DesignWare 400G/800G Ethernet IP

Sponsored by Synopsys

In this video product experts describe how designers can maximize the performance of their high-performance computing, AI and networking SoCs with Synopsys' complete DesignWare Ethernet 400G/800G IP solution, including MAC, PCS and PHY.

Click here for more information

featured paper

An Engineer's Guide to Designing with Precision Amplifiers

Sponsored by Texas Instruments

This e-book contains years of circuit design recommendations and insights from Texas Instruments industry experts and covers many common topics and questions you may encounter while designing with precision amplifiers.

Click to read more

featured chalk talk

KISSLING Products: Rugged and Reliable Solutions

Sponsored by Mouser Electronics and TE Connectivity

Rugged and reliable designs today have a specific set of design requirements that may not be found in other industries including robustness, durability, and the ability to resist harsh environments. In this episode of Chalk Talk, Amelia Dalton chats with Mark Dickson from TE Connectivity about the KISSLING product family which includes a wide variety of rugged and reliable solutions for your next design.

Click here for more information about TE Connectivity / KISSLING Ruggedized Switching Products