Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Debug inside inl (inline files)

<< < (2/2)

DrewBoo:

--- Quote from: MortenMacFly on March 13, 2008, 09:50:28 am ---Well... did you ever try righ-clicking on a project and then select "Project Tree" -> "Edit file types and categories"???

--- End quote ---

I DID NOT.   :oops:

MortenMacFly:

--- Quote from: DrewBoo on March 13, 2008, 04:13:07 pm ---I DID NOT.   :oops:

--- End quote ---
LOL... such things can happen. :P (BTW: You'll find this feature via the project menu, too.)
Anyways: Does it work for "inl" files??? It really should. I see no reason why it should not work if you add this extension to the "source files" category that way.

DrewBoo:

--- Quote from: MortenMacFly on March 13, 2008, 08:08:36 pm ---Anyways: Does it work for "inl" files??? It really should. I see no reason why it should not work if you add this extension to the "source files" category that way.

--- End quote ---

I tried a test on mushakk's behalf.

I defined an inline function in a .inl file, included it, and called it with a breakpoint.

I got the same results when adding "*.inl" to both Headers (what i think is the common practice) and Sources (what you suggested).

The debugger halted at the correct place, but did not open the file.  Double-clicking that function in the call stack window also did not open the file.

DrewBoo:

--- Quote from: MortenMacFly on March 13, 2008, 08:08:36 pm ---Anyways: Does it work for "inl" files??? It really should. I see no reason why it should not work if you add this extension to the "source files" category that way.

--- End quote ---


AH!  Here's the answer.

And this is why I didn't know about "Edit file types and categories"...I had already browsed through the codebase and swore I had seen hard-coded file extensions.   :D

Here's a peek at ./src/sdk/globals.cpp.  This function is called to make sure the debugger only opens source and header files.

--- Code: ---FileType FileTypeOf(const wxString& filename)
{
    wxString ext = filename.AfterLast(_T('.')).Lower();

    if (ext.IsSameAs(FileFilters::ASM_EXT) ||
        ext.IsSameAs(FileFilters::C_EXT) ||
        ext.IsSameAs(FileFilters::CC_EXT) ||
        ext.IsSameAs(FileFilters::CPP_EXT) ||
        ext.IsSameAs(FileFilters::CXX_EXT) ||
        ext.IsSameAs(FileFilters::S_EXT) ||
        ext.IsSameAs(FileFilters::SS_EXT) ||
        ext.IsSameAs(FileFilters::S62_EXT) ||
        ext.IsSameAs(FileFilters::D_EXT) ||
        ext.IsSameAs(FileFilters::F_EXT) ||
        ext.IsSameAs(FileFilters::F77_EXT) ||
        ext.IsSameAs(FileFilters::F90_EXT) ||
        ext.IsSameAs(FileFilters::F95_EXT) ||
        ext.IsSameAs(FileFilters::JAVA_EXT)
       )
        return ftSource;

    else if (ext.IsSameAs(FileFilters::H_EXT) ||
             ext.IsSameAs(FileFilters::HH_EXT) ||
             ext.IsSameAs(FileFilters::HPP_EXT) ||
             ext.IsSameAs(FileFilters::HXX_EXT)
            )
        return ftHeader;

// ...(etc.)


--- End code ---

...and that code is being called from here in debuggergdb.cpp

--- Code: ---void DebuggerGDB::SyncEditor(const wxString& filename, int line, bool setMarker)
{
    if (setMarker)
        ClearActiveMarkFromAllEditors();
    FileType ft = FileTypeOf(filename);
    if (ft != ftSource && ft != ftHeader && ft != ftResource)
        return; // don't try to open unknown files

--- End code ---

The solution may be to redefine FileTypeOf to use the custom list, but at the very least the debugger plug-in could be changed so that it doesn't return from that function unless the editor is absolutely incapable of opening the file (e.g. it's a binary)

Navigation

[0] Message Index

[*] Previous page

Go to full version