about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs
AgeCommit message (Collapse)AuthorLines
2025-09-21port `#[debugger_visualizer]` to the new attribute systemJana Dönszelmann-1/+1
2025-08-24Rename `llvm::Bool` aliases to standard const caseZalathar-1/+1
This avoids the need for `#![allow(non_upper_case_globals)]`.
2025-08-06Revert "Preserve the .debug_gdb_scripts section"bjorn3-16/+14
This reverts commit 868bdde25b030e0b71a29a5dbc04a891036e702e.
2025-08-06Revert "Embed GDB pretty printers in rlibs and dylibs"bjorn3-11/+32
This reverts commit b4d923cea0509933b1fb859930cb20784251f9be.
2025-08-06Embed GDB pretty printers in rlibs and dylibsSebastian Poeplau-32/+11
Instead of collecting pretty printers transitively when building executables/staticlibs/cdylibs, let the debugger find each crate's pretty printers via its .debug_gdb_scripts section. This covers the case where libraries defining custom pretty printers are loaded dynamically.
2025-08-05Preserve the .debug_gdb_scripts sectionSebastian Poeplau-14/+16
Make sure that compiler and linker don't optimize the section's contents away by adding the global holding the data to "llvm.used". The volatile load in the main shim is retained because "llvm.used", which translates to SHF_GNU_RETAIN on ELF targets, requires a reasonably recent linker; emitting the volatile load ensures compatibility with older linkers, at least when libstd is used. Pretty printers in dylib dependencies are now emitted by the main crate instead of the dylib; apart from matching how rlibs are handled, this approach has the advantage that `omit_gdb_pretty_printer_section` keeps working with dylib dependencies.
2025-08-01Remove the omit_gdb_pretty_printer_section attributebjorn3-7/+1
Disabling loading of pretty printers in the debugger itself is more reliable. Before this commit the .gdb_debug_scripts section couldn't be included in dylibs or rlibs as otherwise there is no way to disable the section anymore without recompiling the entire standard library.
2025-07-31remove rustc_attr_data_structuresJana Dönszelmann-1/+2
2025-07-16Rollup merge of #143920 - oli-obk:cg-llvm-safety, r=jieyouxuSamuel Tardieu-1/+1
Make more of codegen_llvm safe Best reviewed commit-by-commit.
2025-07-14Avoid a bunch of unnecessary `unsafe` blocks in cg_llvmOli Scherer-1/+1
2025-07-12Port `#[omit_gdb_pretty_printer_section]` to the new attribute parsing ↵Jonathan Brouwer-3/+2
infrastructure Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-05-04Initial support for dynamically linked cratesBryanskiy-1/+5
2025-02-18Move methods from `Map` to `TyCtxt`, part 2.Nicholas Nethercote-1/+1
Continuing the work started in #136466. Every method gains a `hir_` prefix, though for the ones that already have a `par_` or `try_par_` prefix I added the `hir_` after that.
2025-02-11Document some safety constraints and use more safe wrappersOli Scherer-1/+1
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-1/+1
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-10-30Consistently use safe wrapper function `set_section`Zalathar-1/+1
2024-10-26Use safe wrappers `get_linkage` and `set_linkage`Zalathar-1/+1
2024-09-19Reformat some comments.Nicholas Nethercote-1/+2
So they are less than 100 chars.
2024-08-27Rollup merge of #126013 - nnethercote:unreachable_pub, r=UrgauMatthias Krüger-3/+5
Add `#[warn(unreachable_pub)]` to a bunch of compiler crates By default `unreachable_pub` identifies things that need not be `pub` and tells you to make them `pub(crate)`. But sometimes those things don't need any kind of visibility. So they way I did these was to remove the visibility entirely for each thing the lint identifies, and then add `pub(crate)` back in everywhere the compiler said it was necessary. (Or occasionally `pub(super)` when context suggested that was appropriate.) Tedious, but results in more `pub` removal. There are plenty more crates to do but this seems like enough for a first PR. r? `@compiler-errors`
2024-08-20Avoid extra `cast()`s after `CStr::as_ptr()`Josh Stone-3/+2
These used to be `&str` literals that did need a pointer cast, but that became a no-op after switching to `c""` literals in #118566.
2024-08-16Add `warn(unreachable_pub)` to `rustc_codegen_llvm`.Nicholas Nethercote-3/+5
2024-07-29Reformat `use` declarations.Nicholas Nethercote-6/+7
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2023-12-03compiler: replace cstr macro with c str literals in compiler and few other c ↵klensy-4/+3
str replacements
2023-08-09rustc: Move `crate_types` from `Session` to `GlobalCtxt`Vadim Petrochenkov-1/+1
Removes a piece of mutable state. Follow up to #114578.
2023-08-01Auto merge of #105545 - erikdesjardins:ptrclean, r=bjorn3bors-2/+1
cleanup: remove pointee types This can't be merged until the oldest LLVM version we support uses opaque pointers, which will be the case after #114148. (Also note `-Cllvm-args="-opaque-pointers=0"` can technically be used in LLVM 15, though I don't think we should support that configuration.) I initially hoped this would provide some minor perf win, but in https://github.com/rust-lang/rust/pull/105412#issuecomment-1341224450 it had very little impact, so this is only valuable as a cleanup. As a followup, this will enable #96242 to be resolved. r? `@ghost` `@rustbot` label S-blocked
2023-07-30inline format!() args up to and including rustc_codegen_llvmMatthias Krüger-1/+1
2023-07-29cg_llvm: remove pointee types and pointercast/bitcast-of-ptrErik Desjardins-2/+1
2023-07-05Revert "use new c literals instead of cstr! macro"León Orell Valerian Liehr-1/+2
This reverts commit a17561ffc90c900cb7d0e96b00c6381244764ef7.
2023-05-31use new c literals instead of cstr! macroklensy-2/+1
2023-05-16Move DebuggerVisualizerFile types from rustc_span to rustc_middleMichael Woerister-2/+1
2023-04-17Spelling - compilerJosh Soref-2/+2
* account * achieved * advising * always * ambiguous * analysis * annotations * appropriate * build * candidates * cascading * category * character * clarification * compound * conceptually * constituent * consts * convenience * corresponds * debruijn * debug * debugable * debuggable * deterministic * discriminant * display * documentation * doesn't * ellipsis * erroneous * evaluability * evaluate * evaluation * explicitly * fallible * fulfill * getting * has * highlighting * illustrative * imported * incompatible * infringing * initialized * into * intrinsic * introduced * javascript * liveness * metadata * monomorphization * nonexistent * nontrivial * obligation * obligations * offset * opaque * opportunities * opt-in * outlive * overlapping * paragraph * parentheses * poisson * precisely * predecessors * predicates * preexisting * propagated * really * reentrant * referent * responsibility * rustonomicon * shortcircuit * simplifiable * simplifications * specify * stabilized * structurally * suggestibility * translatable * transmuting * two * unclosed * uninhabited * visibility * volatile * workaround Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-03-22rustc: Remove unused `Session` argument from some attribute functionsVadim Petrochenkov-2/+2
2022-07-18avoid `Symbol` to `&str` conversionsTakayuki Maeda-1/+1
2022-05-24Update documentation.ridwanabdillahi-2/+2
2022-05-24Add support for embedding pretty printers via the `#[debugger_visualizer]` ↵ridwanabdillahi-2/+54
attribute. Add tests for embedding pretty printers and update documentation. Ensure all error checking for `#[debugger_visualizer]` is done up front and not when the `debugger_visualizer` query is run. Clean up potential ODR violations when embedding pretty printers into the `__rustc_debug_gdb_scripts_section__` section. Respond to PR comments and update documentation.
2021-12-16Remove `in_band_lifetimes` from `rustc_codegen_llvm`LegionMammal978-1/+1
See #91867 for more information.
2021-10-01Fix clippy lintsGuillaume Gomez-4/+2
2021-08-04Prepare inbounds_gep for opaque pointersTomasz Miąsko-4/+3
Implement inbounds_gep using LLVMBuildInBoundsGEP2 which takes an explicit type argument instead of deriving it from a pointer type.
2021-07-09Pass type when creating loadNikita Popov-1/+1
This makes load generation compatible with opaque pointers. The generation of nontemporal copies still accesses the pointer element type, as fixing this requires more movement.
2020-11-08Collapse all uses of `target.options.foo` into `target.foo`Vadim Petrochenkov-1/+1
with an eye on merging `TargetOptions` into `Target`. `TargetOptions` as a separate structure is mostly an implementation detail of `Target` construction, all its fields logically belong to `Target` and available from `Target` through `Deref` impls.
2020-10-15Replace target.target with target and target.ptr_width with target.pointer_widthest31-1/+1
Preparation for a subsequent change that replaces rustc_target::config::Config with its wrapped Target. On its own, this commit breaks the build. I don't like making build-breaking commits, but in this instance I believe that it makes review easier, as the "real" changes of this PR can be seen much more easily. Result of running: find compiler/ -type f -exec sed -i -e 's/target\.target\([)\.,; ]\)/target\1/g' {} \; find compiler/ -type f -exec sed -i -e 's/target\.target$/target/g' {} \; find compiler/ -type f -exec sed -i -e 's/target.ptr_width/target.pointer_width/g' {} \; ./x.py fmt
2020-08-30mv compiler to compiler/mark-0/+71