@PhilE,
I think there is a misunderstanding. If you create an ELF executable using the "-o" option of the compiler, then try to debug *that* executable, there is not a debugger out there I have found that can do that. I can debug the "mc" and "mc-so" executables all I want, but it is the executables produced by those programs that cannot be debugged. That's what @jojopi was talking about.
BTW I would *love* to be proven wrong on this. Even better, I would love to hear one of your engineers tell me why these ELF executables run fine on PI OS 32, but (usually) crash with a bus error on PI OS 64.
I think there is a misunderstanding. If you create an ELF executable using the "-o" option of the compiler, then try to debug *that* executable, there is not a debugger out there I have found that can do that. I can debug the "mc" and "mc-so" executables all I want, but it is the executables produced by those programs that cannot be debugged. That's what @jojopi was talking about.
BTW I would *love* to be proven wrong on this. Even better, I would love to hear one of your engineers tell me why these ELF executables run fine on PI OS 32, but (usually) crash with a bus error on PI OS 64.
Code:
pi@anchorstool:/jkwork/Squint $ ./mc-so -o hello tests/hello.cpi@anchorstool:/jkwork/Squint $ ./hellohello, worldpi@anchorstool:/jkwork/Squint $ gdb helloGNU gdb (Raspbian 8.2.1-2) 8.2.1Copyright (C) 2018 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law.Type "show copying" and "show warranty" for details.This GDB was configured as "arm-linux-gnueabihf".Type "show configuration" for configuration details.For bug reporting instructions, please see:<http://www.gnu.org/software/gdb/bugs/>.Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>.For help, type "help".Type "apropos word" to search for commands related to "word"..."/jkwork/Squint/hello": not in executable format: file format not recognized(gdb) runStarting program: No executable file specified.Use the "file" or "exec-file" command.(gdb) qpi@anchorstool:/jkwork/Squint $ scripts/disasm hello120+0 records in120+0 records out120 bytes copied, 0.0025229 s, 47.6 kB/shello.asmtmp: file format binaryDisassembly of section .data:00000000 <.data>: 0:e3a0b000 movfp, #0 4:e3a0e000 movlr, #0 8:e49d1004 pop{r1}; (ldr r1, [sp], #4) c:e1a0200d movr2, sp 10:e52d2004 push{r2}; (str r2, [sp, #-4]!) 14:e52d0004 push{r0}; (str r0, [sp, #-4]!) 18:e3a0c000 movip, #0 1c:e52dc004 push{ip}; (str ip, [sp, #-4]!) 20:e28f0010 addr0, pc, #16 24:e3a03000 movr3, #0 28:eb00001b bl0x9c 2c:e3a0007f movr0, #127; 0x7f 30:e3a07001 movr7, #1 34:ef000000 svc0x00000000 38:e92d5ff0 push{r4, r5, r6, r7, r8, r9, sl, fp, ip, lr} 3c:e52d0004 push{r0}; (str r0, [sp, #-4]!) 40:e52d1004 push{r1}; (str r1, [sp, #-4]!) 44:eb000001 bl0x50 48:e28dd008 addsp, sp, #8 4c:e8bd9ff0 pop{r4, r5, r6, r7, r8, r9, sl, fp, ip, pc} 50:e92d4800 push{fp, lr} 54:e28db000 addfp, sp, #0 58:e59f0010 ldrr0, [pc, #16]; 0x70 5c:e28fe000 addlr, pc, #0 60:e59ff00c ldrpc, [pc, #12]; 0x74 64:e3a00000 movr0, #0 68:e28bd000 addsp, fp, #0 6c:e8bd8800 pop{fp, pc} 70:b6525008 ldrbltr5, [r2], -r8 74:b592315c ldrltr3, [r2, #348]; 0x15cpi@anchorstool:/jkwork/Squint $ Statistics: Posted by HPCguy — Tue Apr 22, 2025 3:45 pm