LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-07-2019, 01:21 PM   #1
jguo5258
LQ Newbie
 
Registered: Oct 2019
Posts: 3

Rep: Reputation: Disabled
GDB remote debug "permission denied" when trying to remotely debug program


I am trying to remotely run and debug a very simple test program using gdbserver and gdb-multiarch. On the Raspberry Pi, I start gdbserver with

Code:
sudo gdbserver --multi
I then start sudo gdb-multiarch and extend the target to the raspberry pi. When I try to run the program remotely, I get the error "permission denied" on the raspberry pi. The program exits with error code 127. Why is the permission denied, even when I start gdbserver and remote gdb with root? How do I fix this?
 
Old 12-08-2019, 05:59 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
gdbserver does not have a --multi option.

Where are you getting information which advises you to do this?
 
Old 12-08-2019, 07:11 AM   #3
jguo5258
LQ Newbie
 
Registered: Oct 2019
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rtmistler View Post
gdbserver does not have a --multi option.

Where are you getting information which advises you to do this?

Exploring raspberry pi
by Derek Molloy
 
Old 12-08-2019, 08:48 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
OK, well I'm not familiar with that particular blog or posting, but reiterate that the --multi option is not standard for gdbserver.

The way I test and get gdbserver running, because I do it only every few years and have to re-learn what works and what doesn't, is that I run it locally. You can run it not across a network, just using local ports. That helps me to the connection part working and then I translate that to multiple systems.

Typically gdbserver is run advertising a certain port number and using the compile application which you are compiling, like:
Code:
$ gdbserver <name> --attach <pid>
If memory serves, this gives you a port number to attach to. And then when you run gdb on the host side you use the IP address, the port, and the application name to attach to. Then it's normal gdb commands after that.

But since you're following a guide written in a specific way, I'd re-trace their flow steps and see if you've missed something, or review what they're saying in the details.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DEBUG WITH GDB ERROR ! - spike: unrecognized option --gdb-port riscv Linux - Newbie 3 03-29-2017 02:59 PM
gdb, debug with separate debug file and different source dir problem a4z Programming 5 10-17-2014 01:55 AM
Can I remotely login to remotely display data (remote X-window issue)? polishweasel Linux - Networking 2 06-29-2011 03:21 PM
receiving SIGTRAP from /lib/ld-linux.so.2 when using GDB in remotely debug Amir Hallajpour Linux - Newbie 1 02-02-2009 07:08 PM
how can I debug the interactinve program with GDB bigapple Programming 1 08-03-2005 09:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration