Skip to content

Commit

Permalink
Debugger: Add definitions for signal dispositions.
Browse files Browse the repository at this point in the history
- Add header for defining the possible signal dispositions that can be
  configured.
- Add corresponding UI helper function to map to a string
  representation.
  • Loading branch information
anevilyak committed Jul 3, 2015
1 parent 17cbae2 commit 8e5da92
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/apps/debugger/types/SignalDispositionTypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright 2015, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
#ifndef SIGNAL_DISPOSITION_TYPES_H
#define SIGNAL_DISPOSITION_TYPES_H


enum SignalDisposition {
SIGNAL_DISPOSITION_IGNORE = 0,
SIGNAL_DISPOSITION_STOP_AT_RECEIPT,
SIGNAL_DISPOSITION_STOP_AT_SIGNAL_HANDLER,
// NB: if the team has no signal handler installed for
// the corresponding signal, this implies stop at receipt.

SIGNAL_DISPOSITION_MAX
};


#endif // SIGNAL_DISPOSITION_TYPES_H
19 changes: 19 additions & 0 deletions src/apps/debugger/user_interface/util/UiUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "FunctionInstance.h"
#include "Image.h"
#include "RangeList.h"
#include "SignalDispositionTypes.h"
#include "StackFrame.h"
#include "Team.h"
#include "TeamMemoryBlock.h"
Expand Down Expand Up @@ -559,3 +560,21 @@ UiUtils::FormatSIMDValue(const BVariant& value, uint32 bitSize,

return _output;
}


const char*
UiUtils::SignalDispositionToString(int disposition)
{
switch (disposition) {
case SIGNAL_DISPOSITION_IGNORE:
return "Ignore";
case SIGNAL_DISPOSITION_STOP_AT_RECEIPT:
return "Stop at receipt";
case SIGNAL_DISPOSITION_STOP_AT_SIGNAL_HANDLER:
return "Stop at signal handler";
default:
break;
}

return "Unknown";
}
2 changes: 2 additions & 0 deletions src/apps/debugger/user_interface/util/UiUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ class UiUtils {
static const BString& FormatSIMDValue(const BVariant& value,
uint32 bitSize, uint32 format,
BString& _output);

static const char* SignalDispositionToString(int disposition);
};


Expand Down

0 comments on commit 8e5da92

Please sign in to comment.