Debugger: Cleanups.
- Remove dependency on MAPM/ExpressionParser. Consequently also adjust CliDumpMemoryCommand, InspectorWindow and WatchPromptWindow to use CLanguageExpressionEvaluator for address input evaluation.
This commit is contained in:
@@ -6,7 +6,6 @@ UseHeaders [ FDirName $(HAIKU_TOP) headers compatibility bsd ] : true ;
|
|||||||
UseHeaders [ FDirName $(TARGET_COMMON_DEBUG_OBJECT_DIR_$(TARGET_PACKAGING_ARCH))
|
UseHeaders [ FDirName $(TARGET_COMMON_DEBUG_OBJECT_DIR_$(TARGET_PACKAGING_ARCH))
|
||||||
system kernel ] ;
|
system kernel ] ;
|
||||||
|
|
||||||
UseLibraryHeaders mapm ;
|
|
||||||
UsePrivateHeaders app debug interface kernel package shared libroot ;
|
UsePrivateHeaders app debug interface kernel package shared libroot ;
|
||||||
UsePrivateSystemHeaders ;
|
UsePrivateSystemHeaders ;
|
||||||
|
|
||||||
@@ -358,8 +357,6 @@ Application Debugger :
|
|||||||
<bin>debug_utils.a
|
<bin>debug_utils.a
|
||||||
libcolumnlistview.a
|
libcolumnlistview.a
|
||||||
libshared.a
|
libshared.a
|
||||||
libexpression_parser.a
|
|
||||||
libmapm.a
|
|
||||||
libedit.a
|
libedit.a
|
||||||
libncurses.a
|
libncurses.a
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2011, Ingo Weinhold, [email protected].
|
* Copyright 2009-2011, Ingo Weinhold, [email protected].
|
||||||
* Copyright 2002-2010, Axel Dörfler, [email protected].
|
* Copyright 2002-2010, Axel Dörfler, [email protected].
|
||||||
* Copyright 2012, Rene Gollent, [email protected].
|
* Copyright 2012-2014, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
||||||
@@ -15,9 +15,10 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <AutoLocker.h>
|
#include <AutoLocker.h>
|
||||||
#include <ExpressionParser.h>
|
|
||||||
|
|
||||||
|
#include "CLanguageExpressionEvaluator.h"
|
||||||
#include "CliContext.h"
|
#include "CliContext.h"
|
||||||
|
#include "Number.h"
|
||||||
#include "Team.h"
|
#include "Team.h"
|
||||||
#include "TeamMemoryBlock.h"
|
#include "TeamMemoryBlock.h"
|
||||||
#include "UiUtils.h"
|
#include "UiUtils.h"
|
||||||
@@ -42,12 +43,11 @@ CliDumpMemoryCommand::Execute(int argc, const char* const* argv,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CLanguageExpressionEvaluator evaluator;
|
||||||
target_addr_t address;
|
target_addr_t address;
|
||||||
ExpressionParser parser;
|
|
||||||
parser.SetSupportHexInput(true);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
address = parser.EvaluateToInt64(argv[1]);
|
Number value = evaluator.Evaluate(argv[1], B_UINT64_TYPE);
|
||||||
|
address = value.GetValue().ToUInt64();
|
||||||
} catch(...) {
|
} catch(...) {
|
||||||
printf("Error parsing address/expression.\n");
|
printf("Error parsing address/expression.\n");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -16,12 +16,12 @@
|
|||||||
#include <ScrollView.h>
|
#include <ScrollView.h>
|
||||||
#include <TextControl.h>
|
#include <TextControl.h>
|
||||||
|
|
||||||
#include <ExpressionParser.h>
|
|
||||||
|
|
||||||
#include "Architecture.h"
|
#include "Architecture.h"
|
||||||
|
#include "CLanguageExpressionEvaluator.h"
|
||||||
#include "GuiTeamUiSettings.h"
|
#include "GuiTeamUiSettings.h"
|
||||||
#include "MemoryView.h"
|
#include "MemoryView.h"
|
||||||
#include "MessageCodes.h"
|
#include "MessageCodes.h"
|
||||||
|
#include "Number.h"
|
||||||
#include "Team.h"
|
#include "Team.h"
|
||||||
#include "UserInterface.h"
|
#include "UserInterface.h"
|
||||||
|
|
||||||
@@ -199,12 +199,14 @@ InspectorWindow::MessageReceived(BMessage* message)
|
|||||||
target_addr_t address = 0;
|
target_addr_t address = 0;
|
||||||
bool addressValid = false;
|
bool addressValid = false;
|
||||||
if (message->FindUInt64("address", &address) != B_OK) {
|
if (message->FindUInt64("address", &address) != B_OK) {
|
||||||
ExpressionParser parser;
|
CLanguageExpressionEvaluator evaluator;
|
||||||
parser.SetSupportHexInput(true);
|
|
||||||
const char* addressExpression = fAddressInput->Text();
|
const char* addressExpression = fAddressInput->Text();
|
||||||
BString errorMessage;
|
BString errorMessage;
|
||||||
try {
|
try {
|
||||||
address = parser.EvaluateToInt64(addressExpression);
|
Number value;
|
||||||
|
value = evaluator.Evaluate(addressExpression,
|
||||||
|
B_INT64_TYPE);
|
||||||
|
address = value.GetValue().ToUInt64();
|
||||||
} catch(ParseException parseError) {
|
} catch(ParseException parseError) {
|
||||||
errorMessage.SetToFormat("Failed to parse address: %s",
|
errorMessage.SetToFormat("Failed to parse address: %s",
|
||||||
parseError.message.String());
|
parseError.message.String());
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012, Rene Gollent, [email protected].
|
* Copyright 2012-2014, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#include "WatchPromptWindow.h"
|
#include "WatchPromptWindow.h"
|
||||||
@@ -13,10 +13,10 @@
|
|||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <TextControl.h>
|
#include <TextControl.h>
|
||||||
|
|
||||||
#include <ExpressionParser.h>
|
|
||||||
|
|
||||||
#include "Architecture.h"
|
#include "Architecture.h"
|
||||||
|
#include "CLanguageExpressionEvaluator.h"
|
||||||
#include "MessageCodes.h"
|
#include "MessageCodes.h"
|
||||||
|
#include "Number.h"
|
||||||
#include "UserInterface.h"
|
#include "UserInterface.h"
|
||||||
#include "Watchpoint.h"
|
#include "Watchpoint.h"
|
||||||
|
|
||||||
@@ -143,12 +143,15 @@ WatchPromptWindow::MessageReceived(BMessage* message)
|
|||||||
{
|
{
|
||||||
target_addr_t address = 0;
|
target_addr_t address = 0;
|
||||||
int32 length = 0;
|
int32 length = 0;
|
||||||
ExpressionParser parser;
|
CLanguageExpressionEvaluator evaluator;
|
||||||
parser.SetSupportHexInput(true);
|
|
||||||
BString errorMessage;
|
BString errorMessage;
|
||||||
try {
|
try {
|
||||||
address = parser.EvaluateToInt64(fAddressInput->Text());
|
Number value = evaluator.Evaluate(fAddressInput->Text(),
|
||||||
length = (int32)parser.EvaluateToInt64(fLengthInput->Text());
|
B_UINT64_TYPE);
|
||||||
|
address = value.GetValue().ToUInt64();
|
||||||
|
value = evaluator.Evaluate(fLengthInput->Text(),
|
||||||
|
B_INT32_TYPE);
|
||||||
|
length = value.GetValue().ToInt32();
|
||||||
} catch(ParseException parseError) {
|
} catch(ParseException parseError) {
|
||||||
errorMessage.SetToFormat("Failed to parse data: %s",
|
errorMessage.SetToFormat("Failed to parse data: %s",
|
||||||
parseError.message.String());
|
parseError.message.String());
|
||||||
|
|||||||
Reference in New Issue
Block a user