Debugging doesn't work like I want it to!
-
And I thought that was the whole point of this forum. Silly me!
Talk about whatever you want. I have nothing against discussion.
Just don't talk about the process of talking about shit. Meta-discussion. That's tedious, unfunny, annoying, and invading EVERY FUCKING SINGLE THREAD. (Oh and hey, to pull an Atwood for a moment, there's already another forum for that: go to meta.discourse and shit all your crap there instead of here.)
That's the actual end-result of "gameification". Everything turns to shit.
-
That's tedious, unfunny, annoying, and invading EVERY FUCKING SINGLE THREAD.
tedious? not really.
unfunny? to a few, but not, i would bet, to most
annoying? see previous answer
invading? depends on what you mean invading. can it be invading if this is the underlying culture of the community?
-
the underlying culture of the community?
Oh, God, don't let him get started on that shit again...
-
-
the underlying culture of the community
The severely aged live yogurt that's colonising the bottom shelf of the refrigerator?
-
The severely aged live yogurt that's colonising the bottom shelf of the refrigerator?
No, my yogurt is recent. The carton of orange juice, OTOH, might be some sort of orange wine, or more likely vinegar, by now; I don't think I want to find out. And it's better not to think about the head of lettuce.
-
Your head would explode from the kind of errors the VMS Ada compiler produced.
And now I'm having unpleasant flashbacks to a certain college class. Thanks, bro.
-
there's certainly a movement involved, just the direction can be kinda off sometimes
Straight into the toilet, sure.
-
Poor man's conditional breakpoint:
if ( condition ) { volatileGlobal = volatileGlobal; // BREAKPOINT HERE }
-
also IIRC flagging your own post as spam automatically hides it, so you can use it to make post go away right now if it has something like a photo with EXIF data that it shouldn't have.
As a TL3, flagging as spam also automatically hides TL0 posts (and topics).
-
Marginally more convenient for gdb on Linux:
if(condition) { raise(SIGINT); }
although MinGW gdb prefers it to be spelled:
if(condition) { DebugBreak(); }
-
That calls for this on Linux:
#define DebugBreak() raise(SIGINT)
-
-
It's a workaround for not having them available?
-
It's a workaround for not having them available?
No, the problem is there's no reasonable
condition
, not a debugger / break point problem.
-
The big drawback to putting the breakpoint in code is you can't enable and disable it (you can probably make GDB continue automatically I guess), and you can't run that build not in a debugger.
-
And now I'm having unpleasant flashbacks to a certain college class. Thanks, bro.
LOL. Totally welcome. "You forgot to instantiate text_io for one of your 23 types. Here's 6 pages of diagnostics."
-
"You forgot to instantiate text_io for one of your 23 types. Here's 6 pages of diagnostics."
Sounds quite brief by comparison with what you can get when a C++ compiler decides you've done something slightly wrong. (I got 8 pages of errors this morning out of
clang
for mis-spelling one line. None of the errors was close to where the cause of the problem was.)
-
Sounds quite brief by comparison with what you can get when a C++ compiler decides you've done something slightly wrong.
At least with MSVC6 (now get off my lawn!), you can scroll back up to the very first error and know that's what's wrong... most of the time, anyway...
-
None of the errors was close to where the cause of the problem was.
Did it at least point you to the line of code which was the problem?
-
At least with MSVC6 (now get off my lawn!), you can scroll back up to the very first error and know that's what's wrong... most of the time, anyway...
Ah, the joy of limited scrollback. I think I've got mine set to 10k lines. Could be more.
-
Did it at least point you to the line of code which was the problem?
I said it didn't. But it was pretty obvious what was wrong anyway, and I knew what I'd just changed a few minutes earlier.
I'd actually
#include
d the wrong thing by getting the path to the file wrong (cut-n-paste coding at its finest!) but it turned out that there was a file with the right name that just happened to be doing something else; it was just in a different directory. The result was C++ code that had completely the wrong templated class definition and that severely worried the compiler at the two lines of code that actually used it, 90% of a file away. Oh well. (I didn't say it was hard to work out. Just that I got 8 pages of diagnostics, none of which were near where the problem was. Not that I blame it for not getting the line right; it was accidentally dealt a difficult hand to play.)I have come across a few real WTFs while dealing with all this today. None of which are the C++ language's fault, nor of any compiler tool per se (except they are, because that's what I'm using as a library).
Ah, the joy of limited scrollback. I think I've got mine set to 10k lines. Could be more.
Infinite scrollback FTW!
-
I'd actually #included the wrong thing
That's probably the most effective way to get errors which don't occur anywhere near the source of the problem. I trust it was an #include in a header?
Leaving a namespace open is another perennial favourite for confusing the compiler—if you're lucky, you'll get an error right at the end of the file....
-
Leaving a namespace open is another perennial favourite for confusing the compiler—if you're lucky, you'll get an error right at the end of the file....
Unmatched braces in general will typically be reported well after the place the problem was caused. And can cause forests of error logging in a bigger file.
-
You forgot to mention Blakey's First Law.
-
Which first one?
-
I trust it was an #include in a header?
No, I was just plain old-fashioned stupid there for a bit. It just happened that there were several files called
ExecutionEngine.h
in the codebase that I was depending on, and I picked the wrong one. Which was particularly dumb in this case, because I have that other file included a few lines below as well.Oh well, it at least was easy to figure out what I'd done wrong as it was obvious that the class definition I wanted was missing.
-
if(condition) { KeBugCheck(0x000000E2, 0, 0, 0, 0); }
or the Linux flavored counterpart
BUG_ON(condition);
-
-
-
Apply directly to the code base!
grrrrrrr.... now that stupid infomercial is playing in my head....
curse HEAD-ON for their earworm marketing and curse you, but not as much, for reminding me of it!
-
now that stupid infomercial is playing in my head.
It is at moments like this that I am glad I do not have a TV. Happily, I am resistant to earworms such as this, as I have no clue what it is.
-
-
Is it a real product, or is that a parody advert? It looks stupid...
-
I said I was HAPPY not to know about it. I have no intention of making myself unhappy by watching that.
-
Is it a real product, or is that a parody advert? It looks stupid...
It is a real product.
The next version of their adverts went along the lines of
[insert original advert]
Breaks out awkwardly
HeadOn. I hate your commercials, but your product is AMAZING.
-
Apparently, the legend goes, they couldn't legally make any claims about what their product does, as it was entirely untested and basically pure hokum, but they CAN say how to apply it, so they went with that.
-
AND... they had a follow-on product, I think. But I can't remember where you were supposed to put it....