Re: [OpenOCD-devel] Does it matter when you pass the elf file to GDB?

2020-10-27 Thread Liviu Ionescu



> On 27 Oct 2020, at 09:16, kristof.mul...@telenet.be wrote:
> 
> Hi Liviu,
> Thank you for your reply. So your Eclipse plug-in
> also starts GDB without executable and then passes
> the executable with the 'file' command?

That's correct.

This is not my invention, it is the Eclipse GDB Hardware debug plug-in 
behaviour; my plug-ins only provide an easy way to configure everything and 
start the GDB server (J-Link, OpenOCD, QEMU, etc) before before the GDB client.

Regards,

Liviu



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


Re: [OpenOCD-devel] Does it matter when you pass the elf file to GDB?

2020-10-27 Thread kristof . mulier
Hi Liviu,
Thank you for your reply. So your Eclipse plug-in
also starts GDB without executable and then passes
the executable with the 'file' command?

Kind regards,
Kristof Mulier


- Oorspronkelijk bericht -
Van: "Liviu Ionescu" 
Aan: "kristof mulier" 
Cc: "openocd-devel" 
Verzonden: Maandag 26 oktober 2020 18:48:18
Onderwerp: Re: [OpenOCD-devel] Does it matter when you pass the elf file to GDB?

> On 26 Oct 2020, at 17:33, kristof.mul...@telenet.be wrote:
> 
> ... Should one always do it at GDB startup (on the commandline)?

The Eclipse OpenOCD debug plug-in never passes the executable via the command 
line.


Regards,

Liviu


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


Re: [OpenOCD-devel] Does it matter when you pass the elf file to GDB?

2020-10-26 Thread Liviu Ionescu



> On 26 Oct 2020, at 17:33, kristof.mul...@telenet.be wrote:
> 
> ... Should one always do it at GDB startup (on the commandline)?

The Eclipse OpenOCD debug plug-in never passes the executable via the command 
line.


Regards,

Liviu



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


[OpenOCD-devel] Does it matter when you pass the elf file to GDB?

2020-10-26 Thread kristof . mulier
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