Why is gdbserver not found when using the Linaro external toolchain in Buildroot?












1















I am using Buildroot 2018.02 for an IMX6 board and the Linaro external toochain 2017.11 based on GCC 2017.11 (GCC 7.2.1)



Now i am adding some debug tools such as gdbserver on the target.



Everything is OK if i use the option "Build cross gdb for the host" and selecting the gdb debugger version 7.11.x for the host along with the gdbserver (BR2_PACKAGE_GDB_SERVER) in the "Target Packages > Debugging,.." menu. There are also other version of gdb available in Buildroot such as 7.12.x and 8.0.x.



However, for an external toolchain the recommended way is :
https://github.com/mbats/eclipse-buildroot-bundle/wiki/Tutorial-:-How-to-debug-a-remote-application-%3F which means to activate only the "Copy gdb server to the Target" option in Buildroot (although the post is a bit old)



I have noticed that the BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM description says that Linaro gdb is based on gdb 8.0 so a newer version that the one i am using (7.11.x).



But when i do that, i have the following message on the target board :



# gdbserver
-sh: gdbserver: not found


despite the following :



# which gdbserver
/usr/bin/gdbserver


gdbserver binary is on the target.



How to fix this in Buildroot ?



Moreover i have two additional questions :




  1. Does it really matter to have the Linaro toolchain gdb instead of
    the gdb 7.11.x that works "out of the box" in my case ?

  2. If i don't use the Linaro gdb then should i use the gdb version
    8.0.x ( because the Linaro version is based on the 8.0 of GDB ) ?


Thank you for your help.










share|improve this question

























  • It could be a broken symlink, or gdbserver is a shellscript with an invalid shebang line. ls- l /usr/bin/gdbserver or file /usr/bin/gdbserver will probably help to debug this. Apart from that, does your external toolchain contain a gdbserver binary?

    – arved
    Jan 2 at 12:16











  • ls -l output is -rwxr-xr-x 1 root root 822000 Dec 31 2018 /usr/bin/gdbserver . This is not a shell script or broken link. The package used by Buildroot is gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz and can be found here releases.linaro.org/components/toolchain/binaries/7.2-2017.11/… . It contains a gdbserver binary and a cross-gdb.

    – Scab
    Jan 2 at 13:43













  • Does typing /usr/bin/gdbserver result in an error message?

    – Mark Plotnick
    Jan 2 at 15:46











  • Yes it's the same error message

    – Scab
    Jan 2 at 15:47






  • 1





    Try file /usr/bin/gdbserver or try ldd on it or work out the options for readelf - that error message can confusingly be triggered by finding a file that is ruled unexectuable, for example it is in the wrong format, claims to be for the wrong ABI or relies on a different dynamic linker.

    – Chris Stratton
    Jan 2 at 21:13


















1















I am using Buildroot 2018.02 for an IMX6 board and the Linaro external toochain 2017.11 based on GCC 2017.11 (GCC 7.2.1)



Now i am adding some debug tools such as gdbserver on the target.



Everything is OK if i use the option "Build cross gdb for the host" and selecting the gdb debugger version 7.11.x for the host along with the gdbserver (BR2_PACKAGE_GDB_SERVER) in the "Target Packages > Debugging,.." menu. There are also other version of gdb available in Buildroot such as 7.12.x and 8.0.x.



However, for an external toolchain the recommended way is :
https://github.com/mbats/eclipse-buildroot-bundle/wiki/Tutorial-:-How-to-debug-a-remote-application-%3F which means to activate only the "Copy gdb server to the Target" option in Buildroot (although the post is a bit old)



I have noticed that the BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM description says that Linaro gdb is based on gdb 8.0 so a newer version that the one i am using (7.11.x).



But when i do that, i have the following message on the target board :



# gdbserver
-sh: gdbserver: not found


despite the following :



# which gdbserver
/usr/bin/gdbserver


gdbserver binary is on the target.



How to fix this in Buildroot ?



Moreover i have two additional questions :




  1. Does it really matter to have the Linaro toolchain gdb instead of
    the gdb 7.11.x that works "out of the box" in my case ?

  2. If i don't use the Linaro gdb then should i use the gdb version
    8.0.x ( because the Linaro version is based on the 8.0 of GDB ) ?


Thank you for your help.










share|improve this question

























  • It could be a broken symlink, or gdbserver is a shellscript with an invalid shebang line. ls- l /usr/bin/gdbserver or file /usr/bin/gdbserver will probably help to debug this. Apart from that, does your external toolchain contain a gdbserver binary?

    – arved
    Jan 2 at 12:16











  • ls -l output is -rwxr-xr-x 1 root root 822000 Dec 31 2018 /usr/bin/gdbserver . This is not a shell script or broken link. The package used by Buildroot is gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz and can be found here releases.linaro.org/components/toolchain/binaries/7.2-2017.11/… . It contains a gdbserver binary and a cross-gdb.

    – Scab
    Jan 2 at 13:43













  • Does typing /usr/bin/gdbserver result in an error message?

    – Mark Plotnick
    Jan 2 at 15:46











  • Yes it's the same error message

    – Scab
    Jan 2 at 15:47






  • 1





    Try file /usr/bin/gdbserver or try ldd on it or work out the options for readelf - that error message can confusingly be triggered by finding a file that is ruled unexectuable, for example it is in the wrong format, claims to be for the wrong ABI or relies on a different dynamic linker.

    – Chris Stratton
    Jan 2 at 21:13
















1












1








1


1






I am using Buildroot 2018.02 for an IMX6 board and the Linaro external toochain 2017.11 based on GCC 2017.11 (GCC 7.2.1)



Now i am adding some debug tools such as gdbserver on the target.



Everything is OK if i use the option "Build cross gdb for the host" and selecting the gdb debugger version 7.11.x for the host along with the gdbserver (BR2_PACKAGE_GDB_SERVER) in the "Target Packages > Debugging,.." menu. There are also other version of gdb available in Buildroot such as 7.12.x and 8.0.x.



However, for an external toolchain the recommended way is :
https://github.com/mbats/eclipse-buildroot-bundle/wiki/Tutorial-:-How-to-debug-a-remote-application-%3F which means to activate only the "Copy gdb server to the Target" option in Buildroot (although the post is a bit old)



I have noticed that the BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM description says that Linaro gdb is based on gdb 8.0 so a newer version that the one i am using (7.11.x).



But when i do that, i have the following message on the target board :



# gdbserver
-sh: gdbserver: not found


despite the following :



# which gdbserver
/usr/bin/gdbserver


gdbserver binary is on the target.



How to fix this in Buildroot ?



Moreover i have two additional questions :




  1. Does it really matter to have the Linaro toolchain gdb instead of
    the gdb 7.11.x that works "out of the box" in my case ?

  2. If i don't use the Linaro gdb then should i use the gdb version
    8.0.x ( because the Linaro version is based on the 8.0 of GDB ) ?


Thank you for your help.










share|improve this question
















I am using Buildroot 2018.02 for an IMX6 board and the Linaro external toochain 2017.11 based on GCC 2017.11 (GCC 7.2.1)



Now i am adding some debug tools such as gdbserver on the target.



Everything is OK if i use the option "Build cross gdb for the host" and selecting the gdb debugger version 7.11.x for the host along with the gdbserver (BR2_PACKAGE_GDB_SERVER) in the "Target Packages > Debugging,.." menu. There are also other version of gdb available in Buildroot such as 7.12.x and 8.0.x.



However, for an external toolchain the recommended way is :
https://github.com/mbats/eclipse-buildroot-bundle/wiki/Tutorial-:-How-to-debug-a-remote-application-%3F which means to activate only the "Copy gdb server to the Target" option in Buildroot (although the post is a bit old)



I have noticed that the BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM description says that Linaro gdb is based on gdb 8.0 so a newer version that the one i am using (7.11.x).



But when i do that, i have the following message on the target board :



# gdbserver
-sh: gdbserver: not found


despite the following :



# which gdbserver
/usr/bin/gdbserver


gdbserver binary is on the target.



How to fix this in Buildroot ?



Moreover i have two additional questions :




  1. Does it really matter to have the Linaro toolchain gdb instead of
    the gdb 7.11.x that works "out of the box" in my case ?

  2. If i don't use the Linaro gdb then should i use the gdb version
    8.0.x ( because the Linaro version is based on the 8.0 of GDB ) ?


Thank you for your help.







debugging gdb embedded-linux buildroot gdbserver






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 3 at 8:17







Scab

















asked Jan 2 at 10:19









ScabScab

706820




706820













  • It could be a broken symlink, or gdbserver is a shellscript with an invalid shebang line. ls- l /usr/bin/gdbserver or file /usr/bin/gdbserver will probably help to debug this. Apart from that, does your external toolchain contain a gdbserver binary?

    – arved
    Jan 2 at 12:16











  • ls -l output is -rwxr-xr-x 1 root root 822000 Dec 31 2018 /usr/bin/gdbserver . This is not a shell script or broken link. The package used by Buildroot is gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz and can be found here releases.linaro.org/components/toolchain/binaries/7.2-2017.11/… . It contains a gdbserver binary and a cross-gdb.

    – Scab
    Jan 2 at 13:43













  • Does typing /usr/bin/gdbserver result in an error message?

    – Mark Plotnick
    Jan 2 at 15:46











  • Yes it's the same error message

    – Scab
    Jan 2 at 15:47






  • 1





    Try file /usr/bin/gdbserver or try ldd on it or work out the options for readelf - that error message can confusingly be triggered by finding a file that is ruled unexectuable, for example it is in the wrong format, claims to be for the wrong ABI or relies on a different dynamic linker.

    – Chris Stratton
    Jan 2 at 21:13





















  • It could be a broken symlink, or gdbserver is a shellscript with an invalid shebang line. ls- l /usr/bin/gdbserver or file /usr/bin/gdbserver will probably help to debug this. Apart from that, does your external toolchain contain a gdbserver binary?

    – arved
    Jan 2 at 12:16











  • ls -l output is -rwxr-xr-x 1 root root 822000 Dec 31 2018 /usr/bin/gdbserver . This is not a shell script or broken link. The package used by Buildroot is gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz and can be found here releases.linaro.org/components/toolchain/binaries/7.2-2017.11/… . It contains a gdbserver binary and a cross-gdb.

    – Scab
    Jan 2 at 13:43













  • Does typing /usr/bin/gdbserver result in an error message?

    – Mark Plotnick
    Jan 2 at 15:46











  • Yes it's the same error message

    – Scab
    Jan 2 at 15:47






  • 1





    Try file /usr/bin/gdbserver or try ldd on it or work out the options for readelf - that error message can confusingly be triggered by finding a file that is ruled unexectuable, for example it is in the wrong format, claims to be for the wrong ABI or relies on a different dynamic linker.

    – Chris Stratton
    Jan 2 at 21:13



















It could be a broken symlink, or gdbserver is a shellscript with an invalid shebang line. ls- l /usr/bin/gdbserver or file /usr/bin/gdbserver will probably help to debug this. Apart from that, does your external toolchain contain a gdbserver binary?

– arved
Jan 2 at 12:16





It could be a broken symlink, or gdbserver is a shellscript with an invalid shebang line. ls- l /usr/bin/gdbserver or file /usr/bin/gdbserver will probably help to debug this. Apart from that, does your external toolchain contain a gdbserver binary?

– arved
Jan 2 at 12:16













ls -l output is -rwxr-xr-x 1 root root 822000 Dec 31 2018 /usr/bin/gdbserver . This is not a shell script or broken link. The package used by Buildroot is gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz and can be found here releases.linaro.org/components/toolchain/binaries/7.2-2017.11/… . It contains a gdbserver binary and a cross-gdb.

– Scab
Jan 2 at 13:43







ls -l output is -rwxr-xr-x 1 root root 822000 Dec 31 2018 /usr/bin/gdbserver . This is not a shell script or broken link. The package used by Buildroot is gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz and can be found here releases.linaro.org/components/toolchain/binaries/7.2-2017.11/… . It contains a gdbserver binary and a cross-gdb.

– Scab
Jan 2 at 13:43















Does typing /usr/bin/gdbserver result in an error message?

– Mark Plotnick
Jan 2 at 15:46





Does typing /usr/bin/gdbserver result in an error message?

– Mark Plotnick
Jan 2 at 15:46













Yes it's the same error message

– Scab
Jan 2 at 15:47





Yes it's the same error message

– Scab
Jan 2 at 15:47




1




1





Try file /usr/bin/gdbserver or try ldd on it or work out the options for readelf - that error message can confusingly be triggered by finding a file that is ruled unexectuable, for example it is in the wrong format, claims to be for the wrong ABI or relies on a different dynamic linker.

– Chris Stratton
Jan 2 at 21:13







Try file /usr/bin/gdbserver or try ldd on it or work out the options for readelf - that error message can confusingly be triggered by finding a file that is ruled unexectuable, for example it is in the wrong format, claims to be for the wrong ABI or relies on a different dynamic linker.

– Chris Stratton
Jan 2 at 21:13














2 Answers
2






active

oldest

votes


















3














The gdbserver binary in the Linaro 2017.11 toolchain is broken: it requests /usr/lib/ld.so.1 as the program interpreter (see below), but that program interpreter doesn't exist.



You can try to create a symlink /usr/lib/ld.so.1 -> /lib/ld-linux-armhf.so.3 (add that to your filesystem overlay if it works). Alternatively, you can specify the program interpreter explicitly by putting it before the executable, i.e. /lib/ld-linux-armhf.so.3 /usr/bin/gdbserver.



The "program interpreter" is a parameter of an ELF file that points to a program that is used to load the ELF file into memory and to start executing it. The main responsibility of the program interpreter is to find and load the dynamic libraries that the program needs. Thus, it is usually called the "dynamic library loader", or ld.so. It is built and installed together with the toolchain - specifically, the standard C library (glibc). When a program is linked, the linker will also set the program interpreter (it is copied from libc.so). Apparently Linaro did something really peculiar to end up with a wrong program interpreter in the gdbserver executable.






share|improve this answer
























  • /usr/lib/ld.so.1 -> /lib/ld-linux-armhf.so.3 or /lib/ld-linux-armhf.so.3 /usr/bin/gdbserver ends up in a segfault but i guess you are right : the Linaro gdbserver is broken so i am afraid there is nothing i can do to fix this in Buildroot. But does it really matter if i use gdb 7.11 or 8.0 instead - and not the Linaro one ?

    – Scab
    Jan 3 at 14:00













  • The statement "prefer to use the gdb/gdbserver that comes with the toolchain" is a kind of ancient lore. I don't know what was the reasoning behind that statement and if it is still valid. The gdb/gdbserver 7.11 or 8.0 built by Buildroot should work fine.

    – Arnout
    Jan 4 at 10:08











  • "When a program is linked, the linker will also set the program interpreter (it is copied from libc.so). " -- the parenthesized part is incorrect. Your answer would be better without it.

    – Employed Russian
    Jan 4 at 16:13



















2















# gdbserver
-sh: gdbserver: not found



depsite the following :



# which gdbserver
/usr/bin/gdbserver




Most likely:




  1. The gdbserver is a dynamically linked binary, and

  2. The ELF interpreter that this binary is linked to use is not present on the target system.


Use readelf -l /usr/bin/gdbserver | grep -i interpreter to find out what runtime loader this gdbserver requires. Verify that that file is not present on the target. Copy it to the target and enjoy.






share|improve this answer
























  • Thanks for pointing that out. Indeed the file was not present.

    – Scab
    Jan 4 at 11:23













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54004557%2fwhy-is-gdbserver-not-found-when-using-the-linaro-external-toolchain-in-buildroot%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














The gdbserver binary in the Linaro 2017.11 toolchain is broken: it requests /usr/lib/ld.so.1 as the program interpreter (see below), but that program interpreter doesn't exist.



You can try to create a symlink /usr/lib/ld.so.1 -> /lib/ld-linux-armhf.so.3 (add that to your filesystem overlay if it works). Alternatively, you can specify the program interpreter explicitly by putting it before the executable, i.e. /lib/ld-linux-armhf.so.3 /usr/bin/gdbserver.



The "program interpreter" is a parameter of an ELF file that points to a program that is used to load the ELF file into memory and to start executing it. The main responsibility of the program interpreter is to find and load the dynamic libraries that the program needs. Thus, it is usually called the "dynamic library loader", or ld.so. It is built and installed together with the toolchain - specifically, the standard C library (glibc). When a program is linked, the linker will also set the program interpreter (it is copied from libc.so). Apparently Linaro did something really peculiar to end up with a wrong program interpreter in the gdbserver executable.






share|improve this answer
























  • /usr/lib/ld.so.1 -> /lib/ld-linux-armhf.so.3 or /lib/ld-linux-armhf.so.3 /usr/bin/gdbserver ends up in a segfault but i guess you are right : the Linaro gdbserver is broken so i am afraid there is nothing i can do to fix this in Buildroot. But does it really matter if i use gdb 7.11 or 8.0 instead - and not the Linaro one ?

    – Scab
    Jan 3 at 14:00













  • The statement "prefer to use the gdb/gdbserver that comes with the toolchain" is a kind of ancient lore. I don't know what was the reasoning behind that statement and if it is still valid. The gdb/gdbserver 7.11 or 8.0 built by Buildroot should work fine.

    – Arnout
    Jan 4 at 10:08











  • "When a program is linked, the linker will also set the program interpreter (it is copied from libc.so). " -- the parenthesized part is incorrect. Your answer would be better without it.

    – Employed Russian
    Jan 4 at 16:13
















3














The gdbserver binary in the Linaro 2017.11 toolchain is broken: it requests /usr/lib/ld.so.1 as the program interpreter (see below), but that program interpreter doesn't exist.



You can try to create a symlink /usr/lib/ld.so.1 -> /lib/ld-linux-armhf.so.3 (add that to your filesystem overlay if it works). Alternatively, you can specify the program interpreter explicitly by putting it before the executable, i.e. /lib/ld-linux-armhf.so.3 /usr/bin/gdbserver.



The "program interpreter" is a parameter of an ELF file that points to a program that is used to load the ELF file into memory and to start executing it. The main responsibility of the program interpreter is to find and load the dynamic libraries that the program needs. Thus, it is usually called the "dynamic library loader", or ld.so. It is built and installed together with the toolchain - specifically, the standard C library (glibc). When a program is linked, the linker will also set the program interpreter (it is copied from libc.so). Apparently Linaro did something really peculiar to end up with a wrong program interpreter in the gdbserver executable.






share|improve this answer
























  • /usr/lib/ld.so.1 -> /lib/ld-linux-armhf.so.3 or /lib/ld-linux-armhf.so.3 /usr/bin/gdbserver ends up in a segfault but i guess you are right : the Linaro gdbserver is broken so i am afraid there is nothing i can do to fix this in Buildroot. But does it really matter if i use gdb 7.11 or 8.0 instead - and not the Linaro one ?

    – Scab
    Jan 3 at 14:00













  • The statement "prefer to use the gdb/gdbserver that comes with the toolchain" is a kind of ancient lore. I don't know what was the reasoning behind that statement and if it is still valid. The gdb/gdbserver 7.11 or 8.0 built by Buildroot should work fine.

    – Arnout
    Jan 4 at 10:08











  • "When a program is linked, the linker will also set the program interpreter (it is copied from libc.so). " -- the parenthesized part is incorrect. Your answer would be better without it.

    – Employed Russian
    Jan 4 at 16:13














3












3








3







The gdbserver binary in the Linaro 2017.11 toolchain is broken: it requests /usr/lib/ld.so.1 as the program interpreter (see below), but that program interpreter doesn't exist.



You can try to create a symlink /usr/lib/ld.so.1 -> /lib/ld-linux-armhf.so.3 (add that to your filesystem overlay if it works). Alternatively, you can specify the program interpreter explicitly by putting it before the executable, i.e. /lib/ld-linux-armhf.so.3 /usr/bin/gdbserver.



The "program interpreter" is a parameter of an ELF file that points to a program that is used to load the ELF file into memory and to start executing it. The main responsibility of the program interpreter is to find and load the dynamic libraries that the program needs. Thus, it is usually called the "dynamic library loader", or ld.so. It is built and installed together with the toolchain - specifically, the standard C library (glibc). When a program is linked, the linker will also set the program interpreter (it is copied from libc.so). Apparently Linaro did something really peculiar to end up with a wrong program interpreter in the gdbserver executable.






share|improve this answer













The gdbserver binary in the Linaro 2017.11 toolchain is broken: it requests /usr/lib/ld.so.1 as the program interpreter (see below), but that program interpreter doesn't exist.



You can try to create a symlink /usr/lib/ld.so.1 -> /lib/ld-linux-armhf.so.3 (add that to your filesystem overlay if it works). Alternatively, you can specify the program interpreter explicitly by putting it before the executable, i.e. /lib/ld-linux-armhf.so.3 /usr/bin/gdbserver.



The "program interpreter" is a parameter of an ELF file that points to a program that is used to load the ELF file into memory and to start executing it. The main responsibility of the program interpreter is to find and load the dynamic libraries that the program needs. Thus, it is usually called the "dynamic library loader", or ld.so. It is built and installed together with the toolchain - specifically, the standard C library (glibc). When a program is linked, the linker will also set the program interpreter (it is copied from libc.so). Apparently Linaro did something really peculiar to end up with a wrong program interpreter in the gdbserver executable.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 3 at 13:47









ArnoutArnout

1,7191118




1,7191118













  • /usr/lib/ld.so.1 -> /lib/ld-linux-armhf.so.3 or /lib/ld-linux-armhf.so.3 /usr/bin/gdbserver ends up in a segfault but i guess you are right : the Linaro gdbserver is broken so i am afraid there is nothing i can do to fix this in Buildroot. But does it really matter if i use gdb 7.11 or 8.0 instead - and not the Linaro one ?

    – Scab
    Jan 3 at 14:00













  • The statement "prefer to use the gdb/gdbserver that comes with the toolchain" is a kind of ancient lore. I don't know what was the reasoning behind that statement and if it is still valid. The gdb/gdbserver 7.11 or 8.0 built by Buildroot should work fine.

    – Arnout
    Jan 4 at 10:08











  • "When a program is linked, the linker will also set the program interpreter (it is copied from libc.so). " -- the parenthesized part is incorrect. Your answer would be better without it.

    – Employed Russian
    Jan 4 at 16:13



















  • /usr/lib/ld.so.1 -> /lib/ld-linux-armhf.so.3 or /lib/ld-linux-armhf.so.3 /usr/bin/gdbserver ends up in a segfault but i guess you are right : the Linaro gdbserver is broken so i am afraid there is nothing i can do to fix this in Buildroot. But does it really matter if i use gdb 7.11 or 8.0 instead - and not the Linaro one ?

    – Scab
    Jan 3 at 14:00













  • The statement "prefer to use the gdb/gdbserver that comes with the toolchain" is a kind of ancient lore. I don't know what was the reasoning behind that statement and if it is still valid. The gdb/gdbserver 7.11 or 8.0 built by Buildroot should work fine.

    – Arnout
    Jan 4 at 10:08











  • "When a program is linked, the linker will also set the program interpreter (it is copied from libc.so). " -- the parenthesized part is incorrect. Your answer would be better without it.

    – Employed Russian
    Jan 4 at 16:13

















/usr/lib/ld.so.1 -> /lib/ld-linux-armhf.so.3 or /lib/ld-linux-armhf.so.3 /usr/bin/gdbserver ends up in a segfault but i guess you are right : the Linaro gdbserver is broken so i am afraid there is nothing i can do to fix this in Buildroot. But does it really matter if i use gdb 7.11 or 8.0 instead - and not the Linaro one ?

– Scab
Jan 3 at 14:00







/usr/lib/ld.so.1 -> /lib/ld-linux-armhf.so.3 or /lib/ld-linux-armhf.so.3 /usr/bin/gdbserver ends up in a segfault but i guess you are right : the Linaro gdbserver is broken so i am afraid there is nothing i can do to fix this in Buildroot. But does it really matter if i use gdb 7.11 or 8.0 instead - and not the Linaro one ?

– Scab
Jan 3 at 14:00















The statement "prefer to use the gdb/gdbserver that comes with the toolchain" is a kind of ancient lore. I don't know what was the reasoning behind that statement and if it is still valid. The gdb/gdbserver 7.11 or 8.0 built by Buildroot should work fine.

– Arnout
Jan 4 at 10:08





The statement "prefer to use the gdb/gdbserver that comes with the toolchain" is a kind of ancient lore. I don't know what was the reasoning behind that statement and if it is still valid. The gdb/gdbserver 7.11 or 8.0 built by Buildroot should work fine.

– Arnout
Jan 4 at 10:08













"When a program is linked, the linker will also set the program interpreter (it is copied from libc.so). " -- the parenthesized part is incorrect. Your answer would be better without it.

– Employed Russian
Jan 4 at 16:13





"When a program is linked, the linker will also set the program interpreter (it is copied from libc.so). " -- the parenthesized part is incorrect. Your answer would be better without it.

– Employed Russian
Jan 4 at 16:13













2















# gdbserver
-sh: gdbserver: not found



depsite the following :



# which gdbserver
/usr/bin/gdbserver




Most likely:




  1. The gdbserver is a dynamically linked binary, and

  2. The ELF interpreter that this binary is linked to use is not present on the target system.


Use readelf -l /usr/bin/gdbserver | grep -i interpreter to find out what runtime loader this gdbserver requires. Verify that that file is not present on the target. Copy it to the target and enjoy.






share|improve this answer
























  • Thanks for pointing that out. Indeed the file was not present.

    – Scab
    Jan 4 at 11:23


















2















# gdbserver
-sh: gdbserver: not found



depsite the following :



# which gdbserver
/usr/bin/gdbserver




Most likely:




  1. The gdbserver is a dynamically linked binary, and

  2. The ELF interpreter that this binary is linked to use is not present on the target system.


Use readelf -l /usr/bin/gdbserver | grep -i interpreter to find out what runtime loader this gdbserver requires. Verify that that file is not present on the target. Copy it to the target and enjoy.






share|improve this answer
























  • Thanks for pointing that out. Indeed the file was not present.

    – Scab
    Jan 4 at 11:23
















2












2








2








# gdbserver
-sh: gdbserver: not found



depsite the following :



# which gdbserver
/usr/bin/gdbserver




Most likely:




  1. The gdbserver is a dynamically linked binary, and

  2. The ELF interpreter that this binary is linked to use is not present on the target system.


Use readelf -l /usr/bin/gdbserver | grep -i interpreter to find out what runtime loader this gdbserver requires. Verify that that file is not present on the target. Copy it to the target and enjoy.






share|improve this answer














# gdbserver
-sh: gdbserver: not found



depsite the following :



# which gdbserver
/usr/bin/gdbserver




Most likely:




  1. The gdbserver is a dynamically linked binary, and

  2. The ELF interpreter that this binary is linked to use is not present on the target system.


Use readelf -l /usr/bin/gdbserver | grep -i interpreter to find out what runtime loader this gdbserver requires. Verify that that file is not present on the target. Copy it to the target and enjoy.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 3 at 3:03









Employed RussianEmployed Russian

127k20173239




127k20173239













  • Thanks for pointing that out. Indeed the file was not present.

    – Scab
    Jan 4 at 11:23





















  • Thanks for pointing that out. Indeed the file was not present.

    – Scab
    Jan 4 at 11:23



















Thanks for pointing that out. Indeed the file was not present.

– Scab
Jan 4 at 11:23







Thanks for pointing that out. Indeed the file was not present.

– Scab
Jan 4 at 11:23




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54004557%2fwhy-is-gdbserver-not-found-when-using-the-linaro-external-toolchain-in-buildroot%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith