User forums > Embedded development

GDB path problem

<< < (3/3)

ollydbg:

--- Quote from: mariocup on June 19, 2009, 04:30:49 pm ---Hi,

in the executables of embedded targets debug information normally contains relative paths, but CB uses absolute pathes to set e.g. breakpoint. Under Linux this is not a problem, since no drive letter are used and setting breakpoint with absolute paths works. Under windows however currently it is not possible to debug files (like setting breakpoints) correctly. Is there a CB setting or workaround available for setting breakpoints with a relative path?


--- End quote ---
@mariocup

Nowadays, I'm doing some coding on breakpoints persistent. So, I read some source code of debuggerGDB.

http://forums.codeblocks.org/index.php/topic,10704.0.html

Now, I can confirm that all the file was recorded and used in "absolute path", you can see a screenshot ( I just debug codeblocks in codeblocks, :D, set a breakpoint in AddBreakpoint function)


By ollydbg at 2009-06-20

And

--- Code: ---int DebuggerState::AddBreakpoint(const wxString& file, int line, bool temp, const wxString& lineText)
{
    wxString bpfile = ConvertToValidFilename(file);

    // do we have a bp there?
    int idx = HasBreakpoint(bpfile, line);
    // if yes, remove old breakpoint first
    if (idx != -1)
        RemoveBreakpoint(idx, true);
    // create new bp
    Manager::Get()->GetLogManager()->DebugLog(F(_T("add bp: file=%s, bpfile=%s"), file.c_str(), bpfile.c_str()));
    DebuggerBreakpoint* bp = new DebuggerBreakpoint;
    bp->type = DebuggerBreakpoint::bptCode;
    bp->filename = bpfile;
    bp->filenameAsPassed = file;
    bp->line = line;
    bp->temporary = temp;
    bp->lineText = lineText;
    bp->userData = FindProjectForFile(file);
    return AddBreakpoint(bp);
}

--- End code ---

But these file path can transfered from "absolute path" to "relative path". Which is the way I have done to save all the breakpoints in a XXXX.bps file near yourproject.cbp.

You can see the code in:
https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2775&group_id=5358

Thanks!

MortenMacFly:

--- Quote from: ollydbg on June 21, 2009, 08:56:42 am ---But these file path can transfered from "absolute path" to "relative path". Which is the way I have done to save all the breakpoints in a XXXX.bps file near yourproject.cbp.

--- End quote ---
BTW: This won't work then if the files are on different drives on Windows. ;-)

mariocup:
Hi,

the strange thing I found is that gdb 6.8 (from http://www.tdragon.net/recentgcc/) is able to set breakpoints in Code::Blocks and the GDB path problem does not exist. If I try to set breakpoint with a "own" compiled e.g. arm gdb the settings of breakpoint fails. My colleague reviewed yesterday the source code and found the problem. In the file util.c it exists a call to the function realpath and this function has been empty. This functionality realpath to handle paths under win32 correctly had been in the libiberty sources. I copied this functionality in the util.c source and generated gdb and then I am able to set breakpoints correctly. Does anyone know why the gdb 6.8 version from tdragon works correct (is it a patched version?). Is this a know problem in the gnu community (I googled a lot but did not find any adequate answer for it).

If it is of interest I can send the corresponding modifications.


ollydbg:

--- Quote from: mariocup on June 23, 2009, 01:26:53 pm ---Does anyone know why the gdb 6.8 version from tdragon works correct (is it a patched version?).

--- End quote ---
No, I think John (author of TDM GCC) only has patches in GCC (not GDB). See: http://www.tdragon.net/recentgcc/devel.php

Navigation

[0] Message Index

[*] Previous page

Go to full version