This commit is contained in:
yunwei37
2024-10-03 03:31:55 +00:00
parent 252625d27c
commit 6f7bc37a6a
353 changed files with 165801 additions and 0 deletions

BIN
third_party/blazesym/data/dwarf-example vendored Executable file

Binary file not shown.

22
third_party/blazesym/data/test-gsym.c vendored Normal file
View File

@@ -0,0 +1,22 @@
/* The sample program is used to generate test.gsym.
*
* Chosen functions are placed in dedicated sections to allow for control placement.
*/
__attribute__((section(".text.factorial"))) unsigned int
factorial(unsigned int n) {
if (n == 0)
return 1;
return factorial(n - 1) * n;
}
static inline void
factorial_inline_wrapper() {
factorial(5);
}
__attribute__((section(".text.main"))) int
main(int argc, const char *argv[]) {
factorial_inline_wrapper();
return 0;
}

40
third_party/blazesym/data/test-gsym.ld vendored Normal file
View File

@@ -0,0 +1,40 @@
SECTIONS {
.text (0x2000000) : {
*(.text.main)
*(.text)
. = ABSOLUTE(0x2000100);
*(.text.factorial)
}
.data : {
*(.data)
}
.bss : {
*(.bss)
}
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0.
*/
/* DWARF 1. */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions. */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2. */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2. */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/DISCARD/ : {
*(.*)
}
}

22
third_party/blazesym/data/test.c vendored Normal file
View File

@@ -0,0 +1,22 @@
/*
* The sample program is used to generate test.bin.
*/
#include <stdio.h>
static
unsigned int fibonacci(unsigned int n) {
if (n <= 1)
return n;
return fibonacci(n - 1) + fibonacci(n - 2);
}
int
main() {
int i;
printf("calculate fibonacci(n); n = ");
scanf("%d", &i);
printf("fibonacci(%d) = %d\n", i, fibonacci(i));
return 0;
}