Slashdot Mirror


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."

412 comments

  1. Could someone please patent code comments? by Anonymous Coward · · Score: 5, Funny

    I'd love to have this as an excuse for not doing them. Thanks.

    1. Re:Could someone please patent code comments? by LordSnooty · · Score: 3, Interesting

      In that spirit, I hereby copyright the phrase "THIS IS A KLUDGE"

    2. Re:Could someone please patent code comments? by Linagee · · Score: 0

      They've patented setting up a software interrupt that goes to a handler and saves program state! (Breakpoints in a nutshell.)

    3. Re:Could someone please patent code comments? by kinglink · · Score: 1

      I laugh and then I realize I love it.

      Hell someone patent crappy C# conventions in C++ programs. Take your functors and your constant defined members of classes and stay out of my code.

      I can just imagine 50 patents, such as "string" because someone wants to make sure everyone only uses char, and the char arrays so people only use pointers and of course pointers because someone wanted to only use arrays.

      The saddest thing is it might actually work.

    4. Re:Could someone please patent code comments? by AndersOSU · · Score: 1

      Good for you. I recently filed a patent application for actually using a kludge. When it is granted all you guys will be tripping over yourselves to pay my licensing fee.

      I was a little worried about prior art, but I figured whats the chance of somebody actually denying this thing.

      P.S. This is notice that if you use any kludge between now and the date the patent is granted (2015 I figure) you will be willingly infringing and owe me treble damages.

      Muhahaha

    5. Re:Could someone please patent code comments? by brbdc · · Score: 0

      This isn't a patent. its an application for patent that won't go through. See the number. Patent No. are 7 digits. Anything with a year, hence 2003 is just a publication of an application. way to go submitter.

    6. Re:Could someone please patent code comments? by fishbowl · · Score: 1


      >Hell someone patent crappy C# conventions in C++ programs. Take your functors and your constant
      >defined members of classes and stay out of my code.

      Uh, functors and const correctness were C++ idioms long before C# existed.

      I hate the name functor because it fails to encapsulate the concepts from topology implied by the term.

      --
      -fb Everything not expressly forbidden is now mandatory.
    7. Re:Could someone please patent code comments? by SL+Baur · · Score: 5, Insightful

      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.

      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 /., but is it too much to ask that the article submitter or the editor read them first?

    8. Re:Could someone please patent code comments? by kinglink · · Score: 1

      I find most programmers I work with seem to consider them "C# conventions" even though you're right they were available at C++. Of course most of the discussions involving this is about C# style conventions vs. C style conventions (or assembly)

    9. Re:Could someone please patent code comments? by keird · · Score: 5, Informative

      Visual Basic has had this for years. It's called Stop. When running in the IDE execution breaks at the Stop command just as if you had a breakpoint defined. The command does nothing when running outside of the IDE.

    10. Re:Could someone please patent code comments? by sycodon · · Score: 1

      Ahhh...I have been doing this kind of thing for 11 years. Make a method called BreakHere and condition it on some key combination and put it at the beginning of every method. If I enter a method with that key combination held down, it drops into a trace mode.

      --
      When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
    11. Re:Could someone please patent code comments? by Ant+P. · · Score: 1

      Software breakpoints? I'm pretty sure Javascript hasn't had direct hardware access in the last 15 years...

    12. Re:Could someone please patent code comments? by mjjw · · Score: 1

      So a macro of something like #define SOFTWARE_BREAK asm { int 3; } which I have been using for years is now patented? That's laughable.

      --
      If you aren't far left by the age of 18 you have no heart. If you aren't far right by 30 you have no brain.
    13. Re:Could someone please patent code comments? by AlphaFreak · · Score: 2, Interesting

      OMG! I've doing that on the mainframe since the eighties...

      CALL PLITEST;

      Or more recently:

      CALL CEETEST;

    14. Re:Could someone please patent code comments? by MrManny · · Score: 1

      So... I've briefly read the patent - and as usual, I am not certain, what they are actually trying to patent. I'm not a big fan of generic statements (like patents love to use) and you seem to have grasped the idea of what the patent trying to tell us, could you enlighten me please?

      Are these compile-time preprocessor instructions like those macros in C/C++/C#?
      Or a variant of Java's optional runtime assertions?
      Or more like $ANY_IDE / $ANY_DEBUGGER, where the application is hosted by a debugger that can halt execution (at break points || under certain conditions) and give me an overview of the current application state?

      Enlighten me.
      Please :)

      Disclaimer: #define brieflyread read2linesandexit()

    15. Re:Could someone please patent code comments? by Nefarious+Wheel · · Score: 1
      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

      VMS Fortran IV: $ Fortran/nodebug

      I hereby copyright the meme ROFL (Rolling On Floor Laughing) and it's derivitave ROFLBTCAFTC (Rolling On Floor Laughing, Biting The Carpet And Frightening The Cat. Oh, and unclosed parenthetical groups.

      --
      Do not mock my vision of impractical footwear
    16. Re:Could someone please patent code comments? by EvilIdler · · Score: 1

      How is this new, anyway? I was stepping through the Amiga ROM in the late eighties
      with just the SEKA (or whatever) assembler's debugger.

    17. Re:Could someone please patent code comments? by SL+Baur · · Score: 3, Informative
      No, they're not preprocessor statements. They are calls to actual nop functions (the patent calls them "void" functions which is highly misleading). Some example code:

      static void sw_break1(void)
      {
      }
      static void sw_break2(void)
      {
      }
      extern void do_something_with_side_effects(void);
      extern int some_function(int, int, int);
      void some_buggy_function(int a, b, c)
      {
        int d;
       
        do_something_with_side_effects();
        sw_break1();
        d = some_function(a, b, c);
        sw_break2();
      }
      Now, if you declare the functions sw_break1 and sw_break2 as software breakpoint functions to the debugger and not the function do_something_with_side_effects, the debugger will recognize that the nop calls to sw_break? should do something special and trap them. Since they are nop functions, obviously if the program is not being run under a debugger, nothing special happens and the program doesn't crash.

      The way the description is worded, the debugger is expected to be doing the equivalent of single stepping through the program at a source code level looking for calls to special nop functions. When it detects some such, it can perform some (debugger) user defined operation. Because these are specifically software breakpoints, they are built into the program at compile time and are always present whether or not the program is being debugged.

      The patent goes on to claim various methods of describing which void functions should be considered special by the debugger, including a broad all parameterless void functions are special. Any required special debug code is linked from a library and hence, this method of debugging allows one to enable and disable breakpoints dynamically in an read-only image executing directly off a ROM.

      I'm a programmer not a lawyer and I've never done embedded programming so I haven't much of a clue whether or not there's prior art, but I am certain that gdb or any debugger that modifies the executable image in any way are not within the claims of this patent.
    18. Re:Could someone please patent code comments? by jcr · · Score: 1

      There's at least two decades of prior art on this. Hell, I can't even remember how far back the BreakForDebugger() function goes.

      -jcr

      --
      The only title of honor that a tyrant can grant is "Enemy of the State."
    19. Re:Could someone please patent code comments? by SL+Baur · · Score: 3, Informative

      So a macro of something like #define SOFTWARE_BREAK asm { int 3; } which I have been using for years is now patented? That's laughable. No, that's not what they patented. The patent covers portable software breakpoints which are detected by mapping a special (void) function called to an action. The patent also covers a variety of methods of describing which void function calls should be trapped by the debugger and a variety of methods by which the name of the special void function call can be mapped into an action to perform.

      No assembly is involved, the method is processor agnostic. No open inline code is involved either as the breakpoints must be detectable by software looking for function calls.
    20. Re:Could someone please patent code comments? by SL+Baur · · Score: 1

      $ Fortran/nodebug See the code sample I posted above. No, that's not prior art. Nor is ADA/nodebug or CC/nodebug, etc.

      Software "breakpoints" in this patent are implemented by special nop functions, programmer-defined and linked into the executable image and which must be able to be mapped to various actions (note the plural) to be performed. All /nodebug does is execute the program normally if you compiled it with /debug, otherwise it will always start in the debugger.
    21. Re:Could someone please patent code comments? by Nefarious+Wheel · · Score: 2, Informative
      What the Vax $Fortran/nodebug function did was to compile the code excluding any source code lines that had a "D" in the first column (or was it the 6th? I wrote about a half-million lines of the stuff long, long ago, and I claim Eld as a defense). The code line was a special procedural noop (a line of normal Fortran code) that became active upon compilation with the $Fortran/debug option. The code -- a breakpoint or print statement, generally -- was embedded in the code thus compiled. This was different from $run/nodebug, which meant to run without the debugger present at execution time.

      This fits a pattern of "special nop function, programmer-defined and linked into the executable image and which must be mapped to various actions to be performed". As a literal construal of prior art it works, although I will admit Fortran IV is seldom used in embedded systems any more.

      YMMV, please turn off radio before entering carwash as we are not liable for broken antennae.

      --
      Do not mock my vision of impractical footwear
    22. Re:Could someone please patent code comments? by MoFoQ · · Score: 1

      if that's the case....I think I can find old code that I wrote back in the mid-90's that I did that...

    23. Re:Could someone please patent code comments? by Anonymous Coward · · Score: 0


      You better be trolling on that.
      ;)

      But if you aren't, I'd have to say:

      Considering '92 predates JavaScript/ECMA by three years(?), that's an interesting hyperbole.

      Besides, it eliminates > 99% (and likely a majority of the people on /.) who had even heard of the Internet at that time.

      (It's why I used to refer to it as "The World's Biggest Secret Club" (think about it))

      Few people would even be able to comment on it as they didn't get on board until after Ed Krol's "The Whole Internet User's Guide" in Fall (September?) '92 and "Navigating the Internet" in the Feb-Mar '93 time frame as an emergency rush to compensate for missing out, after Krol's work became the #1 seller in the computer book market ca Jan '93.

      :)

    24. Re:Could someone please patent code comments? by robberbarron · · Score: 1

      Hmm. I implemented this in a debugger 10 years ago when I was at Metrowerks. IANAPL however and the patent deserves a bit more study.

    25. Re:Could someone please patent code comments? by SL+Baur · · Score: 1

      What the Vax $Fortran/nodebug function did was to compile the code excluding any source code lines that had a "D" in the first column Ah, we may have a winner then. You did say Fortran IV, my apologies. If code compiled this way could run without a debugger present, with said code doing nothing in that case, then I believe that might constitute prior art. The key question is then, how does the debugger interact with such a debugging code line? Can it decide what to do based upon what void function is being called is named? If so, then that is indeed prior art.
    26. Re:Could someone please patent code comments? by SL+Baur · · Score: 1

      I was stepping through the Amiga ROM in the late eighties with just the SEKA (or whatever) assembler's debugger. That's a processor hardware feature, and you couldn't have been writing code to burn the ROM with to insert dummy void function calls that the debugger could trap on.

      This is an extremely specialized application that Open Source has not and most probably will never deal with (ROM distribution of software is decidedly un-GPLish), pretty much the same as the Microsoft UAC patent that locks users out of their own system. So what? Epson has a stupid patent that at most five or ten programmers will ever have a use for. Let their employers pay for it and I hope Epson enjoys its royalties.
    27. Re:Could someone please patent code comments? by Almost-Retired · · Score: 4, Interesting

      if that's the case....I think I can find old code that I wrote back in the mid-90's that I did that...

      How in 104ee+99 kinds of hell can this patent stand? I was doing that in the late 70's, on an 1802 board called the Cosmac Super Elf, and 6 months later on a pair of z80 boards called the micro-professor. And in both cases I was doing it without an assembler! I was poor, so I looked the hex code up in the manual and entered it with the same hex editor I was using for the debugging, by inserting a breakpoint that took it back to the monitor and captured the machine state for a leasurely inspection. How the hell else did one debug machine code in those days?

      Hell and damnation, I'll bet Grace Hopper even used this technique. And I'd bet that same 6-pack she learned it from somebody that had been doing it for 5 years then...

      I can't fscking believe this, its only one step more complex than the (in)famous xor patent for moving the curser.

      Will someone Please deliver us from the insanity that is our patent system?

      --
      No Cheers this time, Gene

    28. Re:Could someone please patent code comments? by EdelFactor19 · · Score: 1

      IANAL but I have a basic grasp of the term PRIOR ART GDB, and various debuggers and debuggers such as Visual Studios have zero concerns for patent violations... they have existed in products since long before the patents date. so even if they were somehow construed to be violating it, if the holders of the patent sued them for violation microsoft or whoever would hire the cheapest shittiest lawyer they could and say lets go to court. Hand them a copy of any version that existed prior to the file or claimed "invention" date (we really need to get towards a first to file system here in usa) and say guess what we have prior art and your patent is invalid and we want legal damages for you wasting our time. the real problem is that in many ways they are getting away with patenting an algorithm, and as a whole software patents are seeming more and more absurd. but till then i guess i'll get a couple of my own right?

      --
      "Jazz isn't dead, it just smells funny" ~Frank Zappa
      EdelFactor
    29. Re:Could someone please patent code comments? by Twylite · · Score: 1

      Sounds like Tcl's "trace add execution" statement. The interpreter supports an enter and leave callback on every command or procedure (effectively every line of code). The interpreter always checks for the presence of a registered callback (i.e. the check is built in at compile time and is always executed even when the program is not being debugged). Since Tcl is a script language you can add and remove callbacks dynamically.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
    30. Re:Could someone please patent code comments? by Alioth · · Score: 1

      Well, we were doing that kind of thing on the Sinclair ZX Spectrum in 1982. It was really the only way to practically do it on a small Z80 based computer.

      Even if you could weasel out of the decades of prior art, what they are doing is OBVIOUS. Obvious things aren't supposed to be patentable. What you describe is merely a trivial extension of having some DEBUG macros in C code which are only run if you run the program with the '-d' parameter.

    31. Re:Could someone please patent code comments? by Anonymous Coward · · Score: 0

      IBM has had this in its LE software for the last 30 years!
      with compile options (about 50) flow, debug and more. Interpretive COBOL with STOP RUN - yes that too.
      Then there is Macro Assembler under IBM's debug.
      Plus the is FLIH, FLIH Level 2 and hardware assist SET commands.
      Hope IBM and HP Cobols will shatter this grab.

    32. Re:Could someone please patent code comments? by SL+Baur · · Score: 1
      I'm not defending this patent; I'm only trying to explain it.

      Well, we were doing that kind of thing on the Sinclair ZX Spectrum in 1982. It was really the only way to practically do it on a small Z80 based computer. Ah, the days when real programming and real programmers were still in vogue. I disagree with your statement, though.

      This patent implies source code level debugging (specifically the ability to treat a single line of source non-assembly language as an atomic unit) and thus the equivalent of compiling `gcc -g' (or whatever the target language may be). Did you have that kind of space available on a Sinclair in 1982? In 1982 I was programming in 6502 assembly language with some UCSD Pascal and having to deal with severe source file size limitations - "I understand this code is complex, but the file was too big to assemble so I deleted all the comments to make it fit", to name the most infamous example.

      If your debugger is using in effect self-modifying code by inserting a trap of any kind or any other kind of self-modification, that is not covered by this patent.

      Even if you could weasel out of the decades of prior art, what they are doing is OBVIOUS. That's a stronger argument than your first one, except about the "decades of prior art". I'll only restate what I've posted elsewhere on this thread - this is not anywhere near a general debugging/breakpoint patent. It is extremely specialized and their royalties will be somewhere in the neighborhood of 0 Philippine Pesos. Nothing for the rest of us who can use gdb and kin to be worried about.

      I think what Epson has done is extremely clever and probably not covered by prior art. It's certainly 3 or 4 orders of magnitude more clever than any code I've seen come out of Microsoft (caveat - I haven't done any serious code review of Microsoft code since PC DOS 2.0). The fact that so few people seem to understand what they've patented underscores the fact that maybe it isn't so obvious after all.
    33. Re:Could someone please patent code comments? by kimvette · · Score: 1

      but. . . this is different because it's done in wireless devices?

      --
      The Christian Right is Neither (Christian nor right). See: Matthew 23, Matthew 25, Ezekiel 16:48-50
    34. Re:Could someone please patent code comments? by try_anything · · Score: 1

      That's a new one on me, though I've heard C++ programmers refer to any C++ idioms popularized since 1995 as "Java-style programming," even when it is impossible to use those idioms in Java. Somehow people get the idea that C++ should feel like C, and when it doesn't, there must be some insidious influence at work.

    35. Re:Could someone please patent code comments? by operagost · · Score: 1

      Heck, I had stop in 1982: CBM BASIC V2

      --

      Gamingmuseum.com: Give your 3D accelerator a rest.
    36. Re:Could someone please patent code comments? by Doctor+Faustus · · Score: 1

      Visual Basic has had this for years. It's called Stop. When running in the IDE execution breaks at the Stop command just as if you had a breakpoint defined. The command does nothing when running outside of the IDE.
      No, that's what they should have done. The actual Stop command (at least in VB 6) turns into an End in the compiled version.

    37. Re:Could someone please patent code comments? by Anonymous Coward · · Score: 0
      Dibs on,

      // XXX
      // fugly hack
      // fix later
      // I hate this language
      // Whoever wrote this API needs to be removed from the gene pool
      // Someone carpet-bomb Redmond, please
      // This is what happens when mgmt makes tech decisions
    38. Re:Could someone please patent code comments? by Nefarious+Wheel · · Score: 1

      It was compiled as a normal line of code when the compiler directive $fortran/debug created the object module. The $link/debug could then add the symbol table for access by the run-time debugger, which could then be toggled on or off via $run/debug or $run/nodebug. So the debugger could see that line of code that had the "D" in column 1, but the run time debugger was independent of whether or not that line of code was compiled. Basically, $run/debug stripped off the "D" before compiling. This means that you can indeed access the label of that line of code via the debugger, thus accessing by it's name. I think that means yes, prior art.

      --
      Do not mock my vision of impractical footwear
    39. Re:Could someone please patent code comments? by Nefarious+Wheel · · Score: 1

      Erk... "$run/debug stripped off the "D" before compiling" should read "$fortran/debug stripped off the "D" before compiling.". It's late, signing off before the stupid gnome hits me with his little hammer again.

      --
      Do not mock my vision of impractical footwear
  2. Next up... by CdrGlork · · Score: 5, Funny

    Next to be patented will be the GOTO statement, so ALL YOU LAZY PROGGERS WILL STOP USING IT!

    1. Re:Next up... by MikeBabcock · · Score: 1

      Goto is very heavily used ... well, the JuMP call in assembly at least ;-) It works exactly like goto, and occurs plenty in modern software ... just because you don't see it doesn't mean its not there :-)

      --
      - Michael T. Babcock (Yes, I blog)
    2. Re:Next up... by Cylix · · Score: 1

      Yes,

      I'm about to patent a new twist on the jump concept.

      It will perform a compare and can jump based on success or failure of the previous compare operation!

      Egads man, I'll be rich once programmers catch on to my new and improved version of jump!

      --
      "You should always go to other people's funerals; otherwise, they won't come to yours." -- Yogi Berra
    3. Re:Next up... by jimstapleton · · Score: 3, Funny

      ok, if you do that, can I patent a system whereby human-readable text is converted into machine instructions?

      --
      34486853790
      Connection too slow for X forwarding? Try "ssh -CX user@host"
    4. Re:Next up... by Vihai · · Score: 5, Interesting
      I DO use gotos heavily.

      If you know where and how to use them, they actually are a sensible choice.

      They are very good in implementing the function rollback code, that is code which has to undo everything the function has done in case of an error.

      For example:


      int allocstuff(void)
      {
              char *a = malloc(100);
              if (!a)
                      goto err_malloc_a;

              char *b = malloc(100);
              if (!b)
                      goto err_malloc_b;

              return 0;

              free(b);
      err_malloc_b:
              free(a);
      err_malloc_a:

              return -1;
      }

    5. Re:Next up... by Threni · · Score: 1

      > If you know where and how to use them, they actually are a sensible choice.

      Sure.

      > They are very good in implementing the function rollback code, that is code which has to undo everything the function has done in
      > case of an error.

      Wouldn't nested 'if..then's be better in this case?

    6. Re:Next up... by Jarjarthejedi · · Score: 3, Funny

      Patent Application 297641286876b

      A method by which a specific unbound sequence of comparisons are performed with the program being instructed to perform differing operation based on the results. Should none of the comparisons result in the machine determining that the variable being compared fits the condition a "default" condition shall be allowed. Using this system a large number of such Improved Jumps can be performed with less code and processing power.

      ((For those without programming knowledge, or sense of humor, the parent wants to post If-Then statements, this is a Switch statement. That is all))

      --
      There are two kinds of fool One says 'This is old therefore good' Another says 'This is new therefore better'- Dean Ing
    7. Re:Next up... by pclminion · · Score: 2, 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.

    8. Re:Next up... by pebs · · Score: 0, Redundant

      The line that reads "free(b);" will never be executed.

      --
      #!/
    9. Re:Next up... by hansamurai · · Score: 1

      I like how in Java, goto is a reserved keyword, but it does absolutely nothing. Same with const.

    10. Re:Next up... by Anonymous Coward · · Score: 0

      I've heard it said that some people can write FORTRAN in any language.

    11. Re:Next up... by geoff+lane · · Score: 1

      It truly is possible to write BASIC programs in any language......

    12. Re:Next up... by exp(pi*sqrt(163)) · · Score: 1, Funny

      You're using a programming language where you have to write the code yourself to keep track of what memory has been allocated and then free whatever half-baked state you find yourself in when an error happens? I didn't know they still had such things. Tell me. Does your computer use valves or relays?

      --
      Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
    13. Re:Next up... by Vihai · · Score: 1

      Oh... why don't you direct your statement to the people at linux-kernel?

    14. Re:Next up... by Knara · · Score: 1

      Yeah, this comment isn't going to start a flamewar. You read like the guy who proclaims that no one uses COBOL or FORTRAN anymore, either, nor should they be.

    15. Re:Next up... by hisstory+student · · Score: 1

      I noticed that. What do you suppose is the reason for that line of code?

      --
      Heard any good sigs lately?
    16. Re:Next up... by QRDeNameland · · Score: 1

      As far as I can tell, the free(b); will never get called. If both malloc()s work, it will hit the return 0; and bypass the subsequent code; if either one fails, the goto labels are past the free(b); statement.

      --
      Momentarily, the need for the construction of new light will no longer exist.
    17. Re:Next up... by gstoddart · · Score: 1

      Next to be patented will be the GOTO statement, so ALL YOU LAZY PROGGERS WILL STOP USING IT!

      Nah, don't patent the goto.

      Patent the entire idea of the machine code 'branch' instruction from whence the goto derives. That'll learn 'em -- you'll single handedly get rid of the whole concept of conditional logic in software. :-P

      Cheers
      --
      Lost at C:>. Found at C.
    18. Re:Next up... by Dachannien · · Score: 5, Funny

      Your code makes me want to throw up.

    19. Re:Next up... by teslar · · Score: 1

      Err, ok, maybe I am just missing something fundamental here, but why do you need the gotos? Why not just something like:

      int allocstuff(void) {

            int return_val = 0;
            char *a = malloc(100);

            if (!a) {
                  return_val = -1;
            } else {
                  char *b = malloc(100);

                  if (!b) {
                        free(a);
                        return_val = -1;
                  }
            }

            return return_val;
      }


      I'd find that much easier to read. I'm also confused by your free(b); statement. How can that ever be reached given the preceeding return 0;? Also, on a personal side-note, I hate - with a passion - code which omits braces for one-line if blocks. Two extra characters are not going to ruin anyone, but they do make the code much clearer at first glance. But yeah, personal preference, I guess.

    20. Re:Next up... by Synchis · · Score: 1
      How bout this:

      int allocstuff(void)
      {
              try
              {
                      char *a = malloc(100);
                      if (!a)
                                      throw new err_malloc_a();

                      char *b = malloc(100);
                      if (!b)
                                      throw new err_malloc_b();
              }
              catch (err_malloc_a)
              {
                      return -1;
              }
              catch (err_malloc_b)
              {
                      free(a);
                      return -1;
              }

              free(a);
              free(b);
              return 0;
      } I believe these days a try...catch block is preferable to an error ladder. Much more controllable, and doesn't require nasty GOTO's.

      When I took C programming in college, our professor told us at the beginning of the course that if *anybody* used a GOTO statement, he would make them write and present a 10000 word essay on "Why we don't use GOTO's". Needless to say, nobody ever used one. And the world was better for it. :P
      --
      Thomas A. Knight
      Author of The Time Weaver
    21. Re:Next up... by Malc · · Score: 1
      Ugh: allocating on the heap AND using goto.

      int allocstuff()
      {
          try
          {
              std::string a, b;
      // Not exactly necessary in most situations, but ensure the buffer is 100
      // chars like the OPs (whose was 99 actually)
              a.reserve(100);
              b.reserve(100);
          }
      // Catch ... is bad, but can't be bothered to look up which exception is thrown. Most
      // of the time don't even bother with this try/catch and let the app die in out of memory
      // situations as it's too much work to try to continue and let the user clean up their machine.
          catch (...)
          {
              return -1;
          }
          return 0;
      }
    22. Re:Next up... by teslar · · Score: 3, Funny

      There's no try/catch in C, I'm afraid.... you're thinking C++.

    23. Re:Next up... by kailoran · · Score: 1

      try...catch is really great, but if you're using C++ instead of C, which does not have try..catch, you might as well use something with constructors/destructors that will do the allocation automatically

    24. Re:Next up... by kailoran · · Score: 1

      Great, now add ten more ifs there and see how readable it becomes vs. the goto solution with ten more labels and gotos

    25. Re:Next up... by Duhavid · · Score: 1

      I believe that the labels were intended to be above each of
      the free calls, rather than below.

      --
      emt 377 emt 4
    26. Re:Next up... by Vihai · · Score: 2, Funny

      I don't think I'm undestanding you, sorry, I'm not a native english speaker.

      I, of course, use that approach when I write C code, that's why I wrote that code snippet in C.
      And I, of course, write C code in kernel land and when writing critical code in userland

      Oh... and yes... memory allocation failures may well happen on modern machines in kernel land... and if you like to write robust code, you have to cope with those

    27. Re:Next up... by MrPeach · · Score: 1

      Ugly, ugly, ugly

      int allocstuff(void)
      {
              char *a = 0;
              char *b = 0;

              do
              {
                      if (!(a = malloc(100)))
                              break;

                      if (!(b = malloc(100)))
                              break;

                      return 0;
              } while(0);

              if (b)
                      free(b);

              if (a)
                      free(a);

              return -1;
      }

    28. Re:Next up... by wumpus188 · · Score: 1

      There is a reason they invented alloca(), you know...

    29. Re:Next up... by gyranthir · · Score: 4, Funny

      Cobol already exists!!!

    30. Re:Next up... by Anonymous Coward · · Score: 0

      You sir, are a moron. You really have no clue about things like embedded systems programming do you? Not everything that needs to be programmed is run by your standard desktop PC. The thermostat in your house or your CD player don't have the luxury of a 3.0 GHz processor with 2 GB memory. Hell, there's still hardware at NASA that runs on old 486's! Not everything can be written using high-level languages like C# or Java. Get a clue about what your trying to talk about before making any comments.

      - HC2

    31. Re:Next up... by cculianu · · Score: 1
      Umm.. this function is retarded. It does nothing useful at all. In the non-error cases the allocated memory is lost forever as the caller is never informed of the address of the memory. Duh.

      Here's an actually useful function that makes some iota of sense and doesn't even need the gotos:

      int allocstuff(char **a, char **b)
          {
                *a = malloc(100);
                if (!*a) return -1;
                *b = malloc(100);
                if (!*b) { free(*a); *a = NULL; return -1; } /* NB: it's ok to free a NULL pointer */
       
                return 0;
          }
    32. Re:Next up... by Malc · · Score: 1

      If you're going to use C++ (for the exceptions), use new and delete. You can safely pass a null pointer to delete. Oh, other pet-peeve: a & b aren't boolean, so don't treat them as such.

      int allocstuff()
      {
              char *a = 0, *b = 0;
              int iRetVal = -1;

              a = new char[100];
              b = new char[100];

              if (0 != a && 0 != b)
              {
                    iRetVal = 0;
              }

              delete [] a;
              delete [] b;

              return iRetVal;
      }

    33. Re:Next up... by Joe+U · · Score: 1

      I agree, GOTO's are useful. Especially in error handling.

      Granted, I write mostly Transact-SQL stored procedures nowadays which makes BASIC look OO.

    34. Re:Next up... by Feyr · · Score: 4, Funny

      he did say human readable

    35. Re:Next up... by RightSaidFred99 · · Score: 1

      I know it was an attempt at humor, but lest people not realize it - apparently you're using some new-fangled version of C with exceptions? Amazing! Let's call it...C++? But wait, that wouldn't be C now would it.

    36. Re:Next up... by gyranthir · · Score: 1

      LOL I guess that's true.

    37. Re:Next up... by RightSaidFred99 · · Score: 1

      Gotos are useful in a few limited situations. The problem is with people like you who took what your professor said as gospel and now everyone regurgitates the "goto bad!" mantra like a bunch of trained chimps. The original poster is right, and is undoubtedly a better programmer than most of the people poo-pooing his comment.

    38. Re:Next up... by mackyrae · · Score: 1

      Okay, Python. It's executable pseudocode, after all.

      --
      look! it's a bird, it's a plane, it's....a girl? yes, a girl browsing Slashdot on Linux
    39. Re:Next up... by Chris+Burke · · Score: 2, Insightful

      I really don't see how you figure those 'goto's increased the understandability or maintainability of that code. 'If' statements make the control flow clear simply by the structure. "goto" makes that structure meaningless since the program can leap out of it to some arbitrary point at any time.

      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.

      --

      The enemies of Democracy are
    40. Re:Next up... by RightSaidFred99 · · Score: 1

      Right on, T-SQL is one example where Gotos are still useful, and preferable to some alternatives. Unfortunately most of the robot-programmers cranked out of the university system nowadays were indoctrinated that "goto=bad" so will go through all kinds of ridiculos, unreadable or even inefficient contortios to try to avoid them.

    41. Re:Next up... by Vexorian · · Score: 1

      But c++ is still c !

      --

      Copyright infringement is "piracy" in the same way DRM is "consumer rape"
    42. Re:Next up... by eric76 · · Score: 1

      Another good use of gotos is to escape from heavily nested code. Far too many programmers will try to play with the loop variables to exit from the loops and end up with very poor and hard to follow code as a result.

      The worst programmers either have generally been scared off from using gotos or they use them stupidly.

      The average programmers don't use gotos because someone might think they are incompetent.

      The very best programmers use gotos whenever and wherever appropriate, just like any other tool and their code is all that much better as a result.

    43. Re:Next up... by zippthorne · · Score: 1

      A common generally accepted use of goto that happens to be functionally equivalent to switch?

      --
      Can you be Even More Awesome?!
    44. Re:Next up... by Anonymous Coward · · Score: 0

      That's probably the most ignorance statement I've ever read on Slashdot, and THAT is saying something!

    45. Re:Next up... by eric76 · · Score: 1

      That was obviously meant as a simple example illustrating the use of a goto in that situation. Use that approach with a few more memory allocations and maybe open a few files, testing to make sure all memory allocations and file opens worked okay. Every if clause is going to have to undo everything done before before returning from the function.

      At least that is better than the common approach of just not checking to see if the allocation succeeded.

    46. Re:Next up... by Joe+U · · Score: 1

      The newest rev of T-SQL has TRY and CATCH. If I ever migrate over to it, I could avoid most GOTOs, it might make the code look better, but honestly, I don't know if it will be more efficient.

    47. Re:Next up... by Anonymous Coward · · Score: 0

      IMHO, this is the best solution there is. But I think the do..while(0) construct is just a clumsy way of avoiding writing the more obvious 'goto cleanup;' code.

    48. Re:Next up... by jbrandv · · Score: 1

      Sorry. I patented vomit last year.

    49. Re:Next up... by Anonymous Coward · · Score: 0

      The only reason to use a goto is if you have a limited stack size and/or require very fast code, and you need to unwind from the middle of a function in a language which doesn't support exceptions.

      Other than that you're just producing code which will potentially get appalling code rot, and has an irregular flow that's harder to follow. And, in many cases, it's just a programmer trying to be a smartass in a way which is just as inexcusable as abusing generics. You can produce perfectly acceptable code without gotos. Look at some of the examples posted here.

    50. Re:Next up... by TemporalBeing · · Score: 1

      If you know where and how to use them, they actually are a sensible choice.
      Agreed - GOTOs are useful if you know how to use them. Problem is, Academia does not teach anyone how to use them any more. However, that does not mean they are always the best choice.

      As you later explained, you write kernel code. GOTOs are good there because speed is required, and using other methods may slow down the speed. The trade off is speed for ease of writing.

      This is also true for some applications in user land. However, more often than not, a well laid out if-then block is a better choice (C, C++, Java), and sometimes an Exception Handler may be good too (C++, Java). However, these other techniques are not always the best either. For example, if you read up on the recent animated cursor (ANI) vulnerability in Windows, it was an Exception Handler that it got tracked to - one that caught and handled an exception that it should not have (invalid pointer or something).

      So, my point is that regardless of what you are programming you really do need to look at all the possibilities and decide what is the best method. Sometimes that will be GOTOs, other times (and more often than not) it will be other mechanisms. By no one mechanism is an Be-All-End-All mechanism. They all have their strengths, weaknesses, and faults.
      --
      Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
    51. Re:Next up... by Anonymous Coward · · Score: 0

      free(b); never gets called; I think you meant:

      int allocstuff(void)
      {
                      char *a = malloc(100);
                      if (!a)
                                      goto err_malloc_a;

                      char *b = malloc(100);
                      if (!b)
                                      goto err_malloc_b;

                      free(b);
                      return 0;

      err_malloc_b:
                      free(a);
      err_malloc_a:

                      return -1;
      }

    52. Re:Next up... by Anonymous Coward · · Score: 0

      'If' statements make the control flow clear simply by the structure.

      And when you're knee deep in {'s, you'll be wondering when you started writing Lisp.

      it makes control flow harder to understand

      The same can be said for not doing your input checking at the beginning of the function and bailing out immediately. If you force all of the code paths to exit at the end, then how do I know that somewhere in the middle something won't be executed when it shouldn't be? An "if (input>MAXVAL) return -1;" makes it explicitly clear what is happening and that nothing else will be allowed to happen.

      and easier on the hardware.

      It's almost the exact same code as the } else { part of your if statement, a jump to somewhere else.

    53. Re:Next up... by ixs0792 · · Score: 1

      You try to write Microchip assembly code without GOTOs. It's almost impossible with their 8 level stack.

    54. Re:Next up... by drxenos · · Score: 1

      alloca is not part of Standard C, you know...

      --


      Anonymous Cowards suck.
    55. Re:Next up... by proxy318 · · Score: 1

      I'm going to patent "a method for the entry of text into a machine by pressing buttons with one's fingers". I shall call this revolutionary process "typing".

      --
      Saying your "phone ran out of batteries" is like saying your "car ran out of gas tanks".
    56. Re:Next up... by Anonymous Coward · · Score: 1, Insightful

      char *a = malloc(100);
      if (!a)
      throw new err_malloc_a();

      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...

    57. Re:Next up... by edrobinson · · Score: 1

      Boy are you asking for it! Ever since what's his name said that goto is a bad thing, all of the sheep have gone along with it. The C/C++ code you present is valid but it might be more acceptable to these people using try/catch.

    58. Re:Next up... by ObjetDart · · Score: 1
      I DO use gotos heavily.

      I think you need to re-evaluate your heavy dependence on goto's. You seem to be using them as a crutch rather than as a tool.

      I agree that goto's are very occasionally useful, in certain rare cases. Your contrived example is definitely not one of them. Many posters have already demonstrated how your same snippet could be written more elegantly without goto's. If a junior programmer working for me wrote the above code, I would give him a gentle lecture. If an experienced coder working for me wrote that code, I would demand an immediate explanation, and it had better be a damned good one.

      The rare case where a goto is useful is when (in C only, of course, where you don't have the luxury of exceptions) you need to escape from a deeply nested block due to an unexpected error. Handling such a case w/o goto's can sometimes require gunking up the whole series of nested loops with extra conditions. So that is the one case where I would maybe accept the sacrifice of a goto in the name of overall code cleanliness.

      --
      I read Usenet for the articles.
    59. Re:Next up... by ansonyumo · · Score: 1

      OK, I get the utility. This usage is analogous in flow to try/catch blocks used for error handling.

      However, in the interest of proving your point, perhaps posting an example that avoids other pitfalls (e.g. leaking memory) would be more instructive?

    60. Re:Next up... by tkinnun0 · · Score: 1

      Unreadable, certainly not. Ugly, you betcha. If you're acquiring 10 different resources inside one method, damn sure the code should look ugly, because it is ugly.

    61. Re:Next up... by noidentity · · Score: 1
      Your code is an example of why one should at least use C++, not goto:

      std::vector<char> a, b;
       
      void alloc_stuff()
      {
          a.resize( 100 );
          b.resize( 100 );
      }
      No leaks, no pointless verbiage.
    62. Re:Next up... by eric76 · · Score: 1

      The only reason to use a goto is if you have a limited stack size and/or require very fast code, and you need to unwind from the middle of a function in a language which doesn't support exceptions.

      A goto is appropriate whenever and wherever the use of it will result in better quality and more readable code. In most cases when used appropriately, a goto will result in a far lower incidence of "appalling code rot".

      Of course, there are plenty of brainwashed programmers around who are completely incapable of making such a determination.

    63. Re:Next up... by Anonymous Coward · · Score: 0

      don't use exceptions for control flow, noob

    64. Re:Next up... by Anonymous Coward · · Score: 3, Funny

      If you know where and how to use them, [gotos] actually are a sensible choice.

      I couldn't have put it better myself.

      10 PRINT "YOU'RE A DICK..."
      20 GOTO 10
      RUN
    65. Re:Next up... by Anonymous Coward · · Score: 0

      I was born here, you know.

      You're gonna die here, you know.

    66. Re:Next up... by fishbowl · · Score: 1

      >You try to write Microchip assembly code without GOTOs.

      If you're talking assembly code, lots of high level languages compile all kinds of things into jumps anyway.

      Few people seem to have actually read Dijkstra's letter, and even fewer seem to realize the context he wrote it in. Dijkstra's most insightful comment was in regard to human cognition, not programming language design. He was observing that we have great ability to visualize a static graph, but to visualize a dynamic graph "evolving in time" is "relatively poorly developed." This was the central point of Dijkstra's argument, and it was what he considered GOTO to be harmful to.

      I don't believe Dr. Dijkstra would have any problem with the use of a goto statement, say, to dispose of heap-allocated data in a loop abortion, for instance. On the other hand, I wonder if he was amused by all the "considered harmful" things that were written over the years, often by people who completely missed his point.

      --
      -fb Everything not expressly forbidden is now mandatory.
    67. Re:Next up... by Chris+Burke · · Score: 1

      And when you're knee deep in {'s, you'll be wondering when you started writing Lisp.

      Properly structured code shouldn't need to get "knee deep" in ifs. And once you've littered your code with gotos to avoid some minimal subset of those nested ifs, then you will be wondering when you started writing in the bastard love child of Lisp and BASIC.

      An "if (input>MAXVAL) return -1;" makes it explicitly clear what is happening and that nothing else will be allowed to happen.

      It's no more explicit than the following.

      bool inputsValid = (input > MAXVAL);
      if (inputsValid) { //code that requires valid inputs
      }
      return inputsValid;

      Which also makes it explicit where the function exits and what its return value is, which makes future editing easier because you don't need to stare at the code forever to figure out "if I set this other variable here in this for loop, will it ever be executed?" due to early returns.

      It's almost the exact same code as the } else { part of your if statement, a jump to somewhere else.

      No, because the code as given already has the same number of jumps, in addition to the extra returns, and there's no need in the given example for an "else" clause. You see, if (error) return 0; is two branches.
      if (error) goto error_label; //stuff, including other returns

      error_label: return -1

      That's three branches, one for the "if", on for the "goto", and one for the "return".

      Also, the first code snippet I wrote has the advantage that if in the common case the inputs are valid, then the branch that skips around the "if (inputsValid) {}" block is never taken, which means in some architectures that it will not be put into the BTB and thus not use any branche prediction resources at all. Whereas the "goto" version requires at minimum two taken branches in the case where all inputs are valid.

      --

      The enemies of Democracy are
    68. Re:Next up... by mackyrae · · Score: 1

      Wouldn't that also cover having a giant pile of else-ifs?

      --
      look! it's a bird, it's a plane, it's....a girl? yes, a girl browsing Slashdot on Linux
    69. Re:Next up... by Anonymous Coward · · Score: 3, Insightful

      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

    70. Re:Next up... by Iron+Condor · · Score: 1

      and easier on the hardware.

      It might be an interesting exercise to feed your favorite version and the original goto'ed version to gcc and see what it actually makes out of either on the machine level. I have found the results often to be surprising (and often more optimal than what I would have done by hand).

      --
      We're all born with nothing.
      If you die in debt, you're ahead.
    71. Re:Next up... by ZwJGR · · Score: 1

      This is an example of a use of GOTO.
      I used something like this in a C program once, but I can't remember which code file...

      for(int i=0; i++; i<count)
              if(! array2[i]=dosomething(array[i])) { //error handler
                      goto deallocate;
              }

              Do-dastuff(); //Do more stuff

      for(; i--; i>0) {
              somesortoffree(array2[i]);
              deallocate:
      }

      Do excuse me if I made a mistake or two.

      Note I usually write in x86 assembly.

      --
      There is no psychiatrist in the world like a puppy licking your face - Ben Williams
    72. Re:Next up... by John+Whitley · · Score: 1

      If you know where and how to use [GOTOs], they actually are a sensible choice. For folks lacking the historical background: Dijkstra's stake in the ground against GOTOs has a number of positive merits. First, higher-level control constructs, now ubiquitous, such as the various loops, if-then-else, etc. are much better at explaining the programmer's intent than GOTOs. This makes it easier to write and maintain correct code, and had substantial impacts on the ability of compilers to optimize that code.

      The parent's example is a good one, and has been addressed by various exception handling control structures in post-C languages. One useful case that has made it into very few languages is multi-level break: a break statement that accepts a parameter, the number of levels of control to escape. A break(2) call would thus exit two levels of containing loops. It's not an incredibly common situation, but it can be very handy for certain kinds of data structure traversals, some nested state machine implementations, etc. Alas, out comes that ugly GOTO.
    73. Re:Next up... by ObjetDart · · Score: 1
      Yeah, whatever.

      You're 3 loops deep in a function and encounter an unrecoverable error... are you going to raise the exception there, or...what? goto out of the loop and then raise?

      --
      I read Usenet for the articles.
    74. Re:Next up... by Per+Abrahamsen · · Score: 1

      > I believe that the labels were intended to be above each of the free calls, rather than below.

      Not really, you don't need to call free when malloc fails.

      Looks tome that he want to keep the same structure for each malloc, which will also make the code more robust if new mallocs are added.

    75. Re:Next up... by Chris+Burke · · Score: 1

      That's a good point. Certainly the compiler could do something like eliminate the redundant returns or other optimizations. It is still terrible to read though. :)

      --

      The enemies of Democracy are
    76. Re:Next up... by jas_public · · Score: 1

      I'm sorry, but we've already patented throwing up.

      Patent 58574768 "A method for regurgitation, including the use of the water closet having a biological function therein, spewing from the mouth area for the purpose of vomiting, regurgitating the contents of the alimentary canal to eliminate the presence of the contents therein. The present invention also includes shitting."

    77. Re:Next up... by pclminion · · Score: 1

      A common generally accepted use of goto that happens to be functionally equivalent to switch?

      You can debate its "goodness" if you like, but you can't debate the fact that it is widely used. I think it is obfuscatory to invent some "deinitialization state" variable to switch on, and then fall into a series of fall-through case statements (which some people might call obscure in and of themselves). And besides, how are you going to get out of the initialization code and over to the switch? You could wrap things in tens of confusing conditions, inventing failure variables left and right just in order to avoid goto, or you could just... goto it. There is nothing inherently unclear about jumping into a chain of deinitializers.

    78. Re:Next up... by Per+Abrahamsen · · Score: 1

      I write code like yours (or wrote, back when I still programmed in C). But only because of the whole "goto is evil" mantra. The original code is much more robust and slightly more readable.

      The code duplication you advocate (and I also practiced) is simply asking for trouble. Luckily for both of us, it only happen in error handling situations, so the bugs that almost certainly will be in the code using our style after a few years of maintenance will most likely never be discovered.

    79. Re:Next up... by Anonymous Coward · · Score: 0

      Okay, I guess you all need a lesson in readability. ;-)

      Remember, it is perfectly valid to pass a null pointer to free(). It just doesn't do anything in that case.

      int allocstuff(void)
      {
          char
              *a = malloc(100),
              *b = malloc(100),
              *c = malloc(100),
              *d = malloc(100);

          if (a && b && c && d) return 0;

          free(a);
          free(b);
          free(c);
          free(d);

          return -1;
      }

    80. Re:Next up... by zizzo · · Score: 2, Funny

      There's no try/catch in C...
      There is only do {} while;

    81. Re:Next up... by wbren · · Score: 1

      You can't read machine code? And you call yourself a programmer! :-)

      --
      -William Brendel
    82. Re:Next up... by Threni · · Score: 2, Insightful

      > That requires one level of nesting for every initialized resource. That can become ridiculous very
      > 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.

    83. Re:Next up... by Criffer · · Score: 1

      int allocstuff(void **a, void **b)
      {
              (*a) = malloc(100);
              if (*a)
              {
                      (*b) = malloc(100);
                      if (*b)
                      {
                              return 0;
                      }
                      free(*a);
                      (*a) = NULL;
              }
              return -1;
      }

      There. No memory leaking. Your free(b) is after a return. And even if you succeed, you leak, since you don't keep hold of your allocations. And this was supposed to demonstrate the virtue of GOTO how?

    84. Re:Next up... by Criffer · · Score: 1

      Just a note (yes, replying to myself): My code above is not only semantically identical to the posted version (aside from storing the allocated pointers somewhere), but also identical from a flow-control point of view The two probably compile to the exact same assembly, since there's only so many ways you can say test %eax; jz label;.

      The difference is, my version is properly nested, so that you can see exactly what exists at what point in the code. This is what Dijkstra was talking about.

    85. Re:Next up... by daVinci1980 · · Score: 1

      There are certainly situations I use goto in, but this type of structured cleanup is not one of them. (There are other types of structured cleanup I use gotos for, just not this one).

      The code I've posted below is, imho, more elegant, easier to understand, and more future proof. Don't let the templates trip you up, I could've just as easily done this without templates using the guarenteed destruction of objects and malloc/free. I just used templates to allow for type safety and an allocator that throws on failure. (Obviously, my object code could just as easily work with return codes, I don't personally like retcodes though, except for certain, very narrow circumstances).

      // This object belongs to a family of objects that work by rolling back if ownership of the resource // still is held by the object at destruction time. This should only normally occur in failure cases.
      template <typename T>
      class ArrayAllocator
      {
              ArrayAllocator(int countToAlloc) : mAllocated(0) { mAllocated = new T[countToAlloc]; }
              ~ArrayAllocator() { if (mAllocated) delete [] mAllocated; } // For easy-to-read client code, no one should take ownership of allocated objects until // there are no further failure conditions possible. This same technique can be used for // ANY resource acquisition, whether it's an allocation of memory, grabbing a socket, mutex, // semaphore, reading a file, etc.
              T* TakeOwnership() { T* retVal = mAllocated; mAllocated = 0; return retVal; }

              T* mAllocated;
      }

      int allocstuff(void)
      { // If any fails, it'll throw an exception and the others will be cleaned up.
                      ArrayAllocator<char> aAlloc(100);
                      ArrayAllocator<char> bAlloc(100);

                      a = aAlloc.TakeOwnership();
                      b = bAlloc.TakeOwnership();

                      return 0;
      }

      --
      I currently have no clever signature witicism to add here.
    86. Re:Next up... by Duhavid · · Score: 1

      Good point. Teach me to pipe up without looking harder. :-)

      --
      emt 377 emt 4
    87. Re:Next up... by karabfak · · Score: 1

      Wait wait wait, I got an idea, can I patent the patent system?

    88. Re:Next up... by Snarkhunter · · Score: 0

      Thank God for Lisp.

      I suppose I really mean whoever dreamed up Lisp, not so much God... wait...

    89. Re:Next up... by rkww · · Score: 1
      I agree that goto's are useful for error handling, but they're not needed for your example:

      char *a = malloc(100);
      char *b = malloc(100);

      if (a && b)
      return 0;

      free(a);
      free(b);
      return -1;
    90. Re:Next up... by Anonymous Coward · · Score: 0

      PARENT: GOTO HELL

    91. Re:Next up... by tqbf · · Score: 1

      Uh, gross? Did you mean to write:

      int allocstuff(char **a, char **b) {
      if((*a = malloc(100))) {
      *b = malloc(100);
      }
      if(!*b) free(*a);
      return(*b != NULL)
      }

      And, you do know you can safely call free() on the result of a failed malloc (guaranteed to be NULL), right?

      Though, if you don't have an answer to what you planned to do in the rest of your program if malloc fails, you have no business coming up with some complicated error reporting protocol instead of simply hooking malloc and gracefully exiting on any failure.

      Glad to help. Please stop using goto now.

    92. Re:Next up... by John-D · · Score: 1

      here's a hint:

      free(0) has no effect.

      that is all.

      ps. every single one of these examples has at least 1 memory leak.

    93. Re:Next up... by andy_t_roo · · Score: 1

      well, i would of thought there is prior art, but perhaps you could patent "a working patent system".

    94. Re:Next up... by that+this+is+not+und · · Score: 2, Funny

      Does the software operating some subsystem for a guided missle scramble like crazy to deallocate all unneded memory before the warhead detonates?

    95. Re:Next up... by Psychotria · · Score: 1

      Or, possibly:

      int allocstuff (void)
      {
            char *a, *b, *c;
            int r;

            a = b = c = NULL;

            a = malloc (100);
            b = malloc (100);
            c = malloc (100);

            r = a && b && c ? 0 : -1;

            if (a && b && c)
            { /* do stuff */
            }

            if (a) free (a);
            if (b) free (b);
            if (c) free (c);

            return r;

      }

    96. Re:Next up... by Psychotria · · Score: 1

      could change the if to "if (r == 0)". Also, the checks before the free's are redundant...

    97. Re:Next up... by MoriaOrc · · Score: 1

      int allocstuff(void)
      {
      nt return_val = 0;

      char *a = malloc(100);
      if (!a) {
      return_val -1;
      }

      char *b = malloc(100);
      if (!b) {
      return_val = -2;
      }

      char *c = malloc(100);
      if (!c) {
      return_val = -3;
      }

      char *d = malloc(100);
      if (!d) {
      return_val = -4;
      }
      // ...

      if( return_val {
      free(a);
      free(b);
      free(c);
      free(d);
      // and so on
      }
      return return_val;
      }
      Seems like this should be a good way to get rid of those redundant free statements.

      This way you only need 1 free statement per failed alloc statement. Just add a free to the return_val 0 block for each allocation. Only downside is that you keep allocating after a failure, which might be a problem if you have a hell-of-a-lot of allocations to do and you fail early on. But I'm sure there's a solution to get by that without goto, also.
    98. Re:Next up... by turbidostato · · Score: 1

      "But c++ is still c !"

      I know you tried a joke here but, no sir, c++ is c no more.

      On the other hand, ++c was not c even at the moment you told it.

      Wait a moment... how does c# compare to c++ (or even to ++c)?

      I think I got it...
      ++c ? c++ : c#;

    99. Re:Next up... by turbidostato · · Score: 1

      "Sorry. I patented vomit last year."

      DON'T be so nasty, please...

      I hope you tried no to be too dirty by properly casting you vomit:
      void vomit()

    100. Re:Next up... by zippthorne · · Score: 1
      Obfuscatory? Here's your code translated by an admittedly poor programmer, me.

      int allocstuff(void)
      {
              int exitstate = -1;
              if(!exitstate) {return -1;} else exitstate++;
       
              char *a = malloc(100);
              if (a) exitstate++;
       
              char *b = malloc(100);
              if (b) exitstate++;
       
              switch(exitstate){
                      case 1:
                              free(a);
                      default:
                              return exitstate;
              }
              free(b)
              return -1;
      }
      Though I don't know why you're trying to catch failures on the return: if that fails, how is the subsequent return going to be any better? I don't see why the gotos are necessarily any clearer.
      --
      Can you be Even More Awesome?!
    101. Re:Next up... by hh10k · · Score: 1

      The correct implementation of new will throw std::bad_alloc on failure, not return 0. Visual C++ 6 was the last compiler I know to just return 0, and you'd be crazy to be using that nowadays. If you want to allocate memory without throwing an exception, you can use new(std::nowthrow).

      Because of this your example has the potential to leak a's memory if b fails, so you need to either catch the exception or use something like boost::scoped_array. It amazes me that people still don't know about RAII in C++.

    102. Re:Next up... by Anonymous Coward · · Score: 0

      wow, I'm sure glad none of you are writing code on my project

    103. Re:Next up... by smartr · · Score: 1
      I'm a bit rusty on my C, but isn't this roughly the same as doing:

      int leakmemory(void)
      {
      char *a;
      char *b;
      if (!a = malloc(100)) {
      if (!b = malloc(100)) {
      return 0;

      free(b);
      }
      free(a);
      }
      return -1;
      }
    104. Re:Next up... by emlyncorrin · · Score: 1


      int exitstate = -1;
      if(!exitstate) {return -1;} else exitstate++;
      Aren't those two lines just a long way of writing

      int exitstate = 0;

      Or am I missing something?
    105. Re:Next up... by Anonymous Coward · · Score: 0

      That rules.

    106. Re:Next up... by pebs · · Score: 1

      You sir, are a moron. You really have no clue about things like embedded systems programming do you? Not everything that needs to be programmed is run by your standard desktop PC. The thermostat in your house or your CD player don't have the luxury of a 3.0 GHz processor with 2 GB memory. Hell, there's still hardware at NASA that runs on old 486's! Not everything can be written using high-level languages like C# or Java. Get a clue about what your trying to talk about before making any comments.

      - HC2


      I'd rather be using assembly language for embedded systems. I'm sure most people would rather use C, but that's too high level for me. In assembly, goto is something you do all the time (jump instructions).

      --
      #!/
    107. Re:Next up... by Anonymous Coward · · Score: 0

      It catches the *exremely* rare edge case where exitstate doesn't get initialized properly.

    108. Re:Next up... by Anonymous Coward · · Score: 0

      oh man, this is probably the first time I've ever laughed out loud from a slashdot comment...

    109. Re:Next up... by exp(pi*sqrt(163)) · · Score: 1
      You really need to get a clue yourself. The compilers for embedded systems don't run on the embedded systems themselves, they run on PCs. The problem of figuring out how to free memory after the failures given above is a completely static problem that can easily be solved by a compiler. If your compiler is unable to automatically generate the kind of rollback code required by the example above then your language is seriously broken. This has nothing to do with the power of the device you're programming. Automatically generating jumps to deal with resource failures applies whether we're dealing with a 512 byte Atmel AVR or a 32MB ARM microcontroller. (Both devices I have experience of programming BTW.) No human should have to do this.

      You sound like some of the embedded systems people I know - they never look out of their cubicles to see what's happening in the rest of the computer science world and still program the way their ancestors did in the 60s.

      --
      Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
    110. Re:Next up... by AmPz · · Score: 1

      Your code fails to handle the case when "char *a = malloc(100);" is successful, but "char *b = malloc(100);" is not.
      Additionally, your code will go on and try to perform "char *b = malloc(100);" even if the previous allocation has failed. Not very nice.

      In your code, the same default case is used for when both allocations are successful, and when both allocations failed. Took me a moment to figure that one out. To me, that is not a good example of clear code.

      The previously posted "goto solution" handles all possible error cases in a optimum way.
      I think forward error handling is a generally accepted use of goto..

    111. Re:Next up... by jnf · · Score: 1

      assuming your reserve() method allocates 100 bytes, where exactly do you think it gets allocated on? (answer: most likely the heap)

    112. Re:Next up... by AmPz · · Score: 1

      Automatic resource freeing is not a static problem. It must be done in runtime.
      When you are writing embedded software, or any hardware-near software, you don't have too many languages to choose from.
      You can use assembly, and for projects with only a couple of kB of binary code, that works OK. For larger projects it quickly becomes a major code maintenance problem. Most of the "modern" high level languages typically lacks compiler support for the hundreds of different processor architectures used in embedded systems.
      Java cannot really be used to talk directly to hardware, but some high level java applications on top of a C-based core is possible. But the problem with java is that it is extremely slow, and uses alot of memory.
      At work, we have a small embedded java application running in a embedded system. The 8bit CPU runs at 20MHz. All this small java application really does is copy 256 bytes from memory mapped device A, to memory mapped device B.
      This java application is however phased out of our products since someone relised that it is much faster to send 256bytes across a 57600bps serial line, than to copy 256 bytes of data in the java application. :)
      Some, but far from all, embedded CPUs have compiler support for C++, but C++ can easily consume alot of resources if you are not careful. But yes, C++ works if you know what you are doing.

    113. Re:Next up... by AmPz · · Score: 1

      Agreed.
      This is one of the better solutions without the use of goto. But the goto solution is cleaner/easier to read, produces fewer assembly instructions, and is faster to execute.

      If a solution based on GOTO happens to be the cleanest solution, then that's the solution you should use.
      Of course, GOTOs are rarely the cleanest solution, but in some cases..

    114. Re:Next up... by Vihai · · Score: 1

      It's not a matter of speed, not in this case, at least. It's a matter of readability, reduction of redundancy and most of all maintainability.

      Unfortunately, it's not easy to determine if this approach is good unless you have extensive coding experience. Several people involved in Linux kernel coding have such experience, I've learned this approach from them and my fair amount of experience convinced me it is a good approach.

    115. Re:Next up... by zippthorne · · Score: 1

      No, it handles that case quite clearly. It probably would've been better to arrange for exitstate to be zero if everything was initialized successfully, but that's left as an exercise for the reader.

      --
      Can you be Even More Awesome?!
    116. Re:Next up... by Malc · · Score: 1

      Does it matter? The point is: I don't have to manage it, any unexpected exceptions will go through the d-tors and free the memory, and I can't accidentally introduce any bugs such as the one the OP had where b was never released. Good coding practices avoid explicitly allocating on the heap and encourage stack objects for this very reason, whether it's for memory allocation or important resources such as a mutex.

    117. Re:Next up... by jnf · · Score: 1

      Well your initial conjecture was that using the heap was bad, and then you proceeded to use the heap. Furthermore, are you saying that good coding practices dictate that one doesn't use the heap and instead allocates on the stack?? I think I may have misunderstood you, but I'm not sure. It's kind of absurd to presume that just because you're using new/delete or using destructors/constructors that you're in the clear, in fact heap exploitation is moving in the direction of attacking the objects themselves instead of heap metadata (although that point is largely irrelevant to the matter at hand)

      Finally, there was no memory leak, the resources would be returned to the system when the program exited. While it would've been proper to deallocate the memory and then exit, it really doesn't matter if all he did was exit.

    118. Re:Next up... by exp(pi*sqrt(163)) · · Score: 1
      > Automatic resource freeing is not a static problem. It must be done in runtime.

      Of course. But figuring out what branches to insert in the example above is static and *easy*, there's no excuse for a language not to do it for you.

      > you don't have too many languages to choose from.

      Yes, it's a pity. There is so much embedded code it's surprising things haven't moved much past how they were in the 60s. But the ideas are out there. There are papers on technqiues like region analysis for figuring out in advance what memory needs allocating, and there are interesting tools like Lava which can serve just as well as programming languages for embedded systems as well as HDLs. There are lots of smart people thinking hard about targeting small devices with functional languages and at some point I'll test this out.

      --
      Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
  3. Good and sad at the same time by scsirob · · Score: 1, Insightful

    It's good to see that this patent is (or appears to be) registered as a free patent that can be used by anyone.

    At the same time it is deeply sad to see that something so obvious and with prior art going back half a century can receive a patent at all. It's just sick.

    --
    To Terminate, or not to Terminate, that's the question - SCSIROB
    1. Re:Good and sad at the same time by jshriverWVU · · Score: 2, Insightful

      I'm curious why it was patented and then let go for free if that's the case. Patents are extremely expensive, and each year are more and more expensive. Just doesnt make sense to patent something so simple, and pay all that money for nothing.

    2. Re:Good and sad at the same time by j00r0m4nc3r · · Score: 1

      It's not just that prior art exists, it's that every single programmer in the entire world KNOWS it exists. But it's PERJURY to claim you invented something and try to patent it knowing full well that it already was invented by someone else. I don't see how any computer programmer could honestly think that they invented software breakpoints (except maybe someone like Dennis Ritchie who probably DID invent them...)

    3. Re:Good and sad at the same time by RingDev · · Score: 3, Interesting

      "It's good to see that this patent is (or appears to be) registered as a free patent that can be used by anyone."

      I'm curious as to how you came to that conclusion. The patent has been published, but I don't see anything in the link stating that the company has a non-enforcement vow.

      -Rick

      --
      "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
    4. Re:Good and sad at the same time by Anonymous Coward · · Score: 0

      Hey, if it makes government bigger, we're all for it.

      -- Your Humble Public Servants

    5. Re:Good and sad at the same time by gstoddart · · Score: 1

      I'm curious why it was patented and then let go for free if that's the case. Patents are extremely expensive, and each year are more and more expensive. Just doesnt make sense to patent something so simple, and pay all that money for nothing.

      Two possible suggestions:

      1) Patent it and make it open before some less-friendly entity tries to do it.

      2) To demonstrate how ridiculous software patents are by getting something as absurd as this patented.

      I mean, let's face it, if the patent examiners granted this patent, they have no business reviewing any patents relating to software, because they're clearly unqualified to do so.

      Really, what's next, a patent to "allow the user to reference memory areas in a computer programs address space using human-readable names" (aka named variables)? If you write it in sufficiently obfuscated patent-ese, some moron will probably approve it since they just seem to rubber-stamp and collect their fees.

      Cheers
      --
      Lost at C:>. Found at C.
    6. Re:Good and sad at the same time by Interfect · · Score: 1

      I'm waiting for them to get sued back to the stone age. Is there anyone in the patent office? Or is it just a big rubber-stamp machine?

    7. Re:Good and sad at the same time by reebmmm · · Score: 1

      It's not a free patent, it's just that it's listed on an online patent viewing site.

      Second, it's not even a patent yet. It's a patent application.

    8. Re:Good and sad at the same time by vagabond_gr · · Score: 1

      It's good to see that this patent is (or appears to be) registered as a free patent that can be used by anyone.

      This gave me a good idea. I think that there should be a mechanism to register free patents (where you irreversibly allow everyone to freely make use of the patent) without any charge for holding the patent (or with a very minimum fee to cover the expenses of the application). It's fair right? I expect no protection or income from my patent so I don't have to pay. Then these patents can be used as strong form a prior art, since not only you can show that a certain "invention" already exists, but that it is also already patented!

      Then let all the open source developers patent everything in their programs and I bet that things like breakpoints will be "freely patented" decades before any patent attempt by any company.

      I guess if someone truly believes that patents contribute to innovation by protecting the inventor's ideas (which I personally do not), he would find it very difficult to refuse the usefulness of such "free" patents.

  4. USPTO Link by MECC · · Score: 4, Informative

    Here.

    Got there from a search at their site...

    --
    "We are all geniuses when we dream"
    - E.M. Cioran
    1. Re:USPTO Link by tomstdenis · · Score: 1

      better is google patents [faster and sexier]

      omg

      Tom

      --
      Someday, I'll have a real sig.
    2. Re:USPTO Link by radtea · · Score: 1


      Thanks for the link. May as well go to the source.

      The first independent claim seems to describe is the following: putting a call to a void function containing no program instructions into your code, and having a second process running that detects when that function is called and then doing something. As is typical of software patents, it is both absurdly broad and stupidly narrow. Read one way it would cover almost any external debugger. But then it defines a specific sequence of actions that the second process will take using a narrowly defined set of components. Also, it specifies in the first independent claim that the called function is void and free of program code, so a system implementing this that made a call to:

      void foo() {}

      would violate the patent but a call to:

      void foo() {int n = 1;}

      would not.

      --
      Blasphemy is a human right. Blasphemophobia kills.
  5. Err, prior art? by RingDev · · Score: 3, Interesting

    Filing Date: 05/01/2002
    Publication Date: 11/06/2003

    Now, I'm pretty sure there is a whole slew of prior are on this, especially since it sounds like they are describing the method Visual Studio uses for break points and debugging. Heck even the debugging tools in VB5 and VB6 fit this description and that's from back in the mid/late 90's.

    -Rick

    --
    "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
    1. Re:Err, prior art? by gstoddart · · Score: 2, Interesting

      Now, I'm pretty sure there is a whole slew of prior are on this, especially since it sounds like they are describing the method Visual Studio uses for break points and debugging. Heck even the debugging tools in VB5 and VB6 fit this description and that's from back in the mid/late 90's.

      Well, I didn't read the specific of how this patent attempts to handle breakpoints, but I was using debuggers with breakpoints on VAX machines in the late 80's ... and those tools had been around a very long time.

      People have had breakpoints in debuggers for a helluva long time.

      Any such patents, IMO, clearly don't pass muster of being anything other than obvious, pre-existing, or sneakily trying to write a special case which is barely different from any existing case.

      Cheers
      --
      Lost at C:>. Found at C.
    2. Re:Err, prior art? by Anonymous Coward · · Score: 0

      They describe a dedicated (co)processor spotting breakpoint 'instructions', that is very different from anything Visual Studio can do. It is however almost exactly how the ROM emulator I used to develop Gameboy,GameGear,Sega Mastersystem & Genesis games implemented breakpoints more than 10 years ago. It used a Xilinx FPGA to emulate a vast selection of ROMS, monitored the datastream and hijacked the running process on breakpoint patterns while alerting the host system. Close enough to nuke this patent.

      Plenty of patent busting prior art even if most /.ers can't bring themselves to read the patent or find relevant examples ;)

  6. That's it. by Manos_Of_Fate · · Score: 5, Funny

    I'm applying for a patent on "A system of tubes, that carries information globally, so as to assist the procurement of pr0n."

    --
    Isn't enough that I ruined a pony, making a gift for you?
    1. Re:That's it. by blantonl · · Score: 3, Funny

      I'd love to see the prior "art" for this one.

      --
      Lindsay Blanton
      RadioReference.com
    2. Re:That's it. by Anonymous Coward · · Score: 0

      I already have a patent that is very similar. The first part reads "A big truck (something that you can dump something on)..."

    3. Re:That's it. by Anonymous Coward · · Score: 0

      This way the competitors will just switch to a more expensive but reliable technology in form of big trucks you can dump something on.

    4. Re:That's it. by Anonymous Coward · · Score: 0

      Free marketing advice: the term "boob tube" is already taken.

    5. Re:That's it. by ObsessiveMathsFreak · · Score: 1
      --
      May the Maths Be with you!
    6. Re:That's it. by krelian · · Score: 1

      Good idea! I've patented "Sex" but I see very slim profits from the slashdot crowd, I'm sure you'll do better.

    7. Re:That's it. by Midnight+Thunder · · Score: 1

      Small correction, to ensure that it gets through:

      I'm applying for a patent on "A system of tubes, that carries information globally, so as to assist the procurement of pr0n, electronically."

      --
      Jumpstart the tartan drive.
    8. Re:That's it. by Octopus · · Score: 1

      [ralph wiggum]
      I patented dump trucks!
      [/ralph wiggum]

  7. No longer news by pembo13 · · Score: 2, Insightful

    At this point, these things aren't really "news" any more, and certainly no longer shocking.

    --
    "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
    1. Re:No longer news by lixee · · Score: 1

      At this point, these things aren't really "news" any more, and certainly no longer shocking.
      What's shocking is that nobody seems to be doing anything about it. It's like that outrageous CBS/NYT poll which shows 28 percent believe members of the Bush Administration are lying about "what they knew prior to September 11th, 2001, about possible terrorist attacks against the United States."

      It's like saying, "yeah, we know, they're all crooks. But whatcha gonna do about it?".
      --
      Res publica non dominetur
    2. Re:No longer news by Goaway · · Score: 1

      No, it's the same thing every single time: Somebody patents some variation on a well-known techinque, or something that vaguely sounds like a well-known technique, somebody else misunderstands the patent and posts a wildly misleading story on Slashdot, nearly everybody rails against software patents, and nobody pays any attention to the daring few who point out that no, that's what what's being patented at all.

  8. Prior Art by orbitalia · · Score: 2, Informative
    oh come on.. Conditional breakpoints have been around atleast since the mid eighties.. for example watcom's wd (watcom debugger) detailed here for QNX/DOS etc.

    Seriously America needs to put a stop to software patents, it's damaging your software industry as Knuth puts very well in his letter to the PTO here

    1. Re:Prior Art by Zontar_Thing_From_Ve · · Score: 2, Interesting

      Seriously America needs to put a stop to software patents, it's damaging your software industry as Knuth puts very well in his letter to the PTO

      It will never happen and I will explain why. I worked for the US government some years ago in my first job after college, so I know how the US government works and how government workers think. You need to understand the following:
      1) US government workers have "skills", and I use the term very loosely, that often have no practical application outside of the US government. In other words, many US government workers can't get equivalent jobs in private industry because equivalent jobs don't exist.
      2) US government workers don't want to lose their jobs any more than anyone else does.
      3) US government workers are very difficult to fire, leading to conditions of essential lifetime employment with very few exceptions. There are exceptions, but they are rare.

      Your typical US government employee stays with Uncle Sam because there are a few decent benefits (vacation and retirement benefits are superior to many companies in private industry) and the jobs are often low stress. Pay does lag behind private industry in many cases and because of #1 that I mentioned earlier, you have a lot of people who are screwed if they lose their government jobs because they don't have any useful skills for private industry. Where I worked, most younger employees with any motivation and useful skills (I work in IT) left after 3-7 years for better pay in private industry and better jobs. Government work is pretty boring, if safe.

      What has happened with the patent office is that now that they approve everything they can, they get more money coming in. More money coming in means that they are more important to the federal government because they bring in the bucks. They don't exist to consume tax dollars, they bring in revenue. To Uncle Sam, it's a win-win. He gets more money and businesses get "the tools they need" to protect their "valuable intellectual capital". More money to the Patent Office means they need more employees, which means they need more managers, which means pay goes up for managers. Now you have a bloated government office that has every incentive there is to protect itself and protecting itself can only be done if they bring in the bucks. Fewer patents means fewer examiners, which means fewer managers, which means people who have no useful skills for the outside world might be forced to find jobs in that outside world. Government employees are masters at protecting their own interests, so they just tell Congress and the President that they are doing a "vital service" to business. Business = money. Money = tax revenue. Tax revenue = good. Don't expect the President or anyone in Congress to ever think that patents = bad. Why on earth would reducing the size of a government agency that makes money instead of consuming money ever be good? I certainly respect Knuth, but the Patent Office guys will just paint him as an idealist in the academic world and ignore him. Remember, if patent reform ever happens, a lot of pissed off government employees, including managers, will lose their jobs because we'll need fewer of them and they will do everything they can to prevent that day from happening. Surely you all understand the idea of self-preservation.

    2. Re:Prior Art by Proteus · · Score: 1

      the Patent Office guys will just paint him as an idealist in the academic world and ignore him. Remember, if patent reform ever happens, a lot of pissed off government employees, including managers, will lose their jobs because we'll need fewer of them and they will do everything they can to prevent that day from happening. Surely you all understand the idea of self-preservation.

      Despite your cynical yet accurate view of the situation at the Patent Office, I don't think anyone is seriously considering getting the Patent Office itself to change its mind on software patents. I think most people have already come to the conclusion that patent reform has to come through a combination of legislation and court action.

      Yes, Congress will ask the Patent Office for its opinion; no, it won't matter much in the face of significant lobbying pressure.

      The single largest resistance to patent reform are the large, monied, and legislatively-active corporations that stand to lose from patent reform. That is, IBM, Microsoft, Oracle, and so on. Software patent reform is only likely to occur if large, monied organizations start to lobby for it. This happens to some extent, in the form of PubPat and the FSF (among others), but until players with size and funding to challenge the Big 7 (Google comes to mind) choose to enter the fray, it's going to be slow going.
      --
      We may not imagine how our lives could be more frustrating and complex—but Congress can. – Cullen Hightower
    3. Re:Prior Art by addie+macgruer · · Score: 1

      Lucid and intelligent; if only they'd listen. Besides which, Professor Knuth? I $\heartsuit$ his work, use it for all my technical reporting at the office.

    4. Re:Prior Art by addie+macgruer · · Score: 1

      Lucid and intelligent; if only they'd listen.

      Besides which, Professor Knuth? I $\heartsuit$ his work, use it for all my technical reporting at the office.

    5. Re:prior art by Mr+Z · · Score: 1

      This particular patent looks to be a rather unusual and somewhat odd way to implement breakpoints. You put the breakpoints in at compile-time as function calls to an empty function, and then the debugger (if it's running) puts a trap in that empty function. The technique isn't too far, though, from some ancient and well known techniques.

      I once implemented a debug monitor in a similar manner: Call a magic location. If the monitor's present, see if the host wants anything. If the monitor's not present, it's a NOP. Similar concept. In my case, though, I was implementing remote watch windows over a special parallel-cable link. The monitor request poll just lived in the idle loop. The test was cheap enough I actually left it in my production code. (Look for EC_POLL and friends.) The monitor itselfis pretty simple and kinda cool. (Source: INTV-side ASM and PC-side C code)

      Prior to that, I had implemented a monitor for an 8052 board that used the "call-instruction-as-breakpoint" technique. If you wanted a breakpoint in a loop, you were advised to assemble NOPs or a call to the breakpoint function into your app, because the normal breakpoint clearing technique (replace the call with the original code) meant you couldn't hit the breakpoint more than once. The breakpoint design wasn't mine. I'm pretty sure every CPU board we had in the lab for the particular modular computer system we had used the same technique. (It was a custom system designed by our professors and implemented incrementally over the years by students.)

      Methinks there's lots of prior art in this space. Even if EPSON's exact way of doing it wasn't previously widely known, it's close enough to other techniques that it brings the novelty and obviousness into question.

      --Joe
  9. I think this is a bit different by AKAImBatman · · Score: 4, Insightful
    I'm not up on my patent-ese, but I think this is describing a specific type of breakpoint technology based on virtual functions. Since we've been talking about Javascript so much lately, and it's so easy to do virtual functions in JS, here's an example in JS code:

    Debugger.breakPoint = function()
    {
    //do nothing
    };
    Now if you put the function in your code, nothing happens:

    Debugger.breakPoint();
    But if you have the debugger initialized, it will replace the virtual function like this:

    Debugger.breakPoint = function()
    {
        Debugger.runDebuggerAndStopTheWorld();
    };
    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.
    1. Re:I think this is a bit different by Mr.+Underbridge · · Score: 3, 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.

    2. Re:I think this is a bit different by mike.mondy · · Score: 1

      Didn't check the patent for details, but the MULTICS probe debugger had conditionals, functions, and I think hooks from the program being debugged to the debugger. Hmmm, I wonder if functions created within the debugger would be found by the dynamic linker... (MULTICS is/was an OS from the '70s; UNIX is a play on the MULTICS name.)

    3. Re:I think this is a bit different by Anonymous Coward · · Score: 0

      Sooooooo, how is this any different then me using printfs to check my code?

    4. Re:I think this is a bit different by escay · · Score: 5, Informative
      From what I understand (read the invention background section in the patent) This is a patent about the implementation of a breakpoint handling mechanism, not the idea of using breakpoints to debug itself. specifically, conventional breakpoint sends a software interrupt that is either caught by (a) the debugger, pausing/halting program execution or (b) the OS, in case no debugger is present, resulting in a system hang or crash. Also the assembly halt code may vary for different processors.

      The patented breakpoint function catches interrupts and handles them in a specific way, irrespective of whether a debugger is running or not, and also issues CPU-indepedent halt codes, marking an improvement over existing techniques.

      Karma whoring, you say? I just have a fascination for patents.
    5. Re:I think this is a bit different by AKAImBatman · · Score: 2, Insightful

      I can believe that. MULTICS was a truly incredible operating system, but is so poorly known by the programming public at large. It wouldn't surprise me at all if HP reinvented something that was already invented in MULTICS.

      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. :-(

    6. Re:I think this is a bit different by Xtravar · · Score: 1

      That would be called a "function pointer" or "delegate" in "real programming terms".
      A "virtual function (or method in non C++)" is similar, but it is accessed through a pointer within the object that points to a virtual function lookup table. In other words, using obj->Function() translates to obj->vfnptr[NUM]()

      Yay for pedantry. Now who cares?

      --
      Buckle your ROFL belt, we're in for some LOLs.
    7. Re:I think this is a bit different by jimicus · · Score: 1

      Something like that's existed in debuggers for years - it's quite common to set up conditional breakpoints and the like.

      I think it's a bit more complicated. I'm not quite sure I fully understand it, but I think clause 14 is talking about scripting a debugger.

    8. Re:I think this is a bit different by nanosquid · · Score: 1

      Yes, but that's not new either; people have been doing that since at least the early 80's.

    9. Re:I think this is a bit different by pclminion · · Score: 2, Informative

      I actually slogged through the entire patent, and to my (unprofessional) eye it certainly looks like they have patented ALL methods of software breakpoints which use a "specially named void function" which is inserted at a specific place in the code by a compiler or linker. That is essentially the definition of a software breakpoint, so they basically have patented the concept of a software breakpoint in general.

      Of course, we have to figure out what "specially named void function" means. If it means the function returns void, I guess we could just return an int instead to get around the patent ;-)

    10. Re:I think this is a bit different by Anonymous Coward · · Score: 2, Informative

      Prior Art.

      The positively ancient PDP-11 had an instruction called BPT (Breakpoint Trap) which allowed debuggers to work.
      You then put BPT in your code. This was often enabled via macros and conditionals supplied to the compiler at compile/assemble time. The debugger attached itself to the interupt generated by the BPT instruction and hey presto you have debugging.

      I am sure that other Computers had similar instructions.

      It is just plain silly for this to be patented. Things like go to make the suppoed lead in all things IT that the USA has just look more like SCO FUD every day.

      I'm also very glad that the US Supreme Court has rules that US Patents don't have any legal standing outside the 50 States of the USA.

    11. Re:I think this is a bit different by sconeu · · Score: 1

      INT 3 on x86.

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    12. Re:I think this is a bit different by lamber45 · · Score: 1
      I can tell you read the patent. However, I'm not sure how compiled-in breakpoints are more useful than the ability of most debuggers to replace just about any instruction with a breakpoint. It might be helpful to avoid triggering spurious bugs during debugging on highly-pipelined instruction sets; ...

      I also noticed that the patent-writer listed gcc as a compiler that could (with suitable modifications) produce code that would be a use of the patent. Talk about adding insult to injury!

      I should probably go look in the Wine debugging macros and see if any of them could be considered prior art for this...

    13. Re:I think this is a bit different by Chris+Burke · · Score: 1

      We might all be using MULTICS derivatives today if Honeywell hadn't tried to compete against their own computers.

      Yep, which at the very least would mean we'd be free of all those horrible UNIX puns -- UNIX being a pun on MULTICS (and of course eunuchs) which started the whole thing going.

      --

      The enemies of Democracy are
    14. Re:I think this is a bit different by Anonymous Coward · · Score: 0

      Ook!

    15. Re:I think this is a bit different by Goaway · · Score: 1

      And I'm not sure how the usefulness or lack thereof has any bearing on the fact that Slashdot totally misunderstood the patent, as they do in every single patent outrage story?

  10. I have a ton of prior art on this one by bherman · · Score: 4, Funny

    Take any of my code....it has a ton of breakpoints. Usually any function with an input breaks at that point.

    --
    Error: Sig not found.
    1. Re:I have a ton of prior art on this one by zappepcs · · Score: 1

      Hey! Where do you work???? you sound like the guy that works two cubes down from me?

    2. Re:I have a ton of prior art on this one by flamdrag · · Score: 1

      Hey!!!! (guy two cubes down)

  11. The Earth has been patented by kirils · · Score: 0, Troll

    why not patent the execution of code and debbuging of code on a sheet of paper? hell, somebody please do bomb the Bureau of US patents!

    --
    Do not. Touch. Down.
    1. Re:The Earth has been patented by MiniMike · · Score: 0

      Sorry, I patented "A Method For Devising A Plan to Bomb the Bureau of US Patents" in 1997.

      It's never done me much good (until right now), as the place (mis?)handling patents is called the 'United States Patent and Trademark Office'. Should have done more research first, I guess. But that's probably the reason it was approved so quickly...

    2. Re:The Earth has been patented by Known+Nutter · · Score: 1

      hell, somebody please do bomb the Bureau of US patents!
      you will be visited by nasty men in smart suits very soon.
      --
      Beware of the Leopard.
  12. What's a breakpoint? by seniorcoder · · Score: 3, Funny
    I assisted in the hiring of a mid-level developer for our team.
    One week into his new job, I suggested he set a breakpoint in his code to quickly determine the cause of a problem. He said: "What's a breakpoint?"
    A month later he was fired.

    How does a developer manage to work for a few years without knowing what a breakpoint is?

    1. Re:What's a breakpoint? by burris · · Score: 1

      Easy, you work in an environment that has no or poor debugger support. For instance, I don't know any Python programmers that use the debugger. They all use extensive logging.

    2. Re:What's a breakpoint? by tomstdenis · · Score: 0, Troll

      I've run into "developers" who don't know the stages of compilation. I've been asked what "preprocessing" means in the lab before [at a workplace].

      There are many "coders" out there that have very minimal training. it's optimism [oh they're improve] and sheer ignorance that keeps them employed. Anyone in the workplace doing a developers job should know how to use a debugger, memory testing tool [e.g. valgrind], and the ins/outs of their development suite. Short of that they're just incompetent and don't deserve a developers job.

      Tom

      --
      Someday, I'll have a real sig.
    3. Re:What's a breakpoint? by Anonymous Coward · · Score: 0

      I'm about to start my 4th year at my university doing CS, and I don't know of anyone else in my major who knows what a breakpoint is or how to use them

    4. Re:What's a breakpoint? by $RANDOMLUSER · · Score: 1

      Indeed. There is a major school of thought (Linus Torvalds and Brian Kernighan spring to mind) that debuggers are an evil waste of time. I've always found that thinking about the problem (and reading the code again) and maybe a well-placed printf was far faster and more valuable than a debugger session.

      --
      No folly is more costly than the folly of intolerant idealism. - Winston Churchill
    5. Re:What's a breakpoint? by exp(pi*sqrt(163)) · · Score: 4, Funny
      > How does a developer manage to work for a few years without knowing what a breakpoint is?

      His code always worked first time?

      --
      Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
    6. Re:What's a breakpoint? by niceone · · Score: 2, Funny

      How does a developer manage to work for a few years without knowing what a breakpoint is?

      by writing completely bug free code?

      What are these breakpoints of which you speak, anyway?

    7. Re:What's a breakpoint? by FauxPasIII · · Score: 1

      > I'm about to start my 4th year at my university doing CS, and I don't know of anyone else in my major who knows what a breakpoint is or how to use them

      What University would that be ?

      (Incidentally, the perfect answer would be "A major one".)

      --
      25% Funny, 25% Insightful, 25% Informative, 25% Troll
    8. Re:What's a breakpoint? by dodobh · · Score: 2, Funny

      printf(3)

      --
      I can throw myself at the ground, and miss.
    9. Re:What's a breakpoint? by Teancum · · Score: 1

      I had a roommate who on the very day he was graduating with a degree in computer science (he was even wearing his graduation robes at the time) asked me on how to format a floppy disc for an assignment he needed to hand into one of his professors.

      It wasn't just "I don't know what the switch is to get this disc format for this older system", but rather "I don't understand why I can't get this disc to work.... I need to format it but I don't know how to even start."

      It is possible to graduate with a degree knowing quite a bit about "computer science" but never really getting the practical knowledge on how to develop software systems, including the use of breakpoints, debuggers, and proper software engineering practices. Your story here doesn't surprise me in this aspect as well, even though I feel sorry that such individuals have avoided practical education with their academic learning until they get into the "real world".

    10. Re:What's a breakpoint? by Anonymous Coward · · Score: 0

      I had a similar incident, but this time, with an interview candidate. I asked him how he goes about debugging programs, but I was not able to get a coherent answer (I expected him to mention breakpoints, watchpoints, etc.).

      Finally, I asked him whether all his programs have run correctly the first time they were executed. To which, he replied, "Yes, always".

      Great, I thought. I don't deserve to have you work for me.

    11. Re:What's a breakpoint? by Anonymous Coward · · Score: 0

      Proper software engineering practice is testing for regressions, not using a special tool to have the computer tell you what your code actually does because you no longer understand it.

    12. Re:What's a breakpoint? by Anonymous Coward · · Score: 0

      Maybe he debugged by tracing. Atleast with embedded systems breakpoints are not always that usable.

  13. Fuck patents by dattaway · · Score: 2

    A bad law is an unenforceable law.

    1. Re:Fuck patents by sehlat · · Score: 1

      Would you care to repeat that statement to all the people sued by the MAFIAA over the years who have watched their bank accounts dwindle in the face of the "unenforceable" DMCA?

    2. Re:Fuck patents by Anonymous Coward · · Score: 0

      A bad law is an unenforceable law.

      Clearly you don't toke.
  14. How Patents Work by rilister · · Score: 3, Informative

    Hey people - I read TFA and there's no detail whatsoever attached.

    Before y'all get real excited about insane patents:

    1) This is a patent application, NOT a granted patent. Hence the serial number beginning 2003 - this means the application was submitted in 2003. It should have been processed now. I'll take a look if I get a spare moment.

    2) This is a snippet from the patent abstract, I'd say. It doesn't mean much at all - abstracts are pretty irrelevant to the content of a patent. We have no idea what they are actually patenting from this: it could be an entirely new mechanism for doing this, new code, a genetically engineered cow with the capability of implementing breakpoints.

    The abstract means NOTHING - it's often not supposed to. Don't have a cow, guys.

    --
    'This writing business. Pencils and what-not. Over-rated if you ask me. Silly stuff. Nothing in it' - Eeyore
    1. Re:How Patents Work by karolgajewski · · Score: 4, Informative

      If you look up the application number in the USPTO, you will see that it has indeed matured to patent: US 7,055,140

      The enforcability of this patent, however, is left to the discretion of the patent owner.

      --
      - .k. -
    2. Re:How Patents Work by Anonymous Coward · · Score: 0

      What the parent meant to say is "Don't have a genetically engineered cow with the capability of implementing breakpoints." That would infringe on the patent. Any other cow you are more than welcome to have.

  15. hardware debugger by Anonymous Coward · · Score: 5, Informative

    its a hardware debugger or so it appears, not a software one, they specifically address pitfalls with software debuggers and why they did this method.

    while hardware ones arent totally new, they arent that common either. gdb is immune from this for example since its software only.

    the abstract isnt the patent, the title isnt the patent, the claims are the patent. Readers are encouraged to read the claims and not spread FUD because they can.

    1. Re:hardware debugger by richie2000 · · Score: 4, Insightful

      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
    2. Re:hardware debugger by thomasa · · Score: 2, Informative

      I worked on a hardware debugger back in the early 80s working
      on 8080 based software. Intel hardware debugger. You could
      set break points in hardware. It would continually check the
      address bus when it saw the address of the breakpoint, it would
      interrupt the execution. It had 8 inch floppy disks too.

    3. Re:hardware debugger by Anonymous Coward · · Score: 2, Insightful

      Readers are encouraged to read the claims and not spread FUD because they can.


      This is Slashdot... you must be new here.
    4. Re:hardware debugger by thomasa · · Score: 1

      correcting myself, it was actually about the mid 70s

    5. Re:hardware debugger by FrankSchwab · · Score: 1

      Actually, no.
      "In this example, instead of placing a special instruction in the place of interest in the source code, a software call to a specially named function is issued. There is no other function of the same name in the code and the debugger always sets a breakpoint at the function of that name. Using an exemplary specially named function, _DebugBreak, what would happen would be the program would execute until it reaches the place where _DebugBreak would be called. The debugger would detect this. The name of the function, _DebugBreak, would be recognized. Then, the exemplary desired action would be to break the execution at the place where _DebugBreak returns. The net result would be that the programs breaks the execution and allows single stepping at exactly the place the programmer intended. "

      This example from the patent is simply a debugger macro run on every invocation that sets a breakpoint on return from "_DebugBreak". Or, an IDE that remembers where your breakpoints are located for every invocation of the debugger, or reload of the program. Run the debugger on a different processor? No problem, GDB would be more than happy to run the macro and set the breakpoint on "_DebugBreak". Use a different programming language? No problem, GDB would be more than happy to run the macro and set the breakpoint on "_DebugBreak".

      I gotta start writing patents. /frank

      --
      And the worms ate into his brain.
    6. Re:hardware debugger by Anonymous Coward · · Score: 0

      Ok, so why don't we call it a logic analyzer?

    7. Re:hardware debugger by rlp · · Score: 1

      DEC PDP-11 (circa early '80's) had a set of lights and toggle switches for hardware debugging. It supported breakpoints and single stepping.

      --
      [Insert pithy quote here]
    8. Re:hardware debugger by Anonymous Coward · · Score: 0

      while hardware ones arent totally ne

      If they aren't tottally new, why did they get a patent for it??

    9. Re:hardware debugger by SL+Baur · · Score: 1

      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. The diagrams didn't show up too well and the English is pretty bad.

      As I understand it, this invention is targeted at debugging ROM executable images on embedded devices. The programmer codes static calls to a breakpoint function in the source code, which will default to do nothing if the image is not being run under a debugger. Various kinds of debugging functions can be coded up and can be enabled under the debugger. Looks kind of useful actually for debugging problems with a cellphone if you have spare ROM to link in debug info.

      Hardware debugging does not count, chip specific hardware breakpoints do not count either. The patent applies to a processor and language agnostic environment.
    10. Re:hardware debugger by Midnight+Thunder · · Score: 1

      Surely hardware debuggers existed long before software ones? If I remember the history of computing the notion of software was only added later - software being changing the systems characteristics without manually changing hardware state.

      --
      Jumpstart the tartan drive.
    11. Re:hardware debugger by Kvasio · · Score: 1
      Ok, so why don't we call it a logic analyzer?


      The patent system? Because there is no logic used by USPTO during patenting process, that's why.

  16. Can I Patent Bugs? by Anonymous Coward · · Score: 0

    Here is the business plan:

    1) Patent IDE (Did MS beat me to this?)
    2) Patent Breakpoints for finding bugs
    3) Patent Bugs
    4) Write REALLY bad IDE to force programmers to write buggy code (Oops, guess this step isn't needed)
    5) IDE phones home for each bug found using a breakpoint
    5) PROFIT TWICE!

  17. History of the breakpoint? by minotaurcomputing · · Score: 1

    Can anyone point to a nice reference concerning the history of breakpoints? I have to imagine that they go back to the beginning of (at least), high-level programming languages.
    -m

    1. Re:History of the breakpoint? by Intron · · Score: 1

      I once used an async computer, the PDP-16. If you disconnected a control wire, it would run until it got to that operation. The voltage on the wire would go high (or low, I forget). Since the control circuit was broken, it wouldn't proceed past that point -- a literal breakpoint. Hooking the wire back up allowed control to continue.

      --
      Intron: the portion of DNA which expresses nothing useful.
  18. Doesn't seem like much innovation by ComSon0 · · Score: 1

    This little section below seems to summarize what is being patented: The recognition of a call and automatically placing a breakpoint. I use ddd/gdb everyday and I see this being useful when working with a few dynamically linked files...

    I just don't think this is innovative enough to be awarded a patent. Does anyone know of any package that already does this?

    From the patent in question:
    [0038] In this example, instead of placing a special instruction in the place of interest in the source code, a software call to a specially named function is issued. There is no other function of the same name in the code and the debugger always sets a breakpoint at the function of that name. Using an exemplary specially named function, _DebugBreak, what would happen would be the program would execute until it reaches the place where _DebugBreak would be called. The debugger would detect this. The name of the function, _DebugBreak, would be recognized. Then, the exemplary desired action would be to break the execution at the place where _DebugBreak returns. The net result would be that the programs breaks the execution and allows single stepping at exactly the place the programmer intended.

    1. Re:Doesn't seem like much innovation by russotto · · Score: 1

      It's not innovative at all. It's been done before. Look up ""DebugStr" (a Mac function circa 1984 -- there's also one called "Debugger"). And Apple's programmers didn't invent it either; it almost certainly goes back to mainframe days.

    2. Re:Doesn't seem like much innovation by Anonymous Coward · · Score: 0

      Embedded debuggers work like this already -- C program symbols _cinit, _cexit, and I/O points are looked up by the debugger at code download time. The debugger stops at these points automagically to do service at those points of the program.

      Sounds like they just added another magic symbol to halt the CPU at.

  19. Prior Art by gorrepati · · Score: 1

    This could be a valid patent if somebody did it in 50's or 60's, though it would have expired by now. How come a technique that has been in use for so long be patented? I cannot but observe that this is incompetence of the highest nature on part of the present day patenting process.

    --
    You will never have experience until after you needed it.
  20. Not legal to patent such things. by zzo38 · · Score: 0

    I heard it is not legal to patent such things. To patent something that has been used all the time and is a publicly known to everyone in that field, it cannot legally be patented. Of course, the patent office doesn't care they will patent anything just because they will get paid for anything they patent.

  21. are you kidding? by nanosquid · · Score: 4, Insightful

    "Free patents online" is a service that lets you search for patents on-line for free; the patents themselves aren't "free".

    1. Re:are you kidding? by Pharmboy · · Score: 1

      Oh, I thought "Free patents online" was just another RMS cause.

      --
      Tequila: It's not just for breakfast anymore!
  22. Re:for you non-programmers.... by Wolfger · · Score: 1

    Uh, no. Not worthy of a patent. Maybe at the dawn of programming it was, but there's the concepts of "prior art" and "obvious" that should have easily precluded its being patented in 2007. The fact that this patent passed is scary, and a good indicator that we need to scrap the whole system before some idiot patents "breathing" or "eating" or "using the toilet".

  23. Re:for you non-programmers.... by Anonymous Coward · · Score: 0

    Shut up, idiot. Oh, and if you were trying to be sarcastic or ironic, don't give up the day-job.

  24. Seems somewhat original to me by thekel · · Score: 1, Interesting
    The implementation is different from the breakpoints I have ever seen used in a programming language or debugger.

    U.S. Pat. No. 6,249,907 to Carter et al. (the "Carter reference") is directed to a system for debugging a computer program in which a user specifies breakpoint types prior to compiling the computer program. A breakpoint type may be, for example, a statement that references a particular variable, a middleware statement, a file input/output statement, or a verb statement. During compilation, the compiler inserts a hook function call in the object code at each instance of a statement corresponding to a specified breakpoint type. When the program processes a hook function call, execution of the program stops and control is transferred to the debugger. The Carter reference discloses that the computer program being tested makes a call (and may pass parameters) to the debugger. In other words, the Carter computer program is "aware" that it is being debugged. Because some bugs occur only under specific execution conditions, arising especially in time dependent or multi-threaded applications, disruption of program execution by the Carter debugger may mask a bug that would occur only during "normal" execution. Further, the Carter reference does not teach or suggest a solution to the problem of processing a breakpoint interrupt when the debugger is not running and is, therefore, unable to handle the interrupt. In addition, each compiler that uses the Carter method must be modified to insert hook function calls in the object code.
    1. Re:Seems somewhat original to me by thekel · · Score: 2

      Oops... I read the wrong part, mod my post down. It's not the patent.

    2. Re:Seems somewhat original to me by kalaf · · 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...

    3. Re:Seems somewhat original to me by Teancum · · Score: 2, Informative

      I've seen this done before... or at least something that could be interpreted along these lines.

      In fact, the "software hook" that is referred to here I've also seen a software interrupt added into compiled code that during normal operations would simply have an IRET (interrupt return) op code on the ISR (interrupt service routine). But you could also have an independent debugger also run simutaneously doing all manner of evaluations on the software execution and performance evaluation. Or even evaluate CPU registers and perhaps even variables and other aspects of memory management. "Parameter passing" isn't even unusual even for interrupts.

      I will agree that debugging multi-threaded applications can be a near nightmare due to the race conditions and timing issues, it doesn't have to be nearly so big of a deal as this patent seems to indicate.

      This patent seems to imply that the tools which a competent software developer commonly uses are relatively unknown. It sounds here like this particular individual re-invented the wheel thinking he/she was very clever for having done something that their computer science professors never talked about when they were in school. This isn't that original, but trying to convince a non-programmer that it isn't may be a little harder.

      Instead, this individual should have patented something truly remarkable and non-obvious like assigning the value zero to a memory cell.

  25. Missed the bus by JoelMartinez · · Score: 0, Troll

    JMP JPM Kriss Kross'll make ya JMP JMP

  26. Goto in code? by www.sorehands.com · · Score: 1

    Is that patent for gotos in code? What about when someone says, "Goto Hell?"

  27. don't get yer panties in a wad yet by uab21 · · Score: 2, Informative

    It's not patenting breakpoints, per se that I can determine. It's a software breakpoint put into code pre-compile, and then you can attach a debugger later to take advantage of the hook points put into the code as void functions, but the program can run normally without a debugger attached and not crash the system (which fixes a problem evident from one of the referenced patents (Carter)). Dunno about prior art for this implementation, but breakpoints in general are not claimed in this application.

    1. Re:don't get yer panties in a wad yet by Teancum · · Score: 2, Informative

      If this is the patent, even this narrow definition has incredibly ancient (for computer software development) practice. I personally used such "software breakpoints" in software on an Apple ][ computer, back in 1977. And on other computer systems as well.

      This sort of breakpoint wasn't even new then, or something novel. In short, the complaints about this sort of patent as simply covering existing practices is valid, and yet another example of how the USPTO is royally screwing up in their understanding of software development practices.

      Of course, I very strongly believe that software should never be patented in any form in any situation, but even if you accept the bizzare concept of a software patent it should cover something new and innovative. Certainly not 40 year old concepts. Perhaps even 60 year old concepts, or even something Ada Lovelace came up with in the 19th Century.

      I'm certain that Adm. Hooper is spinning in her grave over claims of originality for some of these patents, and in particular this one. It wouldn't surprise me if she implemented this idea into some of the compilers which she wrote back elsewhen.

  28. WOW!!!! by Anonymous Coward · · Score: 0

    This is more awesome then the day Awesome McAwesom came to Awesometown!

  29. Hey, I am working on my patent by Stormcrow309 · · Score: 1

    I am working on a patent on finding and correcting inconsistances, mistakes and unintended results withing the source code of a computer program by use of an application. It is to go with my application for typing source code patent.

    --

    In God we trust, all others require data.

  30. Intel has prior art by rebill · · Score: 1

    In 1989, the lab I worked in had two Intel ICE-85 (In Circuit Emulator) machines, which could debug hardware instructions.

    Along with a big IBM boat anchor of a laser printer, our lab was always nice and toasty in the wintertime ... Summer wasn't so pleasant.

    --

    Chivalry is not dead, it's just frequently misspelt. - M. Langley

    1. Re:Intel has prior art by that+this+is+not+und · · Score: 1

      It probably had bond-out 8085 processors. That means a special version of the 8085 processor with hardware tap points to monitor and control things not normally brought out on the regular chip package. I have an Intel Development system for the 8051 that features a bond-out target processor. I also have a box full of spare bond-out processors.

      That's the really expensive stuff in the old-school world.

  31. Dammit I'm too late by grumpyman · · Score: 1

    I'll try to patent the use of 'print' statement in debugging.

  32. I just patented CODE WITHOUT COMMENTS by giafly · · Score: 4, Insightful

    to prevent horrors like OP. Did you notice how the "free(b)" call was after an unconditional return? Somebody didn't.

    --
    Reduce, reuse, cycle
    1. Re:I just patented CODE WITHOUT COMMENTS by Anonymous Coward · · Score: 1, Insightful

      That's reasonable - if more code is added that may fail, and hence require b to be freed, then the free() is already there as a reminder.

    2. Re:I just patented CODE WITHOUT COMMENTS by Vihai · · Score: 2, Informative

      to prevent horrors like OP. Did you notice how the "free(b)" call was after an unconditional return? Somebody didn't.

      Yes, the compiler will happily optimize it away, however, when you are adding another allocation you don't have to remember to add the deallocation code you left out before. You may well comment it if the compiler doesn't like it but only if you licensed the comments patent :)

    3. Re:I just patented CODE WITHOUT COMMENTS by c · · Score: 1

      > Did you notice how the "free(b)" call was after an unconditional return?

      Yeah. I'm kinda wondering what sort of development shop this coder works in where "success" means you leak a couple hundred bytes (or so) of heap, but failures are cleaned up properly.

      Should I just say "Microsoft" and save everyone else the trouble?

      c.

      --
      Log in or piss off.
    4. Re:I just patented CODE WITHOUT COMMENTS by Anonymous Coward · · Score: 0

      Did you notice how the "free(b)" call was after an unconditional return?


      Yes. I also noticed that the function was called "allocstuff", so presumably this part was deliberate, and the real error was in not handing off the pointers to the caller.

      Better luck next time :-)
    5. Re:I just patented CODE WITHOUT COMMENTS by doctormetal · · Score: 1

      Yeah. I'm kinda wondering what sort of development shop this coder works in where "success" means you leak a couple hundred bytes (or so) of heap, but failures are cleaned up properly.

      A RAM chip developer?
    6. Re:I just patented CODE WITHOUT COMMENTS by Per+Abrahamsen · · Score: 1

      You could argue that a comment would remove the doubt. However, this is presumable a standard idiom used everywhere in the code by the poster, and such idioms should not really be explained every time they are used. They would be better placed in a separate "coding standards" document.

    7. Re:I just patented CODE WITHOUT COMMENTS by Vihai · · Score: 1

      It's obviously a proof of concept where the success case is not interesting. It is to show what happens in case of ERROR. Is it too hard to understand?

  33. patent patent applications by jmyers · · Score: 1

    Perhaps we should patent the process of applying for a patent and then sue anyone who tries to patent anything.

    1. Re:patent patent applications by Anonymous Coward · · Score: 0

      I was going to make that joke, but I guess I'll just have to settle for patenting it, instead.

  34. FORTH by nagora · · Score: 1

    Isn't this how at least some FORTH debuggers have worked for decades?

    --
    "Encyclopedia" is to "Wikipedia" what "Library" is to "Some people at a bus stop"
  35. in other patent pending news by psbrogna · · Score: 2, Funny

    I'm in the process of getting "software bugs" patented. No worries- I'm planning on being quite liberal with licensing, just a modest subscription based royalty fee.

  36. Re:I think this is a bit different - Not Really by evought · · Score: 4, Insightful

    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.

  37. Well? Make a point! by EmbeddedJanitor · · Score: 4, Interesting
    Prior art never seems to be much of an obstacle to getting patents. This keeps the patent industry active, which of course appeals greatly to the patent lawyers.

    I recently had a look at the area in which I have one of my patents and found no less than five patents which have claims that mine had. One of them even cited my patent in the search list and still made conflicting claims that were allowed.

    This situation is of course ridiculous. There is no accountability in the patent system. That is, there is no feedback in the system that ensures the USPTO provides high quality patents. The USPTO does not get sued if they give out stupid patents. No, you need to hire a patent lawyer and go sort it out in court. There are even some patent lawyers that specialise in mining the patents for prior art conflicts and solicite business that way.

    This situation wiill not fix itself because those in the system really like it the way it is. The USPTO keeps cranking out money for Uncle Sam by essentially selling the same property many times over. The lawyers love it. They get to charge fees to apply for a patent, then get to charge even more to fix the mess caused by broken patents. So why would it change?

    The only way it will change is if the practitioners become accountable for their actions. If they issue a bad patent then USPTO should pay for fixing the mess. USPTO would not like that, but it would soon improve patent quality. That would reduce patent disputes too, so the lawyers would not like it either.

    --
    Engineering is the art of compromise.
    1. Re:Well? Make a point! by RingDev · · Score: 1

      "This situation is of course ridiculous. There is no accountability in the patent system. That is, there is no feedback in the system that ensures the USPTO provides high quality patents. The USPTO does not get sued if they give out stupid patents. No, you need to hire a patent lawyer and go sort it out in court. There are even some patent lawyers that specialise in mining the patents for prior art conflicts and solicite business that way."

      Is there a legal reason why the USPTO can not be sued? Hypothetically, if I as an inventor had to spend $100,000 in legal fees defending my invention against bad patents, why can I not turn around and sue the USPTO for issuing a patent on something that is obvious, has prior art, or is for some other blatant reason non-patentable?

      -Rick

      --
      "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
    2. Re:Well? Make a point! by EmbeddedJanitor · · Score: 2, Informative
      The damage of bad patents can be huge: a small company can be set up around one patent and a screw up can cost the destruction of the company.

      From the rules I have read, the USPTO appears to pitch themselves in a similar way to the courts. That is, if you dislike the results you can apply for a reexamination. If the judge/jury/etc misbehaves you can get a retrial. However, I doubt you can sue the Dept of Justice for legal costs etc due to needing a retrial.

      This question of culpability was raised here http://www.techdirt.com/articles/20051216/0312216. shtml

      --
      Engineering is the art of compromise.
  38. Actually, it's better than that. by cduffy · · Score: 1

    The parent's proposal covers not just if/then, but all conditional jump instructions -- which are used by your compiler to implement if/then, switch, and other conditional flow control.

    1. Re:Actually, it's better than that. by CdrGlork · · Score: 1

      Exactly! Oh wait, those are kind of important, aren't they...?

  39. Step 2? by fishdan · · Score: 5, Funny

    Step 1: Patent commenting
    Step 2: ???????????
    Step 3: Profit!!!!

    The problem is there will be no profit because no one comments. On the other hand, at least there is no prior art to rule against your patent.

    --
    Nothing great was ever achieved without enthusiasm
    1. Re:Step 2? by sunwukong · · Score: 4, Funny

      If you really want to make money, patent not commenting code.

    2. Re:Step 2? by Anonymous Coward · · Score: 0

      or how about Self-commenting code...

    3. Re:Step 2? by StarkRG · · Score: 1

      Now, should I patent badly written, unreadable, non-commented code or well written, easily readable, non-commented code. The former would tend to happen more often, but the latter is more useful, and less likely to be challenged...

      Oooh, hey, what about Hello World? Can I patent that? What about patenting the whole hello world type of program: A very short program, used to demonstrate the very basics of a programming language, usually used to initiate the teaching process often by displaying a few words or performing some other simple operation.

      Oooh, hey, does anyone hold a patent for Hydrogen? A single proton orbited by a single electron, can be ionized. A similar atom is anti-hydrogen, a single anti-proton orbited by a single positron.

      Crap, I forgot what an oxygen atom looks like... ooh, wait, I don't need to know: An Oxygen molecule consists of two oxygen atoms. Can be used in many chemical processes, combustion , oxidization, etc.

    4. Re:Step 2? by MindKata · · Score: 3, Funny

      "patent this, patent that etc.."

      Ok, I've just patented The Big Bang ... now you all have to pay up or I can exclude you from my reality.

      --
      There are 10 kinds of people in the world... those who understand binary and those who don't.
    5. Re:Step 2? by Traa · · Score: 1

      you got that all wrong, the idea is to patent step 2.

    6. Re:Step 2? by zotz · · Score: 1

      1. A method for the initial speeding up the creation of source code.
      2. ???
      3. Profit.

      --
      FreeMusicPush If you want to see more Free Music made, listen to Free
    7. Re:Step 2? by john83 · · Score: 1

      "patent this, patent that etc.."

      Ok, I've just patented The Big Bang ... now you all have to pay up or I can exclude you from my reality.
      I reject your reality and substitute my own.
      --
      Strange women lying in ponds distributing swords is no basis for a system of government.
  40. Mod parent up... by QRDeNameland · · Score: 1

    Bravo! You deserve both Funny and Insightful for that.

    --
    Momentarily, the need for the construction of new light will no longer exist.
  41. Prior subject by dacarr · · Score: 1
    As much as I hate to admit, I used to play with Applesoft Basic on my Apple //c when growing up. You do Ctrl-C, and vavoom, you have a breakpoint.

    Now, let's go before that, to when I used to tool around on a TI 99/4A, using TI Basic. You hit Ctrl-C during your code's execution, and not only do you get a breakpoint, you get "BREAKPOINT AT n" (n being the line number) for the response. This alone was...oh, I want to say 25 years ago, roughly.

    So if this went through, somebody's deserving of a nice little LARTing.

    --
    This sig no verb.
    1. Re:Prior subject by badboy_tw2002 · · Score: 2, Informative

      Except that they're not patenting breakpoints. Try reading a little more than the inflamatory summary next time. Think about it, how could you patent something and use the word in the patent? By using the word "breakpoint" they've already exposed prior art, as the reader is expected to know what it is they're patenting. If you read a little more, you'll see they're patenting a new method of setting breakpoints.

      But sorry, continue on with the FUD!

    2. Re:Prior subject by the_lesser_gatsby · · Score: 2, Informative

      They're patenting the replacement of 'do-nothing' virtual functions at runtime. This isn't new and it is certainly obvious to practitioners of the art of programming.

      I thought the Supreme Court had done away with this sort of nonsense?

    3. Re:Prior subject by badboy_tw2002 · · Score: 1

      Well, it should be very easy to show prior art, as all you have to do is bust out the debugger that makes use of this functionality. Open and shut case. But the whole knee-jerk "they are now patenting all breakpoints, we will all be sued" (you'll have to imagine the drool on your own" is rediculous in this case.

  42. Re: Patenting software bugs by Douglas+Goodall · · Score: 1
    Well, if you patented software bugs, you might be able to sue the processor chip for making errors and omissions. Chip manufcturers would have to get lots of liability insurance to cover their asses when software malfunctioned. On the other hand, with the amount of bugs in Microsoft Windows, and any reasonable penalty per instance of the bug in the wild, Microsoft would rightly owe a lot of money.

    Maybe the Free Software Foundation should hold the patent. That would create a revenue stream to support the continued development of GNU software.

  43. GCC by Anonymous Coward · · Score: 0

    The abstract is a bit light, but it sounds like the idea of putting break-points inside the source of a file being run through the debugger. I.e. if I'm debugging the code generated from foo.c, then I could insert a breakpoint in the source code, e.g. dbg_break; and have it hook into GDB or something else. If so, either (1) this won't go into GCC or (2) the patent is a bit obvious.

  44. Your missing something by SQLz · · Score: 2, Informative

    To patent software, it doesn't have to be new, inventive, or even your idea. Thats not the point of a software patent. You just pay a guy to submit anything you tell him to submit, and pay the patent office for the patent. They don't won't even put your idea into google. As long as its not too similar to something in their database, or doesn't violate some law of physics, you are usually good. Its a huge revenue stream for the US. Its the USTPO's opinion that the courts should handle the garbage they let though, and unfortunatly, that translates to the american people subsidizing the patent office by supporting the infrastructure to litigate these patents.

    1. Re:Your missing something by Nonillion · · Score: 1

      Wow, here's someone who ACTUALLY sees the big picture. This is EXACTLY the reasoning behind ALL of our drug and DUI laws.

      --
      "I bow to no man" - Riddick
    2. Re:Your missing something by complete+loony · · Score: 1

      No, you can patent stuff that breaks the laws of physics. There are heaps of perpetual motion machine patents.

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
    3. Re:Your missing something by ScrewMaster · · Score: 1

      Yeah, and let's not forget the warpdrive. Of course, there's prior art for that one ...

      --
      The higher the technology, the sharper that two-edged sword.
  45. Not a patent by wmelnick · · Score: 2, Informative

    That number is not a patent number. This patent has been applied for and published not not granted yet. As long as it is a year (4-digits) followed by a 7-digit serial number, the patent has not yet been granted.

    1. Re:Not a patent by Anonymous Coward · · Score: 0

      But this IS a patent, issued to Epson in 2006:

      http://www.google.com/patents?id=EmR4AAAAEBAJ&dq=b reakpoints

  46. Different than... by Anonymous Coward · · Score: 1, Interesting

    How is this claim different from this existing patent:

    http://www.google.com/patents?id=EmR4AAAAEBAJ&dq=b reakpoints

    Seems someone has beaten them to it...

    1. Re:Different than... by Anonymous Coward · · Score: 0

      The difference is one is a patent application, and the other is the final patent based on that application.

  47. Sensationalist and Fact-Free by clang_jangle · · Score: 1

    Read TFA -- The headline of the summary is an outright lie. No patent in evidence. Next story: /. sub makes fool of self, /.editors!
    Oh wait, that's not really news.

    Obviously I laugh in the face of karma...

    --
    Caveat Utilitor
  48. Mod parent up by ProteusQ · · Score: 1

    /. , like Wikipedia, needs to work on quality control.

  49. Monkeys with stamps. by Kadin2048 · · Score: 1

    Is there anyone in the patent office? Or is it just a big rubber-stamp machine?

    The answer to both questions is "yes."

    --
    "Ladies and gentlemen, my killbot features Lotus Notes and a machine gun. It is the finest available."
  50. prior art by d_i_r_t_y · · Score: 1

    how can this patent be granted when there is plenty of prior art on the use of breakpoints in debugging? it's in the public domain, and therefore not patentable.

  51. Re:I think this is a bit different - Not Really by Mr.+Underbridge · · Score: 1

    From an admittedly shallow reading of the patent, it seems that it's difference is figuring out what to do on its own. Maybe you're right and that every aspect of what they're trying to do has been done, but I'm not so sure.

    In any event, the title of the article ('Breakpoints have now been patented') is demonstrably false. The patent does not claim to patent the basic notion of a breakpoint.

  52. Didn't you mean to say... by Erandir · · Score: 1

    ... that the error would be patently obvious to a moderately intelligent Orangutan?

  53. By Who????? by SuperKendall · · Score: 0, Offtopic

    I know I'm supposed to RTFA, but really couldn't the submitter have take the four seconds to type out the name of the patent holder?

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  54. Not surprising... by HappySmileMan · · Score: 0

    I don't really see this as a surprise, in fact I'm surprised it's still free... If anyone's surprised by this why aren't they surprised that it costs 158 a year just for your right to watch TV in Ireland, 12.70 for each dog you own and 128 to catch fish... Eventually this will just be another needless licence(50 a year to own a compiler and 100 for a debugger, with a 50% communist tax if you use linux)

  55. "they arent that common either" pfft! by kt0157 · · Score: 1

    "they arent that common either"

    Yeah, not for you, script kiddie. Those of us developing embedded software use them every day.

  56. Scope of claims by Anonymous Coward · · Score: 0

    A couple rules of thumb concerning the scope of the claims (and enforceability)

    1) All issued patent claims are valid and enforceable on what they cover (until otherwise revoked)
    2) They don't cover anything previously disclosed

    So for instance, all the folks to say "I'm going to patent air" could theoretically get a patent with the independent claim:

    1 Air

    This would cover all air that was not previously known (since the assumption must be that it is something new). Since air was previously known, the claim covers all air that isn't air. It really could be a nul set, or something so esoteric that no one cares (or heck, maybe it is something new). It isn't vacuum (which would be absence of air). But it won't cover air as we know it.

    So sometimes the proper response to a claim isn't to say it's not valid, it's to say "who cares!"

    But of course, these are rules of thumb spouted by someone preferring to remain anonymous in case some idiot decides to rely on this as law. Reality has a way of biting thumbs.

  57. Re:don't get yer panties in a wad yet (OT) by uab21 · · Score: 1

    I'm certain that Adm. Hooper is spinning in her grave over claims of originality for some of these patents

    I still have the nanosecond length wire she gave out at a conference years ago somewhere in the office. A spectacular woman who is missed.

  58. A patent application only by jamietre · · Score: 1

    This application was entered by Epson. The application is also extremely detailed. I am not sure what the point of this "freepatentsonline" web site is, since you can just search the USPTO's web site for free and get the COMPLETE information about a patent or patent application, and not just a summary.

    Anyway, here's the link. Methinks this is a non-story. This application seems very specific.

    http://appft1.uspto.gov/netacgi/nph-Parser?Sect1=P TO2&Sect2=HITOFF&p=1&u=%2Fnetahtml%2FPTO%2Fsearch- bool.html&r=1&f=G&l=50&co1=AND&d=PG01&s1=200302087 45.PGNR.&OS=DN/20030208745&RS=DN/20030208745

    1. Re:A patent application only by udippel · · Score: 1

      Anyway, here's the link. Methinks this is a non-story. This application seems very specific.

      Could you be more specific, please, in how this application in your opinion is 'very specific' ?
      Honestly, I can't see that ...

      A minor correction: If you scroll down on the freepatentsonline site, you get more than the summary.

  59. First place I saw all this previous art... by VAXcat · · Score: 1

    The T-bit trap in the Program Status Word of the PDP-11 familty of computers...in 1972.

    --
    There is no God, and Dirac is his prophet.
  60. DDT by rlp · · Score: 2, Informative

    DDT debugger running (originally) on the DEC PDP-1 supported breakpoints.

    http://en.wikipedia.org/wiki/Dynamic_debugging_tec hnique

    --
    [Insert pithy quote here]
  61. I'm mostly with Fred and Linus on this. by Ungrounded+Lightning · · Score: 1

    I use a personal methodology where:

      - Test harnesses are REQUIRED during development (including at unit-test levels) to determine that the program and the individual modules are all working as intended. (I include test passage in the makefile targeting, so a test failure kills the build. This catches introduced bugs from mods right away.)

      - Debuggers are allowed only to diagnose why something is failing.

      - Each bit of code has to be correctly covered (not just executed) and its correct behavior verified by a test to be considered "finished". Thus:

      - Coding tends to resemble a depth-first tree-walk leaving behind debugged code that is almost never revisited. (Like growing a perfect crystal.)

    I find that, while debuggers are occasionally handy, with the "prove it's right" test harness in place there's so much visibility that they are usually more trouble than they're worth. When visibility is insufficient, compiling and linking a module-level mod is so quick that it's usually easier to stick in temporary debugging output statements than fire up a debugger.

    By the way: The downside of this methodology is that it's so blazingly fast that it is perceived as slow: I report a finished, debugged component or project in about three times as much time as typical developers report a successful initial (hello-general-outline-world) build or a single debugging iteration. So managers make an apples-and-oranges comparison between my completed projects and others' first-cut efforts and bug-fix cycles. This leads to comments like: "'Rod' took about three times as long as most programmers to come up with a first version - but his first try usually worked." B-(

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  62. Outsourcing to Slashdot? by mutube · · Score: 1, Funny

    Is anyone else starting to wonder if the Patent Office is using Slashdot to check for prior art, rather than employ clerks to do it in-house?

    1. Receive application for patent
    2. Create dummy patent-approved page
    3. Submit to Slashdot with "Shock! Horror!" summary
    (3b. While still claiming expenses for a horde of patent clerks)
    4. ????
    5. Profit!!!

    Watch it CmdrTaco, I'm onto you.

    1. Re:Outsourcing to Slashdot? by Anonymous Coward · · Score: 0
      Primary Examiner: Nguyen-Ba

      ... or overseas ??

  63. It covers software debuggers, too. by Kadin2048 · · Score: 1
    Read the actual claims; they're specifically including a software implementation as well, in Claim 1:

    1. A debugging tool for debugging an application program having at least one software breakpoint function and a call statement for calling said software breakpoint function, said software breakpoint function being adapted to return program control to a next program statement following said call statement when said debugging tool is not running, said debugging tool comprising:

            (a) a software breakpoint monitoring processor for monitoring said application program and recognizing said software breakpoint function, said software breakpoint function being a void function free from program instructions for performing any application program operation;
            (b) a software breakpoint action determinator for determining an action to be performed based on said software breakpoint function;
            (c) a software breakpoint action implementor for implementing said action;
            (d) said software breakpoint monitoring processor, upon recognizing said software breakpoint function, calls said software breakpoint action determinator;
            (e) said software breakpoint action determinator, in response to being called by said software breakpoint monitoring processor and upon determining said action to be performed, provides instructions to said software breakpoint action implementor; and
            (f) said software breakpoint action implementor, upon receiving said instructions from said software breakpoint action determinator, implements said action.
    I think this would effectively cover most breakpoint-triggered software debuggers; they go on in subsequent claims to get into the hardware, but this particular claim is all software.

    --
    "Ladies and gentlemen, my killbot features Lotus Notes and a machine gun. It is the finest available."
  64. Make that "Brian". by Ungrounded+Lightning · · Score: 1

    Sorry, got bwk and Fred Thompson mixed. B-(

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  65. man 3 alloca says by Anonymous Coward · · Score: 0

    BUGS
    The alloca() function is machine and compiler dependent. On many sys-
    tems its implementation is buggy. Its use is discouraged.

    On many systems alloca() cannot be used inside the list of arguments of
    a function call, because the stack space reserved by alloca() would
    appear on the stack in the middle of the space for the function argu-
    ments.
  66. Jeez...I'm filing my patent for air now by queenb**ch · · Score: 1

    Oh,yeah....go ahead and patent something that's been around for....oh.....twenty years or so.

    2 cents,

    Queen B.

    --
    HDGary secures my bank :/
  67. Re:I think this is a bit different - Not Really by drinkypoo · · Score: 1

    From an admittedly shallow reading of the patent, it seems that it's difference is figuring out what to do on its own.

    That MUST be a shallow reading, because AI doesn't exist, and computers can't do that. They can only figure out what to do based on guidance input by a programmer.

    --
    "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  68. Prior Art by imp · · Score: 1

    dbx (sic) from 4.2 BSD existed with all this functionality on the VAX 11/750 we had running at New Mexico Tech in the late 1980s.

    Clearly, this is a bogus patent.

  69. Here's some prior-art for you by Lockejaw · · Score: 1

    When you run it, it adds a comment at the beginning to tell you what it does.
    #!/usr/bin/perl
    $a='#!/usr/bin/perl
    #this program prints itself, with a prepended comment to explain what it does
    $a=%c%s%c;printf($a,39,$a,39) ;'printf($a,39,$a,39);

    --
    (IANAL)
    1. Re:Here's some prior-art for you by donaldm · · Score: 1

      Minor error your code should be:

      #!/usr/bin/perl
      $a='#!/usr/bin/perl
      #this program prints itself, with a prepended comment to explain what it does
      $a=%c%s%c; printf($a,39,$a,39) ';printf($a,39,$a,39);

      Note the end quote

      You realize we are both up for patent infringement :-)

      --
      There ain't no such thing as proprietary standards only proprietary formats. Standards are by definition open.
  70. Gak! That code made my *cat* puke a hairball by Anonymous Coward · · Score: 0

    int allocstuff( void )
    {
            char *a = ( char * ) malloc( 100 );
            if ( !a )
            {
                    return( -1 );
            }

            char *b = ( char * ) malloc( 100 );
            if ( !b )
            {
                    free( a );
                    return( -1 );
            }

            return( 0 );
    } You do realize it's downright dangerous to write if statements without enclosing braces? For example:

    .
                .
                . /* added d to fix bug */
            if ( a )
                    b = c;
                    d = e;
                .
                . . Ooopsy. What's that code supposed to do? Always, ALWAYS, ALWAYS use braces to enclose statements following a conditional.
  71. Looks like it was granted last year by The_Dude · · Score: 2, Insightful

    If you enter the application number in the US PTO search function, you get: http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PT O2&Sect2=HITOFF&p=1&u=%2Fnetahtml%2FPTO%2Fsearch-a dv.htm&r=1&f=G&l=50&d=PALL&S1=20030208745&OS=20030 208745&RS=20030208745

    Patent 7,055,140: Software breakpoints implementation via specially named function.

  72. anything by tore · · Score: 1

    Well, if you really want to make money, patent not doing your job. That way you could probably earn a lot of money on slashdot readers.. :-)

  73. Did anyone bother reading the Patent? by qazwart · · Score: 2, Informative

    This is first of all:

    1). Not a patent, but an application for a patent from 2001.
    2). This is a specific implementation of a breakpoint function, not breakpoints in general. The idea of this patent is to use an all purpose void function for doing breakpoints instead of a machine dependent instruction as breakpoints are now done.

    Patents have been loose (like the one-click patent), but this isn't one of them. Looking at the date on this patent and the way software is now handled, I believe this patent is a bit dated. Sort of like someone patenting a new way to implement the HTTP over a dialup connection without using SLIP or PPP.

    1. Re:Did anyone bother reading the Patent? by udippel · · Score: 1

      You miss it partially.

      1). Your post is redundant w.r.t. more than a handful of earlier posts pointing out that the same thing has been patented as 7,055,140 on May 30, 2006.

      2). You are correct on the specific breakpoint function. Question is, if nobody really has ever had this idea before May 1, 2002.

    2. Re:Did anyone bother reading the Patent? by Ep0xi · · Score: 0

      exactly the point i see, cheers

      --
      ?
  74. More like... by bADlOGIN · · Score: 1

    If you really want to make money, patent not commenting code. If you really really want to make money, patent not unit testing code!
    --
    *** Sigs are a stupid waste of bandwidth.
  75. Prior art! by Opportunist · · Score: 2, Insightful

    0xCC

    --
    We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
    1. Re:Prior art! by mgiuca · · Score: 1

      Nice :)

      In case that was a little obscure, I'll elaborate by saying that 0xCC is the x86 single-byte opcode for the int3 instruction, to generate a CPU breakpoint interrupt.

      INT instruction (x86).
      Interrupt 3, the generated interrupt.
      Prior art: 1974.

  76. The patentapplication was rejected twice... by thimon2k · · Score: 2, Informative

    From http://portal.uspto.gov/external/portal/pair and searching on the application number 10/136,163, which is US20030208745 (patent application) or US7055140 (Granted patent) it is possible to see the course of a patent application. The application was rejected twice, first on 03-23-2005 as seen under 'image file wrapper' and later at 09-07-2005. However the applicant pointed out that the cited patent (US5835699) does not claim a specific void function. As some has pointed out, USPTO has a backlog of 3 millions patent applications meaning there is not much time to do a proper search for prior art.

  77. A specific Void() function? by WillAffleckUW · · Score: 1

    That is patentable?

    Strange, I recall using breakpoints with that back in the ... 1980s!

    SNAFU.

    --
    -- Tigger warning: This post may contain tiggers! --
  78. two memory holes by Anonymous Coward · · Score: 0

    neat, you care for the case where malloc fails, but you get yourself two nice little memory leaks in case malloc suceeds both times.

    (this does not apply for those of you working on machines with less than 200bytes of ram)

    scnr

  79. nested ifs for partial cleanup by Per+Abrahamsen · · Score: 1

    > Wouldn't nested 'if..then's be better in this case?

    I'd prefer the code as is, using nested ifs for partial cleanup quickly becomes a mess.

    I believe goto in general works best when you use it to mimic specific missing language features... In this case "std::auto_ptr" from C++ or "finally" from Java/C#.

    Back when I programmed assembler (where use of goto is mandatory), I always put the conceptual high-level construct in a comment, like "if then else endif" or "repeat until".

    1. Re:nested ifs for partial cleanup by Threni · · Score: 1

      > Back when I programmed assembler (where use of goto is mandatory), I always put the conceptual
      > high-level construct in a comment, like "if then else endif" or "repeat until".

      Assembler is a slightly different kettle of fish. Clearly higher level conditional statements are usually going to be manifested using jmp, bra etc on the CPU. I did once experiment with emulating do...while, for...next etc with macros, but that doesn't work too well if you really want to optimize your code down to clock cycle level (too much wastage of registers or slow stack usage).

  80. printf by UnRDJ · · Score: 1

    Heh, I used printf for the longest time, not out of sheer leetness but only because I was to lazy to figure out the debugger. :)

    1. Re:printf by that+this+is+not+und · · Score: 1

      I hung extra wires off spare ports on the emulator. Used the oscilloscope to keep track of what was running, and when.

  81. JMP? by Midnight+Thunder · · Score: 1

    Avoiding GOTOs is often facilitated by alternative designs and the language being used. Languages such as Java and C++ offer try/catch statements, while C requires a GOTO to emulate this functionality. If you delve down to the assembly level, then many operations the don't use GOTOs in the higher-level language are using them when converted to assembly, though in this case they are JMP statements. For example your call to a function at the assembly level would involve pushing some values onto the stack and then jumping to the offset where the subroutine is located.

    --
    Jumpstart the tartan drive.
  82. constructors by Per+Abrahamsen · · Score: 2, Informative

    I'd really hope you would not be surprised that a function called "alloc"-something would allocate memory on success.

    As sample code leaks since nothing points to the allocated memory, presumably because it is not relevant for the technique being illustrated.

    The technique would be useful for a constructor function, returning a pointer to an initialized object. A matching destructor function would then free the memory.

    1. Re:constructors by c · · Score: 1
      > I'd really hope you would not be surprised that a function called "alloc"-something
      > would allocate memory on success.

      Not at all. I am surprised that such a function would consider leaking memory as success. Apparently, I'm not alone in this surprise.

      I know what point he was trying to make. I use that particular goto contruct myself occasionally.

      But by using the functional equivalent of

      int allocstuff(void) {
          return !(malloc(100) && malloc(100));
      }

      as an example of good goto usage, the only point the author made is that excessive use of goto leads to unmaintainable and ineffective spaghetti code, even in 10 line examples.

      Maybe my standards are too high or something (I doubt it; I code in C), but it seems reasonable that if you're going to bother writing a few lines of code to prove a point, you'll ensure your point isn't undermined by such blatantly obvious flaws.

      c.
      --
      Log in or piss off.
    2. Re:constructors by Anonymous Coward · · Score: 0

      Er, your code leaks 100 bytes if the first malloc succeeds and the second fails. The original code supplied doesn't, which would be a minor fault if it wasn't for this being the entire point of that code.

      Furthermore, the goto construct is not the part that leads to the leak here, the programmer not being willing to write some construct to return both pointers is. The construct is pretty obviously meant to be used in something like a constructor, where many allocations might legitimately be performed.

      The code was obviously written to be easily readable, even by someone with little knowledge of C, and allocating two separate things was pretty much a requirement for the demonstration. As such, there is no very obvious way to return both pointers to the caller.

      As written, the code "leaks" 200 bytes on success, but that might even be said to be its purpose if you're going to be pedantic about it: if the spec is "allocate 200 bytes, or nothing at all if this is not possible", then the function is performing perfectly where yours does not. More importantly, it's successful in demonstrating the technique it was written to demonstrate(the extraneous free statement has a purpose, if not in compiled code, as pointed out by other commenters).

      You might as well criticize someone for the quality of their "Hello world" prose, or for writing example programs to perform simple arithmetic they could've done faster in their heads. You're missing the point of posting the code in the first place.

  83. You use goto if... by jhoger · · Score: 1

    a) You use exceptions at all. Actually, these are worse than goto since you actually jump right out into some random outer dynamic scope.

    b) You exit loops early... break, continue, last, again, redo et al.

    My feeling is, there's nothing wrong with goto when it is used methodically to implement missing language features or code patterns (like common cleanup). Also it may be used sparingly during code maintenance to modify program behavior without radically reworking code which has already been tested to working state.

    -- John.

    1. Re:You use goto if... by Anonymous Coward · · Score: 0

      That's not the point. The reason people dislike goto is that it's unstructured and can make the code hard to understand, not that they hate the concept of branching. No-one cares if the object code uses the equivalent of goto, because that's not intended to be human-readable.

    2. Re:You use goto if... by Anonymous Coward · · Score: 0

      The reason people dislike goto is that most programmers are dimwit stupid idiots who just have no idea what they're doing, no matter if they're using C, C++ or Java. But they're not using goto, heh. One sure way to find idiot programmers is to ask about their stance on goto...

  84. Should of patented the hardware this attaches to by JimboFBX · · Score: 1

    To be more specific, its a way of debugging an embedded system. This appears to be only part of the debugging system since this would never work without using some specialized hardware. Essentially the patent says this: I put dummy functions on a piece of hardware. A second processor that is somehow monitoring what this processor's doing (there are several ways to do this) reads the executed code, recognizes when a dummy function occurs, then somehow alters code execution on the first processor based on the dummy function's name (or maybe it steals processor control and freezes the first processor somehow). These aren't necessarily breakpoints, but breakpoints can be part of it. The advantage is that the code will function normally if the seperate debugging piece isn't attached. Sounds to me like the software aint that creative, but how they're getting that second processor to modify code execution (and if its even efficient or not) is something that probably deserves a patent. Although, I'm a software guy, not a hardware guy, so maybe thats why the hardware aspect is what sounds special. They really should be patenting the hardware, not this software method, since the hardware is the non-obvious part, and the hardware would imply this kind of usage with the software that uses it. But this is just a patent application, and it has errors in it. It seems to claim more usability than it really should support.

  85. exceptions by Per+Abrahamsen · · Score: 1

    Actually, using exceptions just make the problem worse, as every function call may potentially cause an early exit.

    Which is why programming languages with exceptions have mechanisms for automatic cleanups, like finally in Java or std::auto_ptr in C++.

    1. Re:exceptions by mcpkaaos · · Score: 1

      std::auto_ptr in C++

      Ah, yes. Easily the greatest, unsung hero of the STL. Whenever GC zealots would try their old rigmarole, I'd just point to this handy dandy little class and smile. Sure, the lack of array (delete []) support made it less useful as a generic auto-cleanup pointer, but C++ offers so many ways around its own shortcomings that it wasn't really a problem. And, really, doesn't everyone just allocate their arrays on the stack anyway? Just kidding. Damn, I miss C++. :)

      --
      It goes from God, to Jerry, to me.
  86. An aside - Why configurable? by evought · · Score: 1

    As an aside, why would you want something like this to be configurable?

    As I said, many runtimes automatically enter the debugger when a trap of some kind is encountered; I think even gcc does. If the feature is designed to let you see what is going on when the code fails, it should fail whether the code is being debugged or not. If it is designed to let you see what is going on at particular points in the program that are not failures, that is what logging is for. If you want to see what is happening at each such point and step through them, put a break point on the log routine (break Logger.logEntry()). If you want to examine a specific instance, then you know where to put the break point, why change the code?

    I have always been fairly heavy handed with assertions and state checking and never once even considered conditionally disabling them. If written with some care, runtime checks have negligible overhead and make considerable difference when diagnosing problems. Of course, I am somewhat biased because a lot of my early experience involved scientific or military applications where either results had to be reproducible or lives depended on them or both. You want a program to fail as early as possible if there is any suspicion it will come up with the wrong answer. This is not to say that you do not attempt to recover where appropriate, just that recovery is by design, not by accident, and that when you do recover, you generally log it somewhere.

    Anyway, from looking at the patent, I a) don't see how this is much different from having

    if (reality.isntworking())
    failhere();

    in your code and having the debugger kick in at that point (if it is active, or kick you back to the interpreter in some languages), or b) why you would want the code to not fail if the debugger is not active. I know some people have felt strongly about the ability to disable runtime assertions, I have just never understood the point of view.

    I suppose it might be nice to be able to have:

    try {
    ...
    } catch (Exception e) {
    Debugger.breakpoint();
    i_logger.logCritical(e, "I'm sorry Dave...");
    // Attempt recovery ...
    }

    but again, it seems at best a minor convenience and it could actually get in the way if that was not what I was intending to look at (like investigating a problem several steps after a successful recovery). It also opens up issues with different programmers on a team assigning breakpoints inconsistently and making it harder for others to debug. Am I missing something?

  87. Did this in the late 60's by Jeff1946 · · Score: 2, Interesting

    When I used to program a PDP-8, I would toggle in by hand a halt instruction to stop a misperforming program at a specific location so I could examine the accumulator or memory. Microsoft quickbasic (prewindows) had built in break point and watch capability. Assuming we allow software patents they must be non-obvious, non-trivial, and only of value if they give the user a valuable capability. Things like the Fast Fourier Transform as an example of a valuable algorithm or a spreadsheet, I believe Visicalc was the first, should qualify. Stuff like one-click shopping, no way.

  88. How about... was Re:Next up... by rtssmkn · · Score: 1


    And, if you hide the defines very well beneath a pile of mud, then nobody will ever know that you actually are using gotos.
    However, they will know that you use multiple exit points and that is bad design unless you are doing low level kernel and
    device driver hacking...

    --------

    #define try
    #define catch(X) X:
    #define throw(X) goto X;

    void doweirdstuff()
    {
            try
                    a = malloc(100);
                    if ( !a )
                    {
                            throw(ABC);
                    }

                    b = malloc(100);
                    if ( !a )
                    {
                            throw(DEF);
                    }

                    free( b );
                    free( a );

                    return XYZ;
            catch(ABC)
                    return XYZ;
            catch(DEF)
                    free( a );
                    return XYZ;
    }

  89. Re:for you non-patent attorneys by PatentMagus · · Score: 1

    The article linked to the application, not to the patent. The claims are fairly different. Try:

    http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PT O2&Sect2=HITOFF&p=1&u=%2Fnetahtml%2FPTO%2Fsearch-b ool.html&r=1&f=G&l=50&co1=AND&d=PTXT&s1=Bystricky. INNM.&OS=IN/Bystricky&RS=IN/Bystricky

    Regardless, another example of an app that should have been reject in whole.

    --
    I am a lawyer, but not yours. Anything I tell you might be a total lie intended to benefit my clients at your expense.
  90. "now patented"? by thePowerOfGrayskull · · Score: 1

    Filed in 2002, patent granted in 2003. Hardly a recent occurrence. Too, as soon as someone takes the expense to fight it, it won't stand up. Everything in here has existed for decades.

  91. Oh, it's no big deal. by Shinmizu · · Score: 1

    Thank goodness most programmers write perfect code the first time around, else this could really cause problems.

  92. So What? by ratboy666 · · Score: 1

    I would challenge it with LISP implementations (back to the 50's). Except that breakpoints would be done by replacing the eval function for single step, or the function itself for a specific breakpoint. (debug myfunc) and (undebug myfunc), in a nutshell.

    Of course, if it EVER got to a Court, all is lost, because trying to explain the implementation of LISP to a jury would be... impossible. Or, for that matter, to most judges.

    What is needed is good peer review of patents.

    --
    Just another "Cubible(sic) Joe" 2 17 3061
  93. from TFP by YenTheFirst · · Score: 1

    The present invention is directed to a method and apparatus that implement a software breakpoint using a specially named void function as a software breakpoint function. Advantages of the invention include minimal modification of the application program, portability between different types of CPUs, and safe operation of the application program when the debugging tool is not running. they recognize breakpoints have already been invented. Most breakpoints (historically) are implemented with an interupt command inserted directly into assembly. This patent is for a different implementation of breakpoints, with some advantadges/disadvantadges over the current implementation.
    --
    It's not stupid. It's Advanced.
  94. Going home now... by Tmack · · Score: 2, Funny
    Well, Im packing up and going home. I wouldnt want my employer getting in trouble over patent infringement because of me. Guess Ill just have to sit at home and wait until they work out a licensing agreement or something so I can get back to work fixing code....

    tm

    --
    Support TBI Research: http://www.raisinhope.org
    1. Re:Going home now... by SageMusings · · Score: 1

      Don't be so rash,

      Just start writing error-free code. Then you will never need a debugger. See? Simple. Of course since I have a patent pending on file extensions you will still likely get into trouble with my attorney.

      --
      -- Posted from my parent's basement
  95. The Supremes make this moot by bec1948 · · Score: 1

    The Supreme Court unanimously decided a case the other day, overturning patents for something obvious. I've not read the patent, but it would seem that this fits into the "Obvious" category. That the patented idea might also be a good one, and offer benefits may not justify the patent. I also don't know whether it matters - it will depend upon whether the vendors who compete need this functionality and what the licensing will be. If it gives competitive advantage, but doesn't pay to fight, it will stand. If someone wants to fight, I suspect the patent will fall due to the court decision.

  96. Thanks to SCOTUS by modmans2ndcoming · · Score: 1

    obvious patents are no longer patentable.

  97. Recent Supreme Court ruling will kill this one by pcause · · Score: 2, Insightful

    The recent Supreme Court ruling about "obviousness" will make this patent worth less than the paper it was printed on. This one will clearly get tossed if they try to enforce it. It is obvious, in the sense that the Court defined the term and prior art exists.

    1. Re:Recent Supreme Court ruling will kill this one by aim2future · · Score: 1

      Even though it is obvious I assume the really scary part is that you can get sued and to defend yourself you have to spend time and money on trials and lawyers, at least in US.

      Software patents should be abolished completely, as they are counteracting the purpose of patents, but not only software patents have this flaw. Generally speaking I would say that e.g. patents on consumer products is a an obstacle to innovation.
  98. Re:I think this is a bit different - Not Really by Mr.+Underbridge · · Score: 1

    No shit. By 'on its own' I mean dynamically based on the an algorithm that presumably forms the basis for the patent. But thanks for the insight that computers don't think for themselves.

  99. Why reading patents is bad for you by nitecoder · · Score: 3, Insightful

    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.

  100. Prior art? by Checkmait · · Score: 1

    Hasn't GDB been doing this for ages? Or is it just me?

    --
    "All you need is ignorance and confidence; then success is sure." -- Mark Twain
  101. nice by sentientbrendan · · Score: 1

    That is indeed the proper use of gotos (although the example code in question was obviously quickly written and contained a few errors). If you aren't familiar with this, the gotos here are essentially emulating a "finally" clause.

    Several responders mentioned "nested ifs"... which is obviously a horrible idea if you think about it for 10 seconds. The nesting gets unreadably deep if you have enough calls that can return error codes (which is quite common).

    It is quite annnoying that people who obviously have no real experience with C or programming in general will make blanket statements about never using gotos or other practices... I've found it to be the sort of statement that people who aren't that good at programming make to make themselves sound smarter.

    Java and higher level languages tend to not use gotos as much since they have finally clauses. However, if you have *ever* read through any large c code base, you will see tons of goto statements being used to handle errors. Take the linux kernel for example, just run a grep on it or something and you will find tons of gotos.

  102. Sovereign Immunity by Anonymous Coward · · Score: 0

    There's a legal principle called "Sovereign Immunity" which means that the government cannot be sued unless some specific law allows you to. Of course, this is the sort of thing people hire lawyers for--to find some random reason whereby you can sue the government (say, for lack of due process or whatnot).

    Of course, IANAL, so you'll have to hire one if you really want to know; you'd be insane to take anything written on Slashdot as legal advice :-)

  103. Not completely false by EmbeddedJanitor · · Score: 1
    Well I have approx 10 patents too. Two of those required reexamination of some claims, and in only one case did we drop claims. I have one patent application that did not make it and I'm sure I could have re-jigged it to fly, but I didn't because I could not be arsed doing it. I have never had a face-to-face with USPTO.

    Blatant violation of prior art does often get trapped, but you can typically tweak your claims to still get around them.

    --
    Engineering is the art of compromise.
  104. FFS by deblau · · Score: 1
    I really wish people would stop complaining and start doing something about it. Here's an idea: file a prior art citation. For the lazy among you:

    Any person at any time may cite to the Office in writing prior art consisting of patents or printed publications which that person believes to have a bearing on the patentability of any claim of a particular patent. If the person explains in writing the pertinency and manner of applying such prior art to at least one claim of the patent, the citation of such prior art and the explanation thereof will become a part of the official file of the patent. At the written request of the person citing the prior art, his or her identity will be excluded from the patent file and kept confidential. (emphasis added)
    This costs nothing, and anyone can do it. Here's another idea: collect donations and file a petition to reexamine the patent. If the petition is successful, the patent owner will have to reply to your prior art, on the record. The big downside: it costs $2,520. The not-so-bad downside: if the petition is denied, you get a refund of $1,690, so you're only out $830.
    --
    This post expresses my opinion, not that of my employer. And yes, IAAL.
  105. Its covered by prior art. by Anonymous Coward · · Score: 0

    Don't worry about that one.

    Even software brake points are covered. What do you think gdb remote linked to linux uses when it on hardware without hardware break points.

  106. ASG may disagree by Anonymous Coward · · Score: 0

    Their software on mainframe for debugging COBOL does what is described in this patent and more. They have been around for years. Good luck enforcing this one.

    Oh, how poetic: CAPTCHA: revenues

  107. Breakpoints have now been patented by Anonymous Coward · · Score: 0

    Prior art should be a snap on this one. I was debugging with breakpoints 30 years ago.

  108. All your breakpoints are belong to us! by slightcrazed · · Score: 0

    Someone had to say it....

  109. Idea by Anonymous Coward · · Score: 0

    Hey i have an idea: lets patent a key that will be long and when you press it it will produce no character but will instead displace the cursor. I am rich!!!

  110. Re:What's a breakpoint? - Easter & Xmas spoile by maciarc · · Score: 1

    >> How does a developer manage to work for a few years without knowing what a breakpoint is?

    > His code always worked first time?

    Name 3 imaginary things: Santa, the easter bunny and a 10+ line, bug free, first draft program.

  111. Correct me if I am wrong... by oloron · · Score: 0
    from the article

    [0004] One disadvantage of the traditional method of implementing a breakpoint stems from the fact that a software interrupt requires an interrupt-handling procedure, which is provided by the debugging tool. If the debugging tool is not running, however, the required interrupt-handling procedure is unavailable to handle the interrupt. In this situation, the operating system may handle the interrupt. In some cases, the operating system handles the interrupt by performing a reset operation, i.e., the system "crashes." In other cases, the operating system cannot handle the interrupt, and the system simply "hangs." but unless you simply used a hexeditor to insert the opcode for a breakpoint into a compiled executable... (why would a developer do this) how did you get the breakpoint in there if the debugger is not running... this makes very little to no sense at all... use your integrated debugger in whatever ide you use, or go with Olly or Soft-ICE , but no need for silliness like this process
  112. Already existing in .Net by ozphx · · Score: 1

    Seems a lot like the static methods provided by the Debugger class in .net System.Diagnostics namespace:

    System.Diagnostics.Debugger.Break() - Signals a breakpoint to the attached debugger.
    System.Diagnostics.Debugger.IsAttached - bool, obvious
    System.Diagnostics.Debugger.Launch() - Pops up the windows start JIT debugging box

    System.Diagnostics.Debugger.IsLogging - bool, obvious
    System.Diagnostics.Debugger.Log(int level, string category, string message)

    http://msdn2.microsoft.com/en-us/library/system.di agnostics.debugger_members.aspx

    --
    3laws: No freebies, no backsies, GTFO.
  113. Borland by ryu1232 · · Score: 1

    I thought this functionality had been implemented in Borland's Turbo C/Turbo C++/Turbo Assembler products. I call bogus. It is a shame borland didn't patent this back in the 90's.

  114. It's so obvious... by Myria · · Score: 1

    In Win32:

    if (IsDebuggerPresent())
            DebugBreak();

    Another thing Microsoft's Visual Studio C runtime library does is called _CRT_DEBUGGER_HOOK, where a debugger can patch a particular void function so that the function will trigger a breakpoint if a debugger is attached.

    --
    "Screw Sun, cross-platform will never work. Let's move on and steal the Java language." - Visual J++ Product Manager
  115. INT 3 by EkriirkE · · Score: 1

    Whoops, what will that cost me?

    --
    from 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
    to 45 2F 6E 40 3C DF 10 71 4E 41 DF AA 25 7D 31 3F
  116. 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 by TheCybernator · · Score: 0, Offtopic
    I am having 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 patented. :)

    All your HD DVDs are belongs to us.

  117. A reason to write clean code by ACORN_USER · · Score: 1

    So, I'm going to be charged for every breakpoint I set it my code? Clearly a reason to write more reliable code or step through every single line of my code; thus a reason for better reuse, shorter, efficient code and proper modularity. Would my having used break-points before not count as a prior-art?

  118. Bring it on! by SL+Baur · · Score: 1

    No, I don't think that constitutes prior art either. Nothing in the patent deals with interpreters and implicit hook functions.

    This isn't an argument I want to win. Software patents are evil. Do keep trying though.

  119. But isn't it that... by Anonymous Coward · · Score: 0

    Prior art got tossed out the window when they started letting corporations patent DNA sequences. You think that millions of years of evolution would count for something, but nooooooo.

    So software is abstract enough to the laymen at the patent office that it'll be a giveaway goldmine too... Now it's just a matter of time until somebody really gets one for the wheel.

  120. What about int 3? by master_p · · Score: 1

    the above is similar to

    #ifdef _DEBUG
    __asm int 3;
    #endif

    So this type of code is now patented?

  121. Let me join the dogpile by kahei · · Score: 1


    Lots of people have already jumped on you for the above post (a 'dogpile' -- if you've seen a large group of dogs fighting the analogy will be obvious) but let me just jump onto that pile myself and tear off some more skin.

    Leaving aside the error in the above code (which was made possible by the use of gotos -- it's easy to misplace a goto label but hard to misplace a } and still have the code compile), consider all the *good* solutions you had to ignore in order to wind up with the above.

    You had to ignore exceptions.
    You had to ignore "Resource Acquisition Is Initialization".

    Maybe, just maybe, there is no C++ compiler for your platform, but there is a C compiler. In that unlikely case, I think I might venture to suggest:

    if(a) free(a);
    if(b) free(b); ...repeat for c - z...

    See how that frees those pointers that were allocated, WITHOUT involving a branch that spans the whole function for each one?

    Or, if allocation is expensive and you don't want to allocate b if a fails:

    a = malloc();
    if(a) { b = malloc();
    if(b) .... etc ...
    } else { free (b);}
    } else { free (a);}

    This used to be called 'structured programming' back before OO existed.

    Of course, that's assuming you can't do it the right way, with OO constructs such as exceptions.

    Now, the error-prone and complex way you have chosen to free that memory is less easy to arrive at, IMHO, than many of the good ways of doing it. It also has a twisted elegance which is kind of attractive. I think that this is an example of a bright and competent programmer -- you -- working in an environment where you are under little pressure either to research best practises, or to compare your code to that of others. It's a classic example of how good programming ability is worth very little without the ability to communicate and learn.

    --
    Whence? Hence. Whither? Thither.
  122. Fake by Anonymous Coward · · Score: 0

    Why is there no patent #20030208745 at the USPTO? Why does the link go to "free patents online"? Smells bogus.

  123. source debugging very old by multicsfan · · Score: 1

    The Multics system used source level debugging in 1977 when I wa a Multics Analyst. This was a standard feature. I suspect it was part of the original system first booted in 1969.
    breakpoints could be inserted by the debugger based on source into the object files. You could add code, branch around code. You could also use tools to trace how many times a line was executed as well as get an estimate of the amount of cpu time spent on each line.

  124. Again, slashdot submitters show their stupidity by Anonymous Coward · · Score: 0
    The linked document IS NOT a patent. It's a PATENT APPLICATION PUBLICATION. It simply means that this patent application is requesting a patent on a breakpoint. That does not mean that the applicant will get the patent.

    Anyone going bonkers over this needs to look into the rules for submitting material to the patent office in regards to this case to prevent it from ever becoming a patent. That's the point of publishing applications before they are patents. If you know of something out there that would block it, send it in NOW.

  125. New Rule : ref Evil Overlord Rule #12 by ckaminski · · Score: 1

    If law or patent cannot be understood by a 5 year old, it cannot be passed or granted.

    eof

  126. What about this one??? by Nicolay77 · · Score: 1
    It uses GOTOs, but to implement something that's easier with them than without them (IMHO):

    wxString
    reader::readToken(wxTextInputStream& tistream)
    {
    // wxLogNull ln;
    wxString separators(_T(" \t\n\r\0"));
    wxString delimiters(_T("()'`,@#"));

    wxString result;
    wxChar rchar;

    keepreading:
    if (haschar)
    {
    rchar = cbuffer;
    haschar = false;
    }
    else
    {
    rchar = tistream.GetChar();
    // wxLogDebug(_T("readToken: readChar: %d : %c"), rchar, rchar);
    }

    if (!rchar)
    {
    return result;
    }

    if (rchar == _T(';'))
    {
    // wxLogDebug(_T("readToken: match comment delimiter: %c"), rchar);
    if (result.Length())
    {
    cbuffer = rchar;
    haschar = true;
    return result;
    }
    else
    {
    do
    {
    rchar = tistream.GetChar();
    // wxLogDebug(_T("readToken: readChar: %d : %c"), rchar, rchar);
    }
    while (rchar != _T('\r') && rchar != _T('\n') && (rchar != 0));
    goto keepreading;
    }
    }

    if (rchar == _T('"'))
    {
    // wxLogDebug(_T("readToken: match string delimiter: %c"), rchar);
    if (result.Length())
    {
    cbuffer = rchar;
    haschar = true;
    return result;
    }
    else
    {
    do
    {
    doread:
    result += rchar;
    rchar = tistream.GetChar();
    // wxLogDebug(_T("readToken: readChar: %d : %c"), rchar, rchar);
    if (rchar == _T('\0'))
    {
    wxLogError(_T("readToken: Input stream ends within a string"));
    result = _T("");
    return result;
    }
    if (rchar == _T('\\'))
    {
    // wxLogDebug(_T("readToken: match string scape char: %c"), rchar);
    rchar = tistream.GetChar();
    // wxLogDebug(_T("readToken: readChar: %d : %c"), rchar, rchar);
    goto doread;
    }
    }

    --
    We are Turing O-Machines. The Oracle is out there.
    1. Re:What about this one??? by Jah-Wren+Ryel · · Score: 1

      Lol! Thanks dude, if you can't even grok the LGPL, clearly my opinions are too complicated for you.

      --
      When information is power, privacy is freedom.
  127. Why the firing -- why not train the dude? by Latent+Heat · · Score: 1
    If I told someone "set a breakpoint" and the answer came back "what is a breakpoint", I would set aside a couple of minutes and say "here, let me show you" and demonstrate how it is done in the tools we were using.

    If after training someone how to "do things, the way they are done around here" and if they are still flailing around or if a person gives attitude about adopting the standards and procedures of a workplace, I would consider firing someone.

    There are lots of reasons not to use debuggers. In many environments, various kinds of logging or "print" statements is all you have. You may be working with DLL's or ActiveX controls where it was never explained how to trace into them with a debugger (you can even trace mixed C++/Java programs connected through JNI, but you need the right tools and figure out how to use them).

    Also, debuggers are not a cure all for many kinds of errors -- they can sometimes place you in the neighborhood of where something goes bad, but it may require a kind of gestalt insight to see what the problem is. Many people regard debuggers as a kind of crutch and discourage their use -- you can go down the road where someone never properly designs their app and devises test cases, and they fall back on the debugger to patch and patch again as problems crop op.

    So I hope you meant it as a joke that you fired this person or perhaps that this person was dismissed because they were not performing in some more serious way. I know what people are thinking, he "lied" about qualifications calling himself a programmer when he never set a breakpoint. Give me a break. People can be trained to the methods, processes, standards, and practices of a work place, and if you didn't have time, you could order your employee "we use debuggers and breakpoints around here -- go look up how to do this, report back when you have located your bug."