From 71d7e561bdc2e58cef7fedcec1970dafc852bb61 Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Tue, 3 Jan 2023 08:56:00 -0500 Subject: [PATCH] Comment --- Readme.md | 10 ++++++++++ src/builder.rs | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/Readme.md b/Readme.md index a74750228ba0..e9c719d84722 100644 --- a/Readme.md +++ b/Readme.md @@ -172,6 +172,16 @@ debug_gimple_stmt(gimple_struct) To get the `rustc` command to run in `gdb`, add the `--verbose` flag to `cargo build`. +To have the correct file paths in `gdb` instead of `/usr/src/debug/gcc/libstdc++-v3/libsupc++/eh_personality.cc`, TODO + +Maybe by calling the following at the beginning of gdb: + +``` +set substitute-path /usr/src/debug/gcc /home/bouanto/Ordinateur/Programmation/Projets/gcc-repo/gcc +``` + +TODO: but that's not what I remember I was doing. + ### How to use a custom-build rustc * Build the stage2 compiler (`rustup toolchain link debug-current build/x86_64-unknown-linux-gnu/stage2`). diff --git a/src/builder.rs b/src/builder.rs index 082b7be8c4e3..fd674ed0b871 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -1210,6 +1210,14 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { fn cleanup_landing_pad(&mut self, _ty: Type<'gcc>, pers_fn: RValue<'gcc>) -> RValue<'gcc> { self.set_personality_fn(pers_fn); + /* + * Matching GCC exception handling with LLVM: + * + * GCC LLVM + * CATCH_EXPR landing pad catch clause + * TRY_FINALLY_EXPR cleanup + */ + self.cleanup_blocks.borrow_mut().insert(self.block); // FIXME: we're probably not creating a real cleanup pad here.