Breakpoints have now been patented
An anonymous reader noted that apparently Breakpoints have now been patented. From the link "A method for debugging including the steps of receiving code having a software breakpoint function therein, running the code for the purpose of debugging, monitoring the code to detect the presence of the software breakpoint function, recognizing the software breakpoint function, determining an action to be performed based on the software breakpoint function, and implementing the action. The present invention also includes an apparatus for implementing the method for debugging and a medium embodying a program of instructions for execution by a device to perform the method for debugging."
Javascript + Nintendo DSi = DSiCade
"Free patents online" is a service that lets you search for patents on-line for free; the patents themselves aren't "free".
to prevent horrors like OP. Did you notice how the "free(b)" call was after an unconditional return? Somebody didn't.
Reduce, reuse, cycle
Yeah, except that debugging, breakpoints, and "virtual functions" or closures, interpreted code, or whatnot have been around for so long, that there is essentially nothing new under the sun. Smalltalk implementations were able to call into the debugger through an assert-like mechanism. You could then enter the debugger, change values around, and continue execution. Made things much easier when you were in the middle of a multi-day simulation test run and hit a problem. You could note the problem, fix it, and continue. Various Lisp, Scheme, ProLog and so forth variants have done some very neat things with debugging support through assertions, exceptions, traps, and all kinds of mechanisms. Essentially, any time you have an interpretive runtime, people play with different ways to do debugging.
Another way to look at it is that many runtimes will automatically enter the debugger on an exception or trap of some kind. An assertion failure generates an exception or trap. Assertions are generally controlled by DEBUG variables of some kind. Viola! Configurable code-side breakpoints. Different languages handle resumption from exceptions in different ways.
The problem is that people who write patents think that the mere act of putting two things together is innovative, even if the first thing is a tool, and the second is a logical extension of the tool's purpose, like adding "on the Internet" to something and calling it an invention. In this case, they did not even bother to see if it was done before, probably because they have no knowledge of languages outside the mainstream.
I had a hardware breakpoint debugger in The Final Cartridge II on the Commodore 64. That was, what - 20-25 years ago? This patent was issued last year.
That said, the first 13 claims pertain to software only (curio: the word "software" appears no less than 17 times in the first claim, "hardware" scores a big fat zero). Subsequent claims seem to revolve around a device reading a medium where the debug code is stored, ie RAM, some kind of ROM or even a CD with reader would fit this description.
It's so vaguely stated as to be totally useless. Useless, that is, if someone were to actually use this patent to implement something useful. You know, like the patent system was supposed to do. Very useful if it's to be used to threaten competitors and stifle innovation.
"To promote the progress of science and useful arts", my ass.
Money for nothing, pix for free
No that's not what they've patented. They've patented source level debugging with static break points. Apparently the developer litters the source code with SOFTWARE_BREAKPOINT; calls which turn into do-nothing statements if there is no debugger running the code. The target environment appears to be an embedded system like a cellphone.
/., but is it too much to ask that the article submitter or the editor read them first?
They have not patented hardware breakpoints, gdb, etc. and a huge advantage of their system is that you could apparently debug and selectively enable/disable breakpoints in a production ROM executable image.
I know noone reads these patents when these kinds of articles go by, this is
Great, now add ten more ifs there and see how readable it becomes vs. the goto solution with ten more labels and gotos
What on earth is wrong with people? Doesn't anyone ever actually sit back and THINK about how to write readable, maintainable procedural code?! First of all, any half-sensible person would put these things into a structure, containing pointers to such allocated memory. Then you just have functions that initialize and destroy that structure.
But, if you're hell-bent on allocating a bunch of memory in separate pointers, try this on for size:
int allocstuff(void)
{
int return_val = 0;
char *a = malloc(100);
if (!a) {
return -1;
}
char *b = malloc(100);
if (!b) {
free(a);
return -2;
}
char *c = malloc(100);
if (!c) {
free(a);
free(b);
return -3;
}
char *d = malloc(100);
if (!d) {
free(a);
free(b);
free(c);
return -4;
}
.
.
.
return return_val;
}
Advantages:
1) This way, it's very easy to read and follow the code. Any error causes you to abort immediately.
2) It makes it very easy to assign different return codes for different errors.
3) There's no complicated and messy multiply-nested control blocks here.
Disadvantages:
1) Later failure clauses can have a long list of free() statements. BUT, this way the code is simple to follow, and it's easy to verify any oversight.
2) Potentially, you have code bloat, from lots of redundant free() statements. Only a problem if you're writing for some tiny-ass embedded system. In my experience, the number of people who THINK they need to worry about code bloat is a lot larger than the number of people who actually DO need to worry about code bloat.
I can't count the number of times I've come across code that looks like the grandparent poster's, and re-wrote it. If you're writing for anything larger than a cellphone, and you think nested goto statements are the best way to handle this problem, you're not qualified to write procedural C code. Go learn OOP and use some higher-level language with a garbage collector.
-D
IANAL, but from what I understand there is a reason people don't read patents, at least in the US. If you violate a patent knowingly, you are liable for triple damages, whereas is you violate it unknowingly, only single damages.