Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Unable to debug using gdb

62 views
Skip to first unread message

Susmita Nayak

unread,
Jul 16, 2024, 6:49:51 AM7/16/24
to RISC-V SW Dev
Hi Team,

I am trying to debug a C program using the gdb tool but I am getting some issues.

The file name is "factorial.c"

It is compiled using gcc toolchain with debug features.

$ gcc -g -o factorial factorial.c
$ gdb
$ run #Getting the output as shown in the attchment.

While doing steprun or setting a breakpoint, it's not working.

$ step 

Screenshot 2024-07-16 at 4.18.54 PM.png

Please let me know if I am making any mistake here.

Screenshot 2024-07-16 at 4.17.24 PM.png

Bruce Hoult

unread,
Jul 16, 2024, 10:14:10 PM7/16/24
to Susmita Nayak, RISC-V SW Dev
Are you trying to do these other commands after the program has been run, printed its result, and exited?

Also, there is no RISC-V relevance here -- it's the same for every ISA.

--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/2ffb6e60-b148-4f6e-aa23-7e4fa68fa9bcn%40groups.riscv.org.

Susmita Nayak

unread,
Jul 16, 2024, 11:53:36 PM7/16/24
to Bruce Hoult, RISC-V SW Dev
Hi Team,

I got the output. Thanks, anyway.

Best Regards,
Susmita Nayak 
Principal Engineer


Reply all
Reply to author
Forward
0 new messages