IRC logs for #openrisc Sunday, 2018-06-17

--- Log opened Sun Jun 17 00:00:16 2018
shivm28[m]shorne: Hi, I went through the implementation of gdbserver in openOCD. In openOCD, we can use GDB to program the board as well but that feature will be missing from the osd-gdb server, right?02:56
shivm28[m]We need GDB just to set breakpoints/watchpoints and monitor registers.03:02
shivm28[m]I have also worked on a blog with some important aspects of OSD-GDB server:06:26
shorneshivm28[m]: great09:39
shorneas mentioned offline, as far as programming the board uploading bitsream would be out of scope, but uploading a binary should be possible09:40
shorneits just, halt cpu, write to memory, update PC spr, start cpu09:40
shornethose are all gdb interface commands09:40
shorneshivm28[m]: hello, did I have you this link10:28
shornedownload: or1k-elf-9.0.0-20180612.tar.xz10:28
shorneI mean... I thought I sent you the link to download10:29
shorneso download it, let me know when you are done10:29
shivm28[m]Done and extracted10:30
shorneok, can you add the or1k-elf/bin directory to your PATH?10:30
shorneyou should now be able to see or1k-elf-gcc -version10:31
shorneyou should see10:31
shorne$ or1k-elf-gcc --version10:31
shorneor1k-elf-gcc (GCC) 9.0.0 20180426 (experimental)10:31
shivm28[m]I got: or1k-elf-gcc (GCC) 5.3.010:32
shivm28[m]Copyright (C) 2015 Free Software Foundation, Inc.10:32
shivm28[m]This is probably an older already installed version.10:32
shorneyou said you didnt have one10:32
shorne$ or1k-elf-gdb --version10:33
shorneGNU gdb (GDB)
shornecan you fix your path to point to the one I asked?10:33
shivm28[m]I never worked with it. Maybe it came with HDMI2USB/LiteX firmware.  I will try to fix the path10:34
shivm28[m]I got: or1k-elf-gcc (GCC) 9.0.0 20180426 (experimental)10:35
shorneand gdb?10:36
shivm28[m]GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.110:36
shivm28[m]I will fix that as well10:37
shornedid you run what I ased?10:38
shorne$ or1k-elf-gdb --version10:38
shornethe above looks like you ran 'gdb --version'10:38
shivm28[m]Oh yes, you are right.10:39
shivm28[m]It worked. Now, I get: GNU gdb (GDB)
shorneok, now write a simple pogram like hellow world and compile it10:40
shornei.e. #include <stdio.h>10:40
shorneint main() {10:40
shorne  printf ("hello gcc from or1k\n");10:40
shorne  return 0;10:40
shorne$ or1k-elf-gcc -g hello.c10:41
shornesorry, its getting late10:42
shorneonce you rare done you can do..10:42
shorne1. $ or1k-elf-run ./a.out10:42
shorne2. ... try in gdb10:42
shorne$ or1k-elf-gdb a.out10:43
shivm28[m]NO worries. I will complete the instructions and get back to you tomorrow. Thanks a lot!!10:44
shorneStep 2.10:45
shornetry to debug in gdb with the build in sim (later we will do with actual remote)10:45
shorne$ or1k-elf-gdb10:45
shivm28[m]The code is compiled and I am getting "Hello World" output10:45
shorne(gdb) target sim10:46
shorne(gdb) load a.out10:46
shorne(gdb) run10:46
shorne... it should run to completion10:46
shorne(gdb) b main10:46
shorne(gdb) run10:47
shorneit should break at the main function10:47
shorne^^ Notice above in gdb we did 'target sim'10:47
shornewhen you want to connect remote we do 'target remote localhost:1234'10:48
shorneand notice 'load', that will load the program into the target's memory10:48
shornefor 'target remote' we will want to use qemu/openocd ... then in the future 'open soc debug'10:49
shorneI am off10:49
shivm28[m]GDB is working fine in simulation. I will try running it with qemu/openocd10:55
shivm28[m]I installed qemu using "sudo apt-get install qemu qemu-system" but couldn't find any good resource to move further.16:55
shivm28[m]Some resources I referred to:
--- Log closed Mon Jun 18 00:00:18 2018

Generated by 2.15.2 by Marius Gedminas - find it at!