pulp-platform / debug_bridge

BSD 3-Clause "New" or "Revised" License
7 stars 9 forks source link

DBG module not initialised on gdb connect #4

Open soybean-hust opened 7 years ago

soybean-hust commented 7 years ago

DB_PPC retains the last stopped value on new debug session, there are chances debug bridge will use that old value in 'resume_core' and will miss the BP that has the same value. Recommend to fix that with proper initialised DBG_PPC value.

soybean-hust commented 7 years ago

Hi,

Attached is modified debug-bridge as well as a patch to riscv-gnu-gdb. There is a README file in gdb patch dir.

official riscv-gdb using this version. 3f21b5c9675db61ef5462442b6a068d4a3da8aaf

Regards.

soy

2017-08-09 6:03 GMT+08:00 Christian Palmiero notifications@github.com:

Hi soybean-hust, are you able to debug a PULPino application using GDB on FPGA? When I launch the debug_bridge on the FPGA I get this:

./debug_bridge FPGA SPI device opened! Unknown platform, trying auto-detect Detected PULPino Found a core with id 0 Debug bridge listening on port 1234 RSP: Client connected! Received $qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+; fork-events+;vfork-events+;exec-events+;vContSupported+; QThreadEvents+;no-resumed+ Sending $PacketSize=256#cd Received $vMustReplyEmpty Unknown v packet Debug bridge listening on port 1234

When I launch gdb on my laptop I get this:

/opt/riscv/bin/riscv32-unknown-elf-gdb -ex "target remote ipaddr:1234" helloworld.elf GNU gdb (GDB) 7.12.50.20170505-git Copyright (C) 2016 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 "--host=x86_64-pc-linux-gnu --target=riscv32-unknown-elf". 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"... Reading symbols from helloworld.elf...done. Remote debugging using 192.168.2.2:1234 Ignoring packet error, continuing... Remote replied unexpectedly to 'vMustReplyEmpty': timeout

Which procedure did you follow in order to use a fully-working GDB? Thanks in advance!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pulp-platform/debug_bridge/issues/4#issuecomment-321094864, or mute the thread https://github.com/notifications/unsubscribe-auth/AZTnhiM6e2P-VsRuooXQNlZ9XoUVBpgrks5sWNs5gaJpZM4OM9cB .

soybean-hust commented 7 years ago

After bootup finished, use spiload to run anything first, then run debug_bridge. Then run gdb remote debugging. Use 'file xxx.elf' to load debug symbole. Use 'load xxx.elf' to load your program to pupino FPGA. Then you should be able to run b xxx.

My previous tgz contains some modifications so you can use it with some gdb GUI front end better, besides some debug-bridge bug fix. If you only need cmdline gdb, just try the above steps..

soy

2017-08-14 15:46 GMT+08:00 ShunYu Zhu shunyu.zhu@gmail.com:

Hi,

Attached is modified debug-bridge as well as a patch to riscv-gnu-gdb. There is a README file in gdb patch dir.

official riscv-gdb using this version. 3f21b5c9675db61ef5462442b6a068d4a3da8aaf

Regards.

soy

2017-08-09 6:03 GMT+08:00 Christian Palmiero notifications@github.com:

Hi soybean-hust, are you able to debug a PULPino application using GDB on FPGA? When I launch the debug_bridge on the FPGA I get this:

./debug_bridge FPGA SPI device opened! Unknown platform, trying auto-detect Detected PULPino Found a core with id 0 Debug bridge listening on port 1234 RSP: Client connected! Received $qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork -events+;vfork-events+;exec-events+;vContSupported+;QThrea dEvents+;no-resumed+ Sending $PacketSize=256#cd Received $vMustReplyEmpty Unknown v packet Debug bridge listening on port 1234

When I launch gdb on my laptop I get this:

/opt/riscv/bin/riscv32-unknown-elf-gdb -ex "target remote ipaddr:1234" helloworld.elf GNU gdb (GDB) 7.12.50.20170505-git Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.ht ml 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 "--host=x86_64-pc-linux-gnu --target=riscv32-unknown-elf". 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"... Reading symbols from helloworld.elf...done. Remote debugging using 192.168.2.2:1234 Ignoring packet error, continuing... Remote replied unexpectedly to 'vMustReplyEmpty': timeout

Which procedure did you follow in order to use a fully-working GDB? Thanks in advance!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pulp-platform/debug_bridge/issues/4#issuecomment-321094864, or mute the thread https://github.com/notifications/unsubscribe-auth/AZTnhiM6e2P-VsRuooXQNlZ9XoUVBpgrks5sWNs5gaJpZM4OM9cB .

ChristianPalmiero commented 7 years ago

Sorry, where is your attachment? I cannot find it in your previous comments. Thanks in advance!

soybean-hust commented 7 years ago

attached with email on Aug.14.

2017-08-14 21:26 GMT+08:00 Christian Palmiero notifications@github.com:

Sorry, where is your attachment? I cannot find it in your previous comments. Thanks in advance!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pulp-platform/debug_bridge/issues/4#issuecomment-322189206, or mute the thread https://github.com/notifications/unsubscribe-auth/AZTnhg5s0wTH5X8KDoaVfI5T1WofF_Ntks5sYErrgaJpZM4OM9cB .