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