Problems running/debugging applications

Matthew Woehlke mw_triad at users.sourceforge.net
Thu Dec 7 21:29:50 UTC 2006


Matthew Woehlke wrote:
> Andras Mantia wrote:
>> On Thursday 07 December 2006 21:59, Matthew Woehlke wrote:
>>> The second part is harder. First, it would be helpful if, instead of
>>> just running the app with 'var=val var=val app args', it was possible
>>> to source a user-specified shell script first. That is, the command
>>> line would need to look like 'var=val; var=val; export var var; .
>>> script; app args'. Secondly, /none/ of this is used by gdb, meaning
>>> that while I can do some ugly var setting (PATH='bin/`uname`_`uname
>>> -m`:$PATH', for example) and get the app to run, I am unable to debug
>>> it because gdb doesn't inherit these settings. Why not?
>> Create a script that you run instead of your application. The script's 
>> last line will run the application. ;-)
> 
> That won't work, because gdb will try to run it. :-)
> 
>> This is for running. For debugging, there is something like "debugging 
>> shell". Can't you use that one?

Although I could still as *why* the debugger doesn't inherit the 'run' 
options, or at least have an option to do so. Also, I really want to run 
my app as 'bin/`<command>`/myapp', which is fine for 'run', not for 'debug'.

> I tried, but I can't get it to work... Oh, i see why, because I am used 
> to gdb output and program output in the same place. My, that's confusing.

No, no, that isn't it. If the process fails to start (in this case, it 
can't load libraries, because the environment is not being initialized 
correctly), and if I then try to do some stuff in gdb like 'shell pwd', 
I get no output, anywhere. Nor am I getting any output from the script I 
wrote to try to fix up the environment, so I can't debug what is going 
wrong. I tried the same script as both a 'debugging shell' and (with 
'gdb "$@"' at the end) as the 'debugger executable'. As a 'shell', I 
don't even get the output (still hiding in the 'application' pane) that 
a library couldn't be loaded; it just fails instantly.

-- 
Matthew
"unsubscribe me plz!!" -- Newbies





More information about the KDevelop-devel mailing list