Closed EagleTw closed 10 months ago
Hi @ypaskell ,
Based on the error message you provided and the version of gdb you're using, it seems that this issue may be caused by gdb versions older than 10.1 not supporting DWARFv5. I suggest trying to update your gdb to a newer version to see if that resolves the problem. Here are some references for your information: GDB < 10.1 can't read clang's DWARF v5
Thank you @visitorckw. It worked.
GDB got stuck when I set any break points and when I run start
commands
GNU gdb (Ubuntu 10.2-0ubuntu1~20.04~1) 10.2
Copyright (C) 2021 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 "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://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"...
Reading symbols from ./build/rv32jit...
(gdb) break Execute
^C^C^C
<system got hang here>
Tried solution:
kill -9 %1
run
, it successfully executes
(gdb) r
Starting program: /home/livlig/ypaskellPlayground/rv32jit/build/rv32jit build/aes.elf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1”.
Test results
AES-128 ECB encryption: PASSED!
AES-128 ECB decryption: PASSED!
AES-128 CBC encryption: PASSED!
AES-128 CBC decryption: PASSED!
AES-128 CFB encryption: PASSED!
AES-128 CFB decryption: PASSED!
AES-128 OFB encryption: PASSED!
AES-128 OFB decryption: PASSED!
AES-128 CTR encryption: PASSED!
AES-128 CTR decryption: PASSED!
AES-128 XTS encryption: PASSED!
AES-128 XTS decryption: PASSED!
AES-128 plaintext CMAC: PASSED!
AES-128 Poly1305 auth.: PASSED!
AES-128 GCM encryption: PASSED!
AES-128 GCM decryption: PASSED!
AES-128 CCM encryption: PASSED!
AES-128 CCM decryption: PASSED!
AES-128 OCB encryption: PASSED!
AES-128 OCB decryption: PASSED!
AES-128 SIV encryption: PASSED!
AES-128 SIV decryption: PASSED!
AES-128 GCMSIV encrypt: PASSED!
AES-128 GCMSIV decrypt: PASSED!
AES-128 EAX encryption: PASSED!
AES-128 EAX decryption: PASSED!
AES-128 FF1 encryption: PASSED!
AES-128 FPE decryption: PASSED!
AES-128 key wrapping : PASSED!
AES-128 key unwrapping: PASSED!
+-> Let's do some extra tests
AES-128 OCB encryption: PASSED!
AES-128 OCB decryption: PASSED!
AES-128 GCMSIV encrypt: PASSED!
AES-128 GCMSIV decrypt: PASSED!
AES-128 GCMSIV encrypt: PASSED!
AES-128 GCMSIV decrypt: PASSED!
AES-128 SIV encryption: PASSED!
AES-128 SIV decryption: PASSED!
AES-128 SIV encryption: PASSED!
AES-128 SIV decryption: PASSED!
AES-128 EAX encryption: PASSED!
AES-128 EAX decryption: PASSED!
AES-128 EAX encryption: PASSED!
AES-128 EAX decryption: PASSED!
AES-128 Poly1305 auth.: PASSED!
AES-128 Poly1305 auth.: PASSED!
[Inferior 1 (process 60613) exited normally]
set follow-fork-mode child
does not workBefore proceeding, it is necessary to disable link-time optimization (LTO) and ensure a debug build. Refer to the changes below:
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
include mk/common.mk
-CXXFLAGS := -O2 -flto -Wall -Wextra -Wno-c99-designator
+CXXFLAGS := -Og -g -Wall -Wextra -Wno-c99-designator
CXXFLAGS += -I src
CXXFLAGS += -std=gnu++20 -fno-rtti -fexceptions
LDFLAGS :=
Tested with GDB 14.0.50.20230907-0ubuntu1.
$ gdb -q --args build/rv32jit build/aes.elf
Reading symbols from build/rv32jit...
(gdb) b main
Breakpoint 1 at 0x2bf5d: file src/main.cpp, line 9.
(gdb) r
Starting program: /home/jserv/compiler/rv32jit/build/rv32jit build/aes.elf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, main (argc=2, argv=0x7fffffffe198) at src/main.cpp:9
9 if (argc < 2) {
Reproducing steps:
vim Makefile
add-g
option inCXXFLAGS
make clean
andmake
gdb --args ./build/rv32jit build/aes.elf
Error message shown as follows: