Skip to content

Commit

Permalink
- Debugger now avoid file name comparisons and uses wxFileName compar…
Browse files Browse the repository at this point in the history
…isons. This comes to fix a problem when debugging embedded targets where gdb returns all file name in lower case

git-svn-id: https://codelite.svn.sourceforge.net/svnroot/codelite/trunk@2900 9da81c78-c036-0410-9e1f-a2b0375e4b5a
  • Loading branch information
eranif committed Aug 30, 2009
1 parent cc0068f commit fd3c869
Show file tree
Hide file tree
Showing 8 changed files with 1,632 additions and 1,632 deletions.
2 changes: 1 addition & 1 deletion LiteEditor/breakpointsmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void BreakptMgr::DoRefreshFileBreakpoints(LEditor* editor)
std::vector<BreakpointInfo>::iterator iter = m_bps.begin();
for (; iter != m_bps.end(); ++iter) {
BreakpointInfo b = *iter;
if ((b.file == editor->GetFileName().GetFullPath()) && (b.lineno != -1)) {
if ((editor->GetFileName() == b.file) && (b.lineno != -1)) {
bps.insert(std::pair<int, BreakpointInfo>(b.lineno, b));
}
}
Expand Down
4 changes: 2 additions & 2 deletions LiteEditor/context_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ void ContextCpp::OnGenerateSettersGetters(wxCommandEvent &event)
return;

TagEntryPtr tag = classtags.at(0);
if (tag->GetFile() != editor.GetFileName().GetFullPath()) {
if (editor.GetFileName() != tag->GetFile()) {
wxString msg;
msg << wxT("This file does not seem to contain the declaration for '") << tag->GetName() << wxT("'\n");
msg << wxT("The declaration of '") << tag->GetName() << wxT("' is located at '") << tag->GetFile() << wxT("'\n");
Expand Down Expand Up @@ -2143,7 +2143,7 @@ void ContextCpp::ReplaceInFiles ( const wxString &word, std::list<CppToken> &li
file_name = token.getFilename();
}
LEditor *editor = Frame::Get()->GetMainBook()->OpenFile(token.getFilename(), wxEmptyString, 0);
if (editor != NULL && editor->GetFileName().GetFullPath() == wxFileName(token.getFilename()).GetFullPath()) {
if (editor != NULL && editor->GetFileName() == wxFileName(token.getFilename())) {
editor->SetSelection ( token.getOffset(), token.getOffset()+token.getName().Len() );
if ( editor->GetSelectionStart() != editor->GetSelectionEnd() ) {
editor->ReplaceSelection ( word );
Expand Down
2 changes: 1 addition & 1 deletion LiteEditor/fileview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ wxTreeItemId FileViewTree::FindItemByPath(wxTreeItemId &parent, const wxString &
FilewViewTreeItemData *childData = static_cast<FilewViewTreeItemData*>( GetItemData( child ) );
wxFileName fn(childData->GetData().GetFile());
fn.MakeAbsolute( projectPath );
if (fn.GetFullPath() == fileName) {
if (fn == fileName) {
return child;
}

Expand Down
6 changes: 3 additions & 3 deletions LiteEditor/mainbook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,12 @@ LEditor *MainBook::FindEditor(const wxString &fileName)
{
for (size_t i = 0; i < m_book->GetPageCount(); i++) {
LEditor *editor = dynamic_cast<LEditor*>(m_book->GetPage(i));
if (editor && editor->GetFileName().GetFullPath() == fileName)
if (editor && editor->GetFileName() == fileName)
return editor;
}
for (std::set<wxWindow*>::iterator i = m_detachedTabs.begin(); i != m_detachedTabs.end(); i++) {
LEditor *editor = dynamic_cast<LEditor*>(*i);
if (editor && editor->GetFileName().GetFullPath() == fileName)
if (editor && editor->GetFileName() == fileName)
return editor;
}
return NULL;
Expand All @@ -342,7 +342,7 @@ wxWindow *MainBook::FindPage(const wxString &text)
{
for (size_t i = 0; i < m_book->GetPageCount(); i++) {
LEditor *editor = dynamic_cast<LEditor*>(m_book->GetPage(i));
if (editor && editor->GetFileName().GetFullPath() == text) {
if (editor && editor->GetFileName() == text) {
return editor;
}

Expand Down
6 changes: 3 additions & 3 deletions LiteEditor/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ wxFileName Manager::FindFile ( const wxArrayString& files, const wxFileName &fn

for ( size_t i=0; i< files.GetCount(); i++ ) {
wxFileName tmpFileName ( files.Item ( i ) );
if ( tmpFileName.GetFullPath() == fn.GetFullPath() ) {
if ( tmpFileName == fn ) {
wxFileName tt ( tmpFileName );
if ( tt.MakeAbsolute() ) {
return tt;
Expand Down Expand Up @@ -895,7 +895,7 @@ wxString Manager::GetProjectNameByFile ( const wxString &fullPathFileName )
proj->GetFiles ( files, true );

for ( size_t xx=0; xx<files.size(); xx++ ) {
if ( files.at ( xx ).GetFullPath() == fullPathFileName ) {
if ( files.at ( xx ) == fullPathFileName ) {
return proj->GetName();
}
}
Expand Down Expand Up @@ -1922,7 +1922,7 @@ void Manager::DbgMarkDebuggerLine ( const wxString &fileName, int lineno )
//try to open the file
wxFileName fn ( fileName );
LEditor *editor = Frame::Get()->GetMainBook()->GetActiveEditor();
if ( editor && editor->GetFileName().GetFullPath() == fn.GetFullPath() ) {
if ( editor && editor->GetFileName() == fn ) {
editor->HighlightLine ( lineno );
editor->GotoLine ( lineno-1 );
editor->EnsureVisible ( lineno-1 );
Expand Down
2 changes: 1 addition & 1 deletion Plugin/project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ bool Project::IsFileExist(const wxString &fileName)
GetFiles(files);

for (size_t i=0; i<files.size(); i++) {
if (files.at(i).GetFullPath() == tmp.GetFullPath()) {
if (files.at(i) == tmp) {
return true;
}
}
Expand Down
Loading

0 comments on commit fd3c869

Please sign in to comment.