[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gdb
Subject:    How important is the 'dir' command for a frontend?
From:       "Marc Khouzam" <marc.khouzam () ericsson ! com>
Date:       2009-06-26 19:54:16
Message-ID: 6D19CA8D71C89C43A057926FE0D4ADAA07A77A58 () ecamlmw720 ! eamcs ! ericsson ! se
[Download RAW message or body]

Hi,

I've resurrected an old Eclipse issue with GDB about 
source and breakpoint mapping.
We are discussing things in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=225805
and have come to the point of not understanding GDB's behaviour.
So, here I am :-)

In Eclipse, we don't need to use GDB to list source code (with
the 'list' command).  So we are wondering if we must use
the 'dir' command (-environement-directory) at all. (Using
'dir' can cause a lot of performance problems for very large
projects.)

It seemed ok until we found that when source code has been 
moved, 'dir' is necessary to allow GDB to properly set breakpoints.
For example:

> 12-break-insert /home/marc/b.cc:11
> &"No source file named /home/marc/b.cc.\n"
> 12^error,msg="No source file named /home/marc/b.cc."
> 13-environment-directory /home/marc
> 13^done,source-path="/home/marc:$cdir:$cwd"
> 14-break-insert /home/marc/b.cc:11
>
14^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr=
"0x080484c8",func="m\
> ain",file="b.cc",fullname="/home/marc/b.cc",line="11",times="0"}

One suggestion was that Eclipse could always send the -env-dir
command before each -break-insert.  Not very nice for the frontend,
but it made me wonder why GDB couldn't do it itself?
If a bp is requested on /home/marc/b.cc, why couldn't GDB
automatically use /home/marc as a source dir if it can't find
the absolute path in the binary?

I'm sure the issue is more complex that I think, but I thought
I would benefit greatly from a little guidance.

Thanks in advance

marc

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic