Breakpoints have now been patented 412
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."
Comment removed (Score:1, Insightful)
No longer news (Score:3, Insightful)
I think this is a bit different (Score:5, Insightful)
Re:Good and sad at the same time (Score:3, Insightful)
Re:I think this is a bit different (Score:4, Insightful)
Thus you end up with software breakpoints that can trigger the debugger based on optional listeners. At least, that's how I understand it. I could be wrong about the actual implementation.
You've just observed the slashdot patent attention span deficiency. Because most posters on this site don't have the slightest clue how to read a patent, they interpret a patent that claims to improve technology X by using method Y a synonymous to patenting X. Sure, this is obviously wrong to a moderately intelligent Orangutan, but nevertheless, it happens a lot here.
are you kidding? (Score:5, Insightful)
Re:I think this is a bit different (Score:3, Insightful)
It's simply too bad that Honeywell drove the system into the ground. We might all be using MULTICS derivatives today if Honeywell hadn't tried to compete against their own computers.
I just patented CODE WITHOUT COMMENTS (Score:5, Insightful)
Re:Next up... (Score:3, Insightful)
Wouldn't nested 'if..then's be better in this case?
That requires one level of nesting for every initialized resource. That can become ridiculous very quickly. A rollback or "error ladder" is something you see in a lot of commercial AND open source code. Examples I know of include FreeType and the Linux kernel.
It's only "unclear" in the sense that a for-loop was "unclear" to you when you first learned how to use it. This is a common, generally accepted idiom for the use of goto.
Re:I think this is a bit different - Not Really (Score:5, Insightful)
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.
Re:hardware debugger (Score:5, Insightful)
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.
Re:I just patented CODE WITHOUT COMMENTS (Score:1, Insightful)
Re:hardware debugger (Score:2, Insightful)
This is Slashdot... you must be new here.
Re:Seems somewhat original to me (Score:2, Insightful)
You read the article, You corrected yourself before someone else did, AND you want people to take your Karma away.
I don't think you belong here...
Re:Next up... (Score:3, Insightful)
Just on general principle I eschew multiple returns from a function. For one, it makes control flow harder to understand (the exact same problem with goto) by creating alternative exits from a function and whatever other control structures (for loops etc) you put the return inside. For two, it can pollute branch prediction resources on some computers, specifically ones that use the BTB to identify call/returns for use with a Return Address Stack.
Your function would be trivial to refactor without using any gotos, and it would be both easier to understand and easier on the hardware.
Re:Next up... (Score:1, Insightful)
Heh. What do you do when you fail to allocate memory? You allocate more memory!
What's more interesting that all the attempts I've seen so far at rewriting the original code snippet without using gotos end up with more convoluted, less readable code. But I guess that's cargo cult programming for you...
Looks like it was granted last year (Score:2, Insightful)
Patent 7,055,140: Software breakpoints implementation via specially named function.
Re:Could someone please patent code comments? (Score:5, Insightful)
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
Prior art! (Score:3, Insightful)
Re:Next up... (Score:3, Insightful)
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
Re:Next up... (Score:2, Insightful)
> quickly.
It becomes ridiculous less quickly than your spaghetti! If you have a lot of resources being allocated/deallocated often then obviously you'd want a different approach - perhaps a linked list (or some other collection) of resources to free up at some later point.
You seem to admire the fact that this sort of code is in common use - even in Linux! Much of the code I see is a joke, so that doesn't surprise me.
> It's only "unclear" in the sense that a for-loop was "unclear" to you when you first learned how to
> use it.
No, a for-loop is something you learn once and then never forget. Goto-ridden code is something you have to pick your way around every time you come to attempt to expand (or debug!) it.
Recent Supreme Court ruling will kill this one (Score:3, Insightful)
Why reading patents is bad for you (Score:3, Insightful)