diff --git a/src/apps/debugger/Jamfile b/src/apps/debugger/Jamfile index 18ff810faa..95550ffc67 100644 --- a/src/apps/debugger/Jamfile +++ b/src/apps/debugger/Jamfile @@ -100,6 +100,7 @@ Application Debugger : DebuggerTeamDebugInfo.cpp DwarfFunctionDebugInfo.cpp DwarfImageDebugInfo.cpp + DwarfImageDebugInfoLoadingState.cpp DwarfStackFrameDebugInfo.cpp DwarfTeamDebugInfo.cpp DwarfTypeFactory.cpp @@ -109,9 +110,11 @@ Application Debugger : FunctionInstance.cpp GlobalTypeLookup.cpp ImageDebugInfo.cpp + ImageDebugInfoLoadingState.cpp ImageDebugInfoProvider.cpp NoOpStackFrameDebugInfo.cpp SpecificImageDebugInfo.cpp + SpecificImageDebugInfoLoadingState.cpp SpecificTeamDebugInfo.cpp StackFrameDebugInfo.cpp TeamDebugInfo.cpp diff --git a/src/apps/debugger/debug_info/DwarfImageDebugInfoLoadingState.cpp b/src/apps/debugger/debug_info/DwarfImageDebugInfoLoadingState.cpp new file mode 100644 index 0000000000..d372017c87 --- /dev/null +++ b/src/apps/debugger/debug_info/DwarfImageDebugInfoLoadingState.cpp @@ -0,0 +1,27 @@ +/* + * Copyright 2014, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ + + +#include "DwarfImageDebugInfoLoadingState.h" + + +DwarfImageDebugInfoLoadingState::DwarfImageDebugInfoLoadingState() + : + SpecificImageDebugInfoLoadingState(), + fState() +{ +} + + +DwarfImageDebugInfoLoadingState::~DwarfImageDebugInfoLoadingState() +{ +} + + +bool +DwarfImageDebugInfoLoadingState::UserInputRequired() const +{ + return fState.state == DWARF_FILE_LOADING_STATE_USER_INPUT_NEEDED; +} diff --git a/src/apps/debugger/debug_info/DwarfImageDebugInfoLoadingState.h b/src/apps/debugger/debug_info/DwarfImageDebugInfoLoadingState.h new file mode 100644 index 0000000000..f2edd1cd69 --- /dev/null +++ b/src/apps/debugger/debug_info/DwarfImageDebugInfoLoadingState.h @@ -0,0 +1,30 @@ +/* + * Copyright 2014, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ +#ifndef DWARF_IMAGE_DEBUG_INFO_LOADING_STATE_H +#define DWARF_IMAGE_DEBUG_INFO_LOADING_STATE_H + + +#include "DwarfFileLoadingState.h" +#include "SpecificImageDebugInfoLoadingState.h" + + +class DwarfImageDebugInfoLoadingState + : public SpecificImageDebugInfoLoadingState { +public: + DwarfImageDebugInfoLoadingState(); + virtual ~DwarfImageDebugInfoLoadingState(); + + virtual bool UserInputRequired() const; + + DwarfFileLoadingState& GetFileState() + { return fState; } + +private: + DwarfFileLoadingState fState; +}; + + +#endif // DWARF_IMAGE_DEBUG_INFO_LOADING_STATE_H + diff --git a/src/apps/debugger/debug_info/ImageDebugInfoLoadingState.cpp b/src/apps/debugger/debug_info/ImageDebugInfoLoadingState.cpp new file mode 100644 index 0000000000..dffab2fb85 --- /dev/null +++ b/src/apps/debugger/debug_info/ImageDebugInfoLoadingState.cpp @@ -0,0 +1,61 @@ +/* + * Copyright 2014, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ + + +#include "ImageDebugInfoLoadingState.h" + +#include "SpecificImageDebugInfoLoadingState.h" + + +ImageDebugInfoLoadingState::ImageDebugInfoLoadingState() + : + fSpecificInfoLoadingState(), + fSpecificInfoIndex(0) +{ +} + + +ImageDebugInfoLoadingState::~ImageDebugInfoLoadingState() +{ +} + + +bool +ImageDebugInfoLoadingState::HasSpecificDebugInfoLoadingState() const +{ + return fSpecificInfoLoadingState.Get() != NULL; +} + + +void +ImageDebugInfoLoadingState::SetSpecificDebugInfoLoadingState( + SpecificImageDebugInfoLoadingState* state) +{ + fSpecificInfoLoadingState.SetTo(state, true); +} + + +void +ImageDebugInfoLoadingState::ClearSpecificDebugInfoLoadingState() +{ + fSpecificInfoLoadingState = NULL; +} + + +bool +ImageDebugInfoLoadingState::UserInputRequired() const +{ + if (HasSpecificDebugInfoLoadingState()) + return fSpecificInfoLoadingState->UserInputRequired(); + + return false; +} + + +void +ImageDebugInfoLoadingState::SetSpecificInfoIndex(int32 index) +{ + fSpecificInfoIndex = index; +} diff --git a/src/apps/debugger/debug_info/ImageDebugInfoLoadingState.h b/src/apps/debugger/debug_info/ImageDebugInfoLoadingState.h new file mode 100644 index 0000000000..80897592cf --- /dev/null +++ b/src/apps/debugger/debug_info/ImageDebugInfoLoadingState.h @@ -0,0 +1,43 @@ +/* + * Copyright 2014, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ +#ifndef IMAGE_DEBUG_INFO_LOADING_STATE_H +#define IMAGE_DEBUG_INFO_LOADING_STATE_H + +#include + + +class SpecificImageDebugInfoLoadingState; + + +class ImageDebugInfoLoadingState { +public: + ImageDebugInfoLoadingState(); + virtual ~ImageDebugInfoLoadingState(); + + bool HasSpecificDebugInfoLoadingState() const; + SpecificImageDebugInfoLoadingState* + GetSpecificDebugInfoLoadingState() const + { return fSpecificInfoLoadingState; } + void SetSpecificDebugInfoLoadingState( + SpecificImageDebugInfoLoadingState* state); + // note: takes over reference of passed + // in state object. + void ClearSpecificDebugInfoLoadingState(); + + bool UserInputRequired() const; + + + int32 GetSpecificInfoIndex() const + { return fSpecificInfoIndex; } + void SetSpecificInfoIndex(int32 index); + +private: + BReference + fSpecificInfoLoadingState; + int32 fSpecificInfoIndex; +}; + + +#endif // IMAGE_DEBUG_INFO_LOADING_STATE_H diff --git a/src/apps/debugger/debug_info/SpecificImageDebugInfoLoadingState.cpp b/src/apps/debugger/debug_info/SpecificImageDebugInfoLoadingState.cpp new file mode 100644 index 0000000000..23fabb85bd --- /dev/null +++ b/src/apps/debugger/debug_info/SpecificImageDebugInfoLoadingState.cpp @@ -0,0 +1,19 @@ +/* + * Copyright 2014, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ + + +#include "SpecificImageDebugInfoLoadingState.h" + + +SpecificImageDebugInfoLoadingState::SpecificImageDebugInfoLoadingState() + : + BReferenceable() +{ +} + + +SpecificImageDebugInfoLoadingState::~SpecificImageDebugInfoLoadingState() +{ +} diff --git a/src/apps/debugger/debug_info/SpecificImageDebugInfoLoadingState.h b/src/apps/debugger/debug_info/SpecificImageDebugInfoLoadingState.h new file mode 100644 index 0000000000..ce4393bc9b --- /dev/null +++ b/src/apps/debugger/debug_info/SpecificImageDebugInfoLoadingState.h @@ -0,0 +1,21 @@ +/* + * Copyright 2014, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ +#ifndef SPECIFIC_IMAGE_DEBUG_INFO_LOADING_STATE_H +#define SPECIFIC_IMAGE_DEBUG_INFO_LOADING_STATE_H + + +#include + + +class SpecificImageDebugInfoLoadingState : public BReferenceable { +public: + SpecificImageDebugInfoLoadingState(); + virtual ~SpecificImageDebugInfoLoadingState(); + + virtual bool UserInputRequired() const = 0; +}; + + +#endif // SPECIFIC_IMAGE_DEBUG_INFO_LOADING_STATE_H diff --git a/src/apps/debugger/dwarf/DwarfFileLoadingState.cpp b/src/apps/debugger/dwarf/DwarfFileLoadingState.cpp new file mode 100644 index 0000000000..bcf33da0f3 --- /dev/null +++ b/src/apps/debugger/dwarf/DwarfFileLoadingState.cpp @@ -0,0 +1,26 @@ +/* + * Copyright 2014, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ + + +#include "DwarfFileLoadingState.h" + +#include "DwarfFile.h" + + +DwarfFileLoadingState::DwarfFileLoadingState() + : + dwarfFile(), + externalInfoFileName(), + locatedExternalInfoPath(), + state(DWARF_FILE_LOADING_STATE_INITIAL) +{ +} + + +DwarfFileLoadingState::~DwarfFileLoadingState() +{ +} + + diff --git a/src/apps/debugger/dwarf/DwarfFileLoadingState.h b/src/apps/debugger/dwarf/DwarfFileLoadingState.h new file mode 100644 index 0000000000..7f1467d1b8 --- /dev/null +++ b/src/apps/debugger/dwarf/DwarfFileLoadingState.h @@ -0,0 +1,38 @@ +/* + * Copyright 2014, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ +#ifndef DWARF_FILE_LOADING_STATE_H +#define DWARF_FILE_LOADING_STATE_H + + +#include +#include + + +class DwarfFile; + + +enum dwarf_file_loading_state { + DWARF_FILE_LOADING_STATE_INITIAL = 0, + DWARF_FILE_LOADING_STATE_USER_INPUT_NEEDED, + DWARF_FILE_LOADING_STATE_USER_INPUT_PROVIDED, + DWARF_FILE_LOADING_STATE_FAILED, + DWARF_FILE_LOADING_STATE_SUCCEEDED +}; + + +struct DwarfFileLoadingState { + BReference + dwarfFile; + BString externalInfoFileName; + BString locatedExternalInfoPath; + dwarf_file_loading_state + state; + + DwarfFileLoadingState(); + ~DwarfFileLoadingState(); +}; + + +#endif // DWARF_FILE_LOADING_STATE_H diff --git a/src/apps/debugger/dwarf/Jamfile b/src/apps/debugger/dwarf/Jamfile index 4cf6b78281..f806498da8 100644 --- a/src/apps/debugger/dwarf/Jamfile +++ b/src/apps/debugger/dwarf/Jamfile @@ -22,6 +22,7 @@ MergeObject Debugger_dwarf.o DebugInfoEntry.cpp DwarfExpressionEvaluator.cpp DwarfFile.cpp + DwarfFileLoadingState.cpp DwarfManager.cpp DwarfTargetInterface.cpp DwarfUtils.cpp