> On 08 Jun 2015, at 22:27, Peter Maydell <peter.mayd...@linaro.org> wrote: > > That would also fix this problem, yes. It would still leave one > use case wrong: > * start QEMU > * [cpu reset happens here; we load sp/pc] > * in the debugger load an image (with a vector table) by writing it to RAM > * let CPU run
I already fixed this for some time, after completing the load the debugger is configured to issue 'monitor system_reset', and this fetches again msp & pc from the freshly loaded image: 242,833 &"load \"/Users/ilg/My Files/MacBookPro Projects/GNU ARM Eclipse/Eclipse Workspaces/qemu-ima\ ges-44-osx/f1-h103-blink-sh-shd/Debug/f1-h103-blink-sh-shd.elf\"\n" 242,833 ~"Loading section .isr_vector, size 0x354 lma 0x8000000\n" 242,833 21+download,{section=".isr_vector",section-size="852",total-size="457307"} 242,833 21+download,{section=".isr_vector",section-sent="852",section-size="852",total-sent="852",to\ tal-size="457307"} 242,833 ~"Loading section .inits, size 0x28 lma 0x8000354\n" 242,833 21+download,{section=".inits",section-size="40",total-size="457307"} 242,833 ~"Loading section .text, size 0x23a0 lma 0x800037c\n" 242,834 21+download,{section=".text",section-size="9120",total-size="457307"} 242,834 ~"Loading section .data, size 0x84 lma 0x800271c\n" 242,835 21+download,{section=".data",section-size="132",total-size="457307"} 242,835 ~"Start address 0x800010c, load size 10144\n" 242,835 ~"Transfer rate: 4953 KB/sec, 1268 bytes/write.\n" 242,838 21^done 242,838 (gdb) 242,839 22-gdb-show --thread-group i1 language 242,839 22^done,value="auto" 242,839 (gdb) 242,840 23-gdb-set --thread-group i1 language c 242,840 23^done 242,840 (gdb) 242,841 24-interpreter-exec --thread-group i1 console "p/x (char)-1" 242,841 ~"$1 = 0xff\n" 242,842 24^done 242,842 (gdb) 242,843 25-data-evaluate-expression --thread-group i1 "sizeof (void*)" 242,844 25^done,value="4" 242,844 (gdb) 242,845 26-gdb-set --thread-group i1 language auto 242,845 26^done 242,845 (gdb) 242,846 27-interpreter-exec --thread-group i1 console "show endian" 242,847 ~"The target endianness is set automatically (currently little endian)\n" 242,847 27^done 242,847 (gdb) 242,858 28-break-insert --thread-group i1 -t -f "\"/Users/ilg/My Files/MacBookPro Projects/GNU ARM E\ clipse/Eclipse Workspaces/qemu-images-44-osx/f1-h103-blink-sh-shd/system/src/newlib/_startup.c\":_st\ art" 242,858 29-break-insert --thread-group i1 -t -d -f "\"/Users/ilg/My Files/MacBookPro Projects/GNU AR\ M Eclipse/Eclipse Workspaces/qemu-images-44-osx/f1-h103-blink-sh-shd/src/main.cpp\":main" 242,860 28^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x0800010c",func="_s\ tart",file="../system/src/newlib/_startup.c",fullname="/Users/ilg/My Files/MacBookPro Projects/GNU A\ RM Eclipse/Eclipse Workspaces/qemu-images-44-osx/f1-h103-blink-sh-shd/system/src/newlib/_startup.c",\ line="224",thread-groups=["i1"],times="0",original-location="/Users/ilg/My Files/MacBookPro Projects\ /GNU ARM Eclipse/Eclipse Workspaces/qemu-images-44-osx/f1-h103-blink-sh-shd/system/src/newlib/_start\ up.c:_start"} 242,860 (gdb) 242,861 29^done,bkpt={number="2",type="breakpoint",disp="del",enabled="n",addr="0x08000fe8",func="ma\ in(int, char**)",file="../src/main.cpp",fullname="/Users/ilg/My Files/MacBookPro Projects/GNU ARM Ec\ lipse/Eclipse Workspaces/qemu-images-44-osx/f1-h103-blink-sh-shd/src/main.cpp",line="70",thread-grou\ ps=["i1"],times="0",original-location="/Users/ilg/My Files/MacBookPro Projects/GNU ARM Eclipse/Eclip\ se Workspaces/qemu-images-44-osx/f1-h103-blink-sh-shd/src/main.cpp:main"} 242,861 (gdb) 242,867 30monitor system_reset 242,867 31tbreak _start 242,867 32continue 242,869 &"monitor system_reset\n" 242,871 30^done 242,871 (gdb) regards, Liviu p.s. please note that the gdb elf loader processes the correct sections, not the segments.