Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specifying an architecture in gdb-multiarch

Tags:

c

gdb

If I compile a C program with any arm compiler (e.g. arm-none-eabi-gcc) and afterwards call gdb-multiarch with the binary as second paramter, it will correctly determine the machine type and I can debug my remote application.

If however I call gdb-multiarch on its own, it will assume my machine type (x86_64) and tries to debug the remote target with the wrong architecture..

How do I specify the machine type/architecture (e.g. armv5te) in gdb-multiarch?

like image 984
hellow Avatar asked Apr 15 '19 07:04

hellow


People also ask

How do I change GDB configuration?

The simplest way to configure and build GDB is to run configure from the `gdb- version-number ' source directory, which in this example is the `gdb-5.1. 1' directory. First switch to the `gdb- version-number ' source directory if you are not already in it; then run configure .

What is GDB Multiarch?

gdb-multiarch. GDB is a source-level debugger, capable of breaking programs at any specific line, displaying variable values, and determining where errors occurred. Currently, gdb supports C, C++, D, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, Go, and Ada. A must-have for any serious programmer.

What is GDB target?

A target is the execution environment occupied by your program. Often, GDB runs in the same host environment as your program; in that case, the debugging target is specified as a side effect when you use the file or core commands.


1 Answers

The fine manual says:

set architecture arch

This command sets the current target architecture to arch. The value of arch can be "auto", in addition to one of the supported architectures.

This sure sounds like what you're after, to me.

like image 166
unwind Avatar answered Nov 09 '22 09:11

unwind