2009-10-15 09:47:24 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
2016-05-29 13:52:47 -04:00
|
|
|
* Copyright 2013-2016, Rene Gollent, rene@gollent.com.
|
2009-10-15 09:47:24 +00:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef USER_INTERFACE_H
|
|
|
|
#define USER_INTERFACE_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <OS.h>
|
|
|
|
|
|
|
|
#include <Referenceable.h>
|
|
|
|
|
2011-06-10 01:58:39 +00:00
|
|
|
#include "TeamMemoryBlock.h"
|
2009-10-15 09:47:24 +00:00
|
|
|
#include "Types.h"
|
|
|
|
|
|
|
|
|
2012-11-18 13:08:38 -05:00
|
|
|
class entry_ref;
|
|
|
|
|
* EnumerationValue -> EnumeratorValue
* Since some types don't have names (e.g. pointer types or anonymous structs or
unions), each type does now also have a unique ID. The global type cache
registers types by ID and by name (if they have one). This fixes clashes of
types with empty names.
* Completely refactored the code dealing with variable values. Formerly we had
Variable and TypeComponentPath to navigate to a component, mapped to a
BVariant representing the value. Now we have:
* Interface Value with various subclasses (BoolValue, IntegerValue, etc.) to
represent a value, with the flexibility for more esoteric values.
* A tree of ValueNode+ValueNodeChild objects to represent the components of a
variable. On top of each ValueNodeChild sits a ValueNode representing the
value of the component, potentially having ValueNodeChild children. This
should allow casting a component value, simply by replacing its ValueNode.
* Interface ValueHandler and various implementations for the different value
types. It is basically a factory for classes allowing to format/display a
value.
* ValueHandlerRoster -- a registry for ValueHandlers, finding the best one
for a given value.
* Interface TypeHandler and various implementions for the different type
kinds (primitive, compound, address, etc.). It is basically a factory for
ValueNodes for that type.
* TypeHandlerRoster -- a registry for TypeHandlers, finding the best one
for a given type.
That's still a bit work in progress. It introduces at least one regression:
The VariablesView doesn't save/restore its state anymore. Will take a while
until that is added back.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33907 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-05 18:15:21 +00:00
|
|
|
class CpuState;
|
2014-11-08 18:20:30 -05:00
|
|
|
class ExpressionInfo;
|
2009-10-15 09:47:24 +00:00
|
|
|
class FunctionInstance;
|
|
|
|
class Image;
|
2014-08-29 10:55:45 -04:00
|
|
|
class LocatableFile;
|
2014-10-28 15:24:34 -04:00
|
|
|
class SourceLanguage;
|
2009-10-15 09:47:24 +00:00
|
|
|
class StackFrame;
|
|
|
|
class Team;
|
2012-07-24 00:28:16 +02:00
|
|
|
class TeamUiSettings;
|
2009-10-15 09:47:24 +00:00
|
|
|
class Thread;
|
|
|
|
class TypeComponentPath;
|
|
|
|
class UserBreakpoint;
|
|
|
|
class UserInterfaceListener;
|
2015-07-23 22:47:08 -04:00
|
|
|
class Value;
|
* EnumerationValue -> EnumeratorValue
* Since some types don't have names (e.g. pointer types or anonymous structs or
unions), each type does now also have a unique ID. The global type cache
registers types by ID and by name (if they have one). This fixes clashes of
types with empty names.
* Completely refactored the code dealing with variable values. Formerly we had
Variable and TypeComponentPath to navigate to a component, mapped to a
BVariant representing the value. Now we have:
* Interface Value with various subclasses (BoolValue, IntegerValue, etc.) to
represent a value, with the flexibility for more esoteric values.
* A tree of ValueNode+ValueNodeChild objects to represent the components of a
variable. On top of each ValueNodeChild sits a ValueNode representing the
value of the component, potentially having ValueNodeChild children. This
should allow casting a component value, simply by replacing its ValueNode.
* Interface ValueHandler and various implementations for the different value
types. It is basically a factory for classes allowing to format/display a
value.
* ValueHandlerRoster -- a registry for ValueHandlers, finding the best one
for a given value.
* Interface TypeHandler and various implementions for the different type
kinds (primitive, compound, address, etc.). It is basically a factory for
ValueNodes for that type.
* TypeHandlerRoster -- a registry for TypeHandlers, finding the best one
for a given type.
That's still a bit work in progress. It introduces at least one regression:
The VariablesView doesn't save/restore its state anymore. Will take a while
until that is added back.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33907 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-05 18:15:21 +00:00
|
|
|
class ValueNode;
|
|
|
|
class ValueNodeContainer;
|
2012-11-06 11:45:26 +01:00
|
|
|
class Watchpoint;
|
2009-10-15 09:47:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
enum user_notification_type {
|
|
|
|
USER_NOTIFICATION_INFO,
|
|
|
|
USER_NOTIFICATION_WARNING,
|
|
|
|
USER_NOTIFICATION_ERROR
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class UserInterface : public BReferenceable {
|
|
|
|
public:
|
|
|
|
virtual ~UserInterface();
|
|
|
|
|
2011-11-02 19:04:24 +00:00
|
|
|
virtual const char* ID() const = 0;
|
|
|
|
|
2009-10-15 09:47:24 +00:00
|
|
|
virtual status_t Init(Team* team,
|
|
|
|
UserInterfaceListener* listener) = 0;
|
|
|
|
virtual void Show() = 0;
|
|
|
|
virtual void Terminate() = 0;
|
|
|
|
// shut down the UI *now* -- no more user
|
|
|
|
// feedback
|
|
|
|
|
2016-07-03 13:47:32 -04:00
|
|
|
virtual UserInterface* Clone() const = 0;
|
|
|
|
// returns a new instance of the
|
|
|
|
// appropriate user interface subclass.
|
|
|
|
// primarily needed in order to
|
|
|
|
// reconstruct the necessary information
|
|
|
|
// for initiating a team restart.
|
|
|
|
|
2014-06-15 16:38:51 -04:00
|
|
|
virtual bool IsInteractive() const = 0;
|
|
|
|
|
2012-07-24 00:28:16 +02:00
|
|
|
virtual status_t LoadSettings(const TeamUiSettings* settings)
|
2011-11-02 19:04:24 +00:00
|
|
|
= 0;
|
2012-07-24 00:28:16 +02:00
|
|
|
virtual status_t SaveSettings(TeamUiSettings*& settings)
|
2011-11-02 19:04:24 +00:00
|
|
|
const = 0;
|
|
|
|
|
2009-10-15 09:47:24 +00:00
|
|
|
virtual void NotifyUser(const char* title,
|
|
|
|
const char* message,
|
|
|
|
user_notification_type type) = 0;
|
2015-08-14 20:42:11 -04:00
|
|
|
virtual void NotifyBackgroundWorkStatus(const char* message)
|
|
|
|
= 0;
|
|
|
|
// this is used to inform the user about
|
|
|
|
// background processing work, but doesn't
|
|
|
|
// otherwise require any form of
|
|
|
|
// user interaction, i.e. for a status bar
|
|
|
|
// to indicate that debug information is
|
|
|
|
// being parsed.
|
|
|
|
|
2009-10-15 09:47:24 +00:00
|
|
|
virtual int32 SynchronouslyAskUser(const char* title,
|
|
|
|
const char* message, const char* choice1,
|
|
|
|
const char* choice2, const char* choice3)
|
|
|
|
= 0;
|
2012-07-27 23:04:16 +02:00
|
|
|
// returns -1, if not implemented or user
|
|
|
|
// cannot be asked
|
2014-06-10 19:10:53 -04:00
|
|
|
|
|
|
|
virtual status_t SynchronouslyAskUserForFile(entry_ref* _ref)
|
|
|
|
= 0;
|
2009-10-15 09:47:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class UserInterfaceListener {
|
2012-07-27 23:04:16 +02:00
|
|
|
public:
|
2012-07-29 00:18:43 +02:00
|
|
|
enum QuitOption {
|
|
|
|
QUIT_OPTION_ASK_USER,
|
|
|
|
QUIT_OPTION_ASK_KILL_TEAM,
|
|
|
|
QUIT_OPTION_ASK_RESUME_TEAM
|
|
|
|
};
|
2012-07-27 23:04:16 +02:00
|
|
|
|
2009-10-15 09:47:24 +00:00
|
|
|
public:
|
|
|
|
virtual ~UserInterfaceListener();
|
|
|
|
|
|
|
|
virtual void FunctionSourceCodeRequested(
|
2013-06-22 12:51:27 -04:00
|
|
|
FunctionInstance* function,
|
|
|
|
bool forceDisassembly = false) = 0;
|
2010-11-03 21:52:39 +00:00
|
|
|
virtual void SourceEntryLocateRequested(
|
|
|
|
const char* sourcePath,
|
|
|
|
const char* locatedPath) = 0;
|
2014-08-29 10:55:45 -04:00
|
|
|
virtual void SourceEntryInvalidateRequested(
|
|
|
|
LocatableFile* sourceFile) = 0;
|
2009-10-15 09:47:24 +00:00
|
|
|
virtual void ImageDebugInfoRequested(Image* image) = 0;
|
* EnumerationValue -> EnumeratorValue
* Since some types don't have names (e.g. pointer types or anonymous structs or
unions), each type does now also have a unique ID. The global type cache
registers types by ID and by name (if they have one). This fixes clashes of
types with empty names.
* Completely refactored the code dealing with variable values. Formerly we had
Variable and TypeComponentPath to navigate to a component, mapped to a
BVariant representing the value. Now we have:
* Interface Value with various subclasses (BoolValue, IntegerValue, etc.) to
represent a value, with the flexibility for more esoteric values.
* A tree of ValueNode+ValueNodeChild objects to represent the components of a
variable. On top of each ValueNodeChild sits a ValueNode representing the
value of the component, potentially having ValueNodeChild children. This
should allow casting a component value, simply by replacing its ValueNode.
* Interface ValueHandler and various implementations for the different value
types. It is basically a factory for classes allowing to format/display a
value.
* ValueHandlerRoster -- a registry for ValueHandlers, finding the best one
for a given value.
* Interface TypeHandler and various implementions for the different type
kinds (primitive, compound, address, etc.). It is basically a factory for
ValueNodes for that type.
* TypeHandlerRoster -- a registry for TypeHandlers, finding the best one
for a given type.
That's still a bit work in progress. It introduces at least one regression:
The VariablesView doesn't save/restore its state anymore. Will take a while
until that is added back.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33907 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-05 18:15:21 +00:00
|
|
|
virtual void ValueNodeValueRequested(CpuState* cpuState,
|
|
|
|
ValueNodeContainer* container,
|
|
|
|
ValueNode* valueNode) = 0;
|
2015-07-23 22:47:08 -04:00
|
|
|
virtual void ValueNodeWriteRequested(ValueNode* node,
|
|
|
|
CpuState* state, Value* newValue) = 0;
|
2009-10-15 09:47:24 +00:00
|
|
|
virtual void ThreadActionRequested(thread_id threadID,
|
2013-05-11 23:09:12 -04:00
|
|
|
uint32 action,
|
|
|
|
target_addr_t address = 0) = 0;
|
2009-10-15 09:47:24 +00:00
|
|
|
|
|
|
|
virtual void SetBreakpointRequested(target_addr_t address,
|
2013-06-15 14:47:14 -04:00
|
|
|
bool enabled, bool hidden = false) = 0;
|
2009-10-15 09:47:24 +00:00
|
|
|
virtual void SetBreakpointEnabledRequested(
|
|
|
|
UserBreakpoint* breakpoint,
|
|
|
|
bool enabled) = 0;
|
2014-10-30 14:23:26 -04:00
|
|
|
virtual void SetBreakpointConditionRequested(
|
|
|
|
UserBreakpoint* breakpoint,
|
|
|
|
const char* condition) = 0;
|
|
|
|
virtual void ClearBreakpointConditionRequested(
|
|
|
|
UserBreakpoint* breakpoint) = 0;
|
2009-10-15 09:47:24 +00:00
|
|
|
virtual void ClearBreakpointRequested(
|
|
|
|
target_addr_t address) = 0;
|
|
|
|
virtual void ClearBreakpointRequested(
|
|
|
|
UserBreakpoint* breakpoint) = 0;
|
|
|
|
// TODO: Consolidate those!
|
|
|
|
|
2013-07-07 00:31:22 -04:00
|
|
|
virtual void SetStopOnImageLoadRequested(bool enabled,
|
|
|
|
bool useImageNames) = 0;
|
|
|
|
virtual void AddStopImageNameRequested(
|
|
|
|
const char* name) = 0;
|
|
|
|
virtual void RemoveStopImageNameRequested(
|
|
|
|
const char* name) = 0;
|
2013-07-04 10:39:34 -04:00
|
|
|
|
2015-06-29 23:26:08 -04:00
|
|
|
virtual void SetDefaultSignalDispositionRequested(
|
|
|
|
int32 disposition) = 0;
|
|
|
|
virtual void SetCustomSignalDispositionRequested(
|
|
|
|
int32 signal, int32 disposition) = 0;
|
|
|
|
virtual void RemoveCustomSignalDispositionRequested(
|
|
|
|
int32 signal) = 0;
|
|
|
|
|
2012-11-06 11:45:26 +01:00
|
|
|
virtual void SetWatchpointRequested(target_addr_t address,
|
|
|
|
uint32 type, int32 length,
|
|
|
|
bool enabled) = 0;
|
|
|
|
virtual void SetWatchpointEnabledRequested(
|
|
|
|
Watchpoint* watchpoint,
|
|
|
|
bool enabled) = 0;
|
|
|
|
virtual void ClearWatchpointRequested(
|
|
|
|
target_addr_t address) = 0;
|
|
|
|
virtual void ClearWatchpointRequested(
|
|
|
|
Watchpoint* watchpoint) = 0;
|
|
|
|
|
2011-06-10 01:58:39 +00:00
|
|
|
virtual void InspectRequested(
|
|
|
|
target_addr_t address,
|
|
|
|
TeamMemoryBlock::Listener* listener) = 0;
|
2015-05-23 16:12:43 -04:00
|
|
|
virtual void MemoryWriteRequested(
|
|
|
|
target_addr_t address,
|
|
|
|
const void* data,
|
|
|
|
target_size_t length) = 0;
|
2011-06-10 01:58:39 +00:00
|
|
|
|
2014-10-28 15:24:34 -04:00
|
|
|
virtual void ExpressionEvaluationRequested(
|
|
|
|
SourceLanguage* language,
|
2014-11-08 18:20:30 -05:00
|
|
|
ExpressionInfo* info,
|
2014-10-29 17:32:14 -04:00
|
|
|
StackFrame* frame = NULL,
|
2016-05-29 13:52:47 -04:00
|
|
|
::Thread* thread = NULL) = 0;
|
2014-10-28 15:24:34 -04:00
|
|
|
|
2012-11-18 13:08:38 -05:00
|
|
|
virtual void DebugReportRequested(entry_ref* path) = 0;
|
|
|
|
|
2016-04-26 22:35:54 -04:00
|
|
|
virtual void WriteCoreFileRequested(entry_ref* path) = 0;
|
|
|
|
|
2013-05-29 21:57:48 -04:00
|
|
|
virtual void TeamRestartRequested() = 0;
|
|
|
|
|
2012-07-27 23:04:16 +02:00
|
|
|
virtual bool UserInterfaceQuitRequested(
|
|
|
|
QuitOption quitOption
|
|
|
|
= QUIT_OPTION_ASK_USER) = 0;
|
2009-10-15 09:47:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // USER_INTERFACE_H
|