Dear OpenOCD developers, 

To flash microcontrollers, I usually launch GDB and make it 
connect to OpenOCD. Then I issue these commands: 

file my_application.elf 
load 

When GDB starts, it always complains there is no file assigned for 
debugging. Obviously, that's because I assign the file after GDB 
started (with the file command). 

Alternatively, one can pass the .elf immediately to GDB when 
launching the tool (as a commandline argument). GDB no longer 
complains at startup. 

Is there any difference between these two approaches? I always thought 
it doesn't matter, but the following discussion raises suspicion that there 
is a difference (see [ https://github.com/sifive/freedom-tools/issues/22 | 
https://github.com/sifive/freedom-tools/issues/22 ] ): 




> You can get gdb into 32-bit mode by using "set arch riscv:rv32". 

> However, you can still run into problems if gdb and the target 

> disagree on the size and/or number of FP registers. Generally, 

> the best way to start gdb is to give it a binary compiled for the 

> target, and let gdb grab arch info from the binary instead of 

> using defaults. 

> However, I would expect that when gdb connects to openocd, 

> that openocd then supplies gdb with target architecture info, 

> so this should work automatically, even if no binary is supplied 

> to gdb. 



So, does it actually matter when you pass the .elf file to GDB? Should 


one always do it at GDB startup (on the commandline)? 





Thanks for your help ^_^ 





Kind regards, 


Kristof Mulier 






_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to