-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76cc538
commit 1e293e7
Showing
6 changed files
with
12 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
#include "fuga.h" | ||
|
||
struct CustomException {}; | ||
|
||
void throw_exception_fuga() { | ||
throw CustomException(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
#include "hoge.h" | ||
#include "fuga.h" | ||
|
||
int main() { | ||
std::cout << "catch_exception" << std::endl; | ||
catch_exception_hoge(); | ||
|
||
std::cout << "throw_exception" << std::endl; | ||
catch_exception_fuga(); | ||
try { | ||
throw_exception_hoge(); | ||
} catch (std::exception& e) { | ||
std::cout << e.what() << std::endl; | ||
throw_exception_fuga(); | ||
} catch (CustomException& e) { | ||
std::cout << "Caught CustomException" << std::endl; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
#! /bin/bash -eu | ||
|
||
g++ -fPIC -shared -o libfuga.so -Wl,-soname,libfuga.so fuga.cc | ||
g++ -fPIC -shared -o libhoge.so.original -Wl,-soname,libhoge.so hoge.cc libfuga.so | ||
g++ main.cc -o main.out libhoge.so.original libfuga.so | ||
LD_LIBRARY_PATH=. $(git rev-parse --show-toplevel)/build/sold -i libhoge.so.original -o libhoge.so.soldout --section-headers --check-output | ||
g++ main.cc -o main.out libfuga.so | ||
LD_LIBRARY_PATH=. $(git rev-parse --show-toplevel)/build/sold -i libfuga.so.original -o libfuga.so.soldout --section-headers --check-output | ||
|
||
cp libfuga.so libfuga.so.original | ||
# Use sold | ||
ln -sf libhoge.so.soldout libhoge.so | ||
# Use original | ||
ln -sf libhoge.so.original libhoge.so | ||
# ln -sf libhoge.so.original libhoge.so | ||
ln -sf libfuga.so.soldout libfuga.so | ||
|
||
LD_LIBRARY_PATH=. ./main.out |