Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Problem specifying path to Debugger script in Debug Configuration

Well, that doesn't work for me either. I've got /home/tblack in my PATH and I put my script there:

#! /bin/bash
sudo gdb $*

I verifed that I can run my script from the command line and that it indeed executes the app-under-debug as root. I can run this script from any cwd bc it is in my PATH. However, in Eclipse when I specify "" as the Debugger command in a Debug Configuration and debug, I get:

Exception occurred during launch

Error while launching command: --version

Why is --version appended to my command? When I execute " --version" from command line I get the expected gdb version info. Is this "--version" suffix the reason for my Eclipse Debug error? Why is it there?

On Thu, Apr 1, 2010 at 1:27 PM, Marc Khouzam <marc.khouzam@xxxxxxxxxxxx> wrote:
You are right, I couldnt' get a relative path to work.
However, what you can do (which I use all the time) is use a simple command name like "" and simply make sure that file is in your PATH

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Tim Black
Sent: Wednesday, March 31, 2010 9:51 PM
To: CDT General developers list.
Subject: [cdt-dev] Problem specifying path to Debugger script in Debug Configuration

I am debugging a C/C++ application that I am setuid'ing to run as root. This app runs fine from the command line. When I ran it in eclipse, the apparent user was still me instead of root, so it looks like the effective uid didn't get boosted. So for a test, I changed the Debugger invokation in the Debugger tab of Debug Configuration from "gdb" to a bash script that does "sudo gdb $*". Since I am a sudoer, this allows eclipse to run gdb as root, and my application runs as expected. All the above may be a misunderstanding on my part of  how gdb works. The problem I wanted to convey to you is that this only works if I browse and set an absolute path to the script (in the Debugger tab of Debug Configuration). Just "" or "./" don't work. I don't like this because I think this inserts an absolute path in my .launch file, which I want to share with others. This behavior occurs with Eclipse 3.5.2/CDT6.0 and Eclipse 3.6M6/CDT7.0.

cdt-dev mailing list

Back to the top