Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Debug source lookup question

Yes, if the full path issue is solved there is no need to read sources
from GDB. 

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Vladimir Prus
Sent: Sunday, November 23, 2008 7:56 AM
To: CDT General developers list.
Subject: Re: [cdt-dev] Debug source lookup question

On Thursday 20 November 2008 17:07:10 Mikhail Khodjaiants wrote:
> Sorry James, my example is not correct. The correct paths are 
> "/project/foo/../main.c" and "/project/main.c". The point is that both

> represent the same file, but from the GDB's point of view there are 
> different.

Not necessary. On Linux, GDB uses realpath, so it does not care much how
you specify the file. On Windows, this is not the case now -- I've
posted a patch to fix it, but it's not in GDB CVS. 

>
> > A better solution might be to look in the binary and check whether
>
> there are any source file collisions before attempting to set 
> breakpoints.
>
> That's what I am proposing, but instead of parsing the binary, we let 
> GDB to do the work and retrieve the list of source files and their 
> paths from GDB. In this case we can use absolute paths to set 
> breakpoints. If we need to set a breakpoint at "/project/main.c" the 
> source lookup will translate the path to "/project/foo/../main.c" and 
> GDB will understand it.

I'm getting confused. What problem is solved by getting the list of
source files from GDB? Assuming the GDB issue with full paths on Windows
is fixed, you can just *always* send full path when setting a
breakpoint.

Using the list of source paths from GDB to filter breakpoints does not
seem necessary, either -- if GDB does not know about a source file, it
won't set a breakpoint -- there's no need to do such filtering on CDT
side. Note also that in presense of shared libraries, including
on-demand loaded ones, the list of source paths becomes undefined
notion.

- Volodya

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

-- 
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.




Back to the top