Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ jobs:
build:
strategy:
matrix:
features: ["", "--no-default-features"]
runs-on: ubuntu-latest
include:
- runner: ubuntu-latest
features: ""
- runner: ubuntu-latest
features: "--no-default-features"
- runner: ubuntu-24.04-arm
features: ""
- runner: ubuntu-24.04-arm
features: "--no-default-features"
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v3
- name: Install deps
Expand Down
4 changes: 1 addition & 3 deletions elfcore/src/arch/aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@

//! Aarch64 specifics for ELF core dump files.

#![cfg(target_arch = "aarch64")]

use super::ArchComponentState;
use crate::CoreError;
use zerocopy::AsBytes;

#[cfg(target_os = "linux")]
use crate::ptrace::ptrace_get_reg_set;
use crate::linux::ptrace::ptrace_get_reg_set;
#[cfg(target_os = "linux")]
use nix::unistd::Pid;

Expand Down
8 changes: 7 additions & 1 deletion elfcore/src/coredump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ fn round_up(value: usize, alignment: usize) -> usize {
return 0;
}

if value % alignment != 0 {
if !value.is_multiple_of(alignment) {
(value + alignment) / alignment * alignment
} else {
value
Expand Down Expand Up @@ -1125,6 +1125,9 @@ mod tests {
cmd_line: "".to_string(),

arch_state: Box::new(ArchState {
#[cfg(target_arch = "aarch64")]
gpr_state: vec![0; 34],
#[cfg(target_arch = "x86_64")]
gpr_state: vec![0; 27],
components: vec![],
}),
Expand Down Expand Up @@ -1181,6 +1184,9 @@ mod tests {
cmd_line: "".to_string(),

arch_state: Box::new(ArchState {
#[cfg(target_arch = "aarch64")]
gpr_state: vec![0; 34],
#[cfg(target_arch = "x86_64")]
gpr_state: vec![0; 27],
components: vec![],
}),
Expand Down
3 changes: 3 additions & 0 deletions elfcore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ pub trait ReadProcessMemory {
/// cmd_line: "example".to_string(),
///
/// arch_state: Box::new(ArchState {
/// #[cfg(target_arch = "aarch64")]
/// gpr_state: vec![0; 34],
/// #[cfg(not(target_arch = "aarch64"))]
/// gpr_state: vec![0; 27],
/// components: vec![],
/// }),
Expand Down