File tree Expand file tree Collapse file tree 5 files changed +242
-77
lines changed Expand file tree Collapse file tree 5 files changed +242
-77
lines changed Original file line number Diff line number Diff line change 22 path = cnfa
33 url = https://github.com/cntools/cnfa
44 shallow = true
5+ [submodule "mini-gdbstub "]
6+ path = mini-gdbstub
7+ url = https://github.com/RinHizakura/mini-gdbstub
8+ shallow = true
Original file line number Diff line number Diff line change @@ -105,6 +105,14 @@ OBJS := \
105105
106106deps := $(OBJS:%.o=.%.o.d )
107107
108+ GDBSTUB_LIB := mini-gdbstub/build/libgdbstub.a
109+ LDFLAGS += $(GDBSTUB_LIB )
110+ mini-gdbstub/Makefile :
111+ git submodule update --init $(dir $@ )
112+ $(GDBSTUB_LIB ) : mini-gdbstub/Makefile
113+ $(MAKE ) -C $(dir $< )
114+ $(OBJS ) : $(GDBSTUB_LIB )
115+
108116$(BIN ) : $(OBJS )
109117 $(VECHO ) " LD\t$@ \n"
110118 $(Q )$(CC ) -o $@ $^ $(LDFLAGS )
@@ -152,6 +160,7 @@ build-image:
152160
153161clean :
154162 $(Q )$(RM ) $(BIN ) $(OBJS ) $(deps )
163+ $(Q )$(MAKE ) -C mini-gdbstub clean
155164
156165distclean : clean
157166 $(Q )$(RM ) riscv-harts.dtsi
Original file line number Diff line number Diff line change @@ -355,9 +355,11 @@ bool virtio_snd_init(virtio_snd_state_t *vsnd);
355355
356356/* memory mapping */
357357typedef struct {
358+ bool debug ;
358359 bool stopped ;
359360 uint32_t * ram ;
360361 uint32_t * disk ;
362+ vm_t vm ;
361363 plic_state_t plic ;
362364 u8250_state_t uart ;
363365#if SEMU_HAS (VIRTIONET )
@@ -376,4 +378,10 @@ typedef struct {
376378#if SEMU_HAS (VIRTIOSND )
377379 virtio_snd_state_t vsnd ;
378380#endif
381+
382+ uint32_t peripheral_update_ctr ;
383+
384+ /* The fields used for debug mode */
385+ bool is_interrupted ;
386+ int curr_cpuid ;
379387} emu_state_t ;
You can’t perform that action at this time.
0 commit comments