CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
106 lines
2.9 KiB
Bash
Executable File
106 lines
2.9 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# Script to process llvm-dwarfdump --debug-line output and create a normalized table
|
|
# Usage: process-debug-line.sh <debug-line.txt>
|
|
#
|
|
# Output format: CU_FILE LINE COLUMN FILE_NAME [additional_info]
|
|
# This strips addresses to make rows unique and adds context about which CU and file each line belongs to
|
|
|
|
if [ $# -ne 1 ]; then
|
|
echo "Usage: $0 <debug-line.txt>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
debug_line_file="$1"
|
|
|
|
if [ ! -f "$debug_line_file" ]; then
|
|
echo "Error: File '$debug_line_file' not found" >&2
|
|
exit 1
|
|
fi
|
|
|
|
awk '
|
|
BEGIN {
|
|
cu_count = 0
|
|
current_cu_file = ""
|
|
# Initialize file names array
|
|
for (i = 0; i < 100; i++) {
|
|
current_file_names[i] = ""
|
|
}
|
|
}
|
|
|
|
# Track debug_line sections (new CU)
|
|
/^debug_line\[/ {
|
|
cu_count++
|
|
current_cu_file = ""
|
|
# Clear file names array for new CU
|
|
for (i = 0; i < 100; i++) {
|
|
current_file_names[i] = ""
|
|
}
|
|
next
|
|
}
|
|
|
|
# Capture file names and their indices
|
|
/^file_names\[.*\]:/ {
|
|
# Extract file index using simple string operations
|
|
line_copy = $0
|
|
gsub(/file_names\[/, "", line_copy)
|
|
gsub(/\]:.*/, "", line_copy)
|
|
gsub(/[ \t]/, "", line_copy)
|
|
file_index = line_copy
|
|
|
|
getline # Read the next line which contains the actual filename
|
|
# Extract filename from name: "filename" format
|
|
if (match($0, /name:[ \t]*"/)) {
|
|
filename = $0
|
|
gsub(/.*name:[ \t]*"/, "", filename)
|
|
gsub(/".*/, "", filename)
|
|
current_file_names[file_index] = filename
|
|
|
|
# Extract basename for main CU file (first .c/.cpp/.cc file we see)
|
|
if (current_cu_file == "" && match(filename, /\.(c|cpp|cc)$/)) {
|
|
cu_filename = filename
|
|
gsub(/.*\//, "", cu_filename)
|
|
current_cu_file = cu_filename
|
|
}
|
|
}
|
|
next
|
|
}
|
|
|
|
# Process line table entries
|
|
/^0x[0-9a-f]+/ {
|
|
# Parse the line entry: Address Line Column File ISA Discriminator OpIndex Flags
|
|
if (NF >= 4) {
|
|
line = $2
|
|
column = $3
|
|
file_index = $4
|
|
|
|
# Get the filename for this file index
|
|
filename = current_file_names[file_index]
|
|
if (filename == "") {
|
|
filename = "UNKNOWN_FILE_" file_index
|
|
} else {
|
|
# Extract just the basename
|
|
basename = filename
|
|
gsub(/.*\//, "", basename)
|
|
filename = basename
|
|
}
|
|
|
|
# Build additional info (flags, etc.)
|
|
additional_info = ""
|
|
for (i = 8; i <= NF; i++) {
|
|
if (additional_info != "") {
|
|
additional_info = additional_info " "
|
|
}
|
|
additional_info = additional_info $i
|
|
}
|
|
|
|
# Output normalized row: CU_FILE LINE COLUMN FILE_NAME [additional_info]
|
|
printf "%s %s %s %s", current_cu_file, line, column, filename
|
|
if (additional_info != "") {
|
|
printf " %s", additional_info
|
|
}
|
|
printf "\n"
|
|
}
|
|
}
|
|
' "$debug_line_file"
|