Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
CeciPipePasPipe
Aug 18, 2004
This pipe not pipe!!
How come the guy is still employed?

Adbot
ADBOT LOVES YOU

CeciPipePasPipe
Aug 18, 2004
This pipe not pipe!!

more falafel please posted:

$10 completely fake dollars says it doesn't work with GCC and -O3.

As ehnus said, there's always int 3 (which can also be triggered with *(int*)13 = 3;

Coincidentally, *(int*)13 = 3 is a pretty good way of causing a breakpoint (not always a recoverable one) on any platform :)

Uh, wouldn't *(int*)13 = 3 cause a general protection fault (and possibly a bus error on archs that require aligned memory access), because you're trying to write the value 0x00000003 into memory at location 0x000000D ? I don't see how this has anything to do with interrupt 3.

CeciPipePasPipe
Aug 18, 2004
This pipe not pipe!!

TSDK posted:

Interrupt 3 is a break to debugger. Causing a general protection fault will also stop execution and drop you to the debugger in most cases.

The only disadvantage is that you normally can't hit F5 and continue execution after hitting the latter, as you can with the former.

Personally, I use a 'DEBUG_BREAK()' macro which is defined on a per-platform basis.

Oh ok, wouldn't it be easier to just do "int breakme=1/0;" or something then?

CeciPipePasPipe
Aug 18, 2004
This pipe not pipe!!

Entheogen posted:

what is so horrible on exiting when exception occurs? For some exceptions it makes sense, and you can print out what the message was before you exit anyways.

It will shut down the entire web server/app server, which is probably not what you want to happen if a single PDF report gets screwed up.

CeciPipePasPipe
Aug 18, 2004
This pipe not pipe!!

rt4 posted:

I usually get a good chuckle by looking at the code that some affiliates think my employer should place on their websites. For some reason, in addition to the horror that is tracking pixels, they like to include JavaScript that generates tracking pixels. I found this in one today and was sincerely confused
code:
document.write('<i' + 'mg height="1" width="1" border="0" ' + 'src="' + url + '&ifr' + 'ame=0"' + ' />');
document.write('</ifr' + 'ame>');
Why would a programmer go out of his way to do extra concatenations on a string that have no effect?

Not sure why they escape <img> and <iframe> tags, but it may be related to this: http://stackoverflow.com/questions/236073/why-split-the-script-tag-when-writing-it-with-document-write

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply