o que fazer quando depuração C ++ remota com código solicita ao gnutarget format-name

1

Estou na depuração do programa C ++ remoto em execução no raspberry pi no Ubuntu. Eu segui o link . Mas no início da depuração eu recebo

GDB failed with message: "/MyProjec/MyProgram": not in executable format: File format is ambiguous.
Matching formats: elf32-littlearm elf32-littlearm-symbian elf32-littlearm-vxworks.
Use "set gnutarget format-name" to specify the format.
​

onde definir gnutarget format-name ?

    
por neckTwi 06.07.2018 / 20:14

1 resposta

0

Onde eu faço set gnutarget format-name ?

No seu arquivo gdb.ini ou .gdbinit conforme apropriado.

The .gdbinit File

Upon startup, GDB reads and executes an initialization file named .gdbinit. It can contain any command (eg set and break), and more. For example, "set listsize" and "set prompt" can go into .gdbinit. There are two locations where GDB will look for this file (in order):

  • In your home directory
  • In the current directory

You can put commands to be executed for all your programming projects in $HOME/.gdbinit and project-specific commands in $PWD/.gdbinit.

You can comment your .gdbinit files with bash's #. And blank lines, of course, are ignored.

Tutorial do Peter em gdb: Inicialização, Listagem e Execução

Exemplo:

Um exemplo de arquivo gdb.ini

Here you have a sample gdb.ini file listing, which gives better results when using gdb. Under linux you should put this in a .gdbinit file in your home directory or the current directory.

set print demangle off  
set gnutarget auto  
set verbose on  
set complaints 1000  
dir ./rtl/dosv2  
set language c++  
set print vtbl on  
set print object on  
set print sym on  
set print pretty on  
disp /i $eip  

define pst  
set $pos=&$arg0  
set $strlen = {byte}$pos  
print {char}&$arg0.st@($strlen+1)  
end  

document pst  
  Print out a Pascal string  
end

Fonte E Um arquivo gdb.ini de amostra

    
por 06.07.2018 / 22:26