News for hackers. Stuff that matters.
Re:C++ Exceptions: Under the Hood (2013) by zabzonk on Thursday August 12, 2021 @06:14PM (#28162276)
Under the hood of GCC specifically.
Re:C++ Exceptions: Under the Hood (2013) by arcatek on Thursday August 12, 2021 @06:45PM (#28162574)
That's the article I used when I implemented exceptions in an LLVM-based compiler, so it's applicable to more than just GCC.
Re:C++ Exceptions: Under the Hood (2013) by nicolasbrailo on Friday August 13, 2021 @04:29AM (#28166742)
Is your work public? If my article was useful, I'd love to have a look at what you did!
Re:C++ Exceptions: Under the Hood (2013) by arcatek on Friday August 13, 2021 @07:22AM (#28167644)
It's public, but I doubt it still compiles against recent LLVM versions! I started it 8 years ago to get a better understanding how features like classes & operator overload would work in a JS-like language. It was really fun!

https://github.com/castel/libcastel/blob/master/runtime/sour...

https://github.com/castel/libcastel/blob/master/runtime/sour...

I remember that at the time there were very few resources on personality functions, even in the LLVM doc - I had to make a lot of research before finding your articles, which were extremely helpful!

I got reminded of them yesterday after someone pinged me on a Stack Overflow answer I made at the time, asking for an updated link; after I found your long-form article I figured it would be a good topic for HN as well :)

https://stackoverflow.com/questions/16597350/what-is-an-exce...

Re:C++ Exceptions: Under the Hood (2013) by nicolasbrailo on Friday August 13, 2021 @12:18PM (#28170889)
ahhh, I see you got hit by some of the fallout of my migration from Wordpress to Blogspot. Sorry about that!

I tried to set http301s but gave up when I had to pay for it :)

Re:C++ Exceptions: Under the Hood (2013) by cogman10 on Thursday August 12, 2021 @06:17PM (#28162294)
Doesn't GCC support multiple exception handling options?
Re:C++ Exceptions: Under the Hood (2013) by mhh__ on Thursday August 12, 2021 @06:49PM (#28162628)
I'm not sure exactly what you mean but there was a switch to DWARF EH ages ago (GCC 2?)
Re:C++ Exceptions: Under the Hood (2013) by account42 on Friday August 13, 2021 @07:03AM (#28167530)
sjlj is still supported, at least on some platforms, e.g. MinGW.
Re:C++ Exceptions: Under the Hood (2013) by zabzonk on Thursday August 12, 2021 @06:22PM (#28162354)
I'm not sure what your point is - mine was that the original post is specifically about GCC, not Standard C++.
Re:C++ Exceptions: Under the Hood (2013) by gumby on Friday August 13, 2021 @12:14AM (#28165373)
“Standard C++” just specifies `throw` and `catch` (plus what happens when you traverse a block, nothrow declaration etc)

Every implementation has to do something to actually be standard C, and this is an example. It’s rather similar on other hardware, but as far as the standard goes that is irrelevant.

Re:C++ Exceptions: Under the Hood (2013) by cogman10 on Thursday August 12, 2021 @06:38PM (#28162509)
Mainly that exception handling doesn't have a single solution, even in GCC. I'm agreeing with you that this article only highlights one version of exception handling for one compiler.

There's also potential operating system involvement that's not really covered in this article.