xref: /haiku/src/kits/debugger/arch/InstructionInfo.cpp (revision fce4895d1884da5ae6fb299d23c735c598e690b1)
1*fce4895dSRene Gollent /*
2*fce4895dSRene Gollent  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3*fce4895dSRene Gollent  * Distributed under the terms of the MIT License.
4*fce4895dSRene Gollent  */
5*fce4895dSRene Gollent 
6*fce4895dSRene Gollent #include "InstructionInfo.h"
7*fce4895dSRene Gollent 
8*fce4895dSRene Gollent 
InstructionInfo()9*fce4895dSRene Gollent InstructionInfo::InstructionInfo()
10*fce4895dSRene Gollent 	:
11*fce4895dSRene Gollent 	fAddress(0),
12*fce4895dSRene Gollent 	fTargetAddress(0),
13*fce4895dSRene Gollent 	fSize(0),
14*fce4895dSRene Gollent 	fType(INSTRUCTION_TYPE_OTHER),
15*fce4895dSRene Gollent 	fBreakpointAllowed(false),
16*fce4895dSRene Gollent 	fDisassembledLine()
17*fce4895dSRene Gollent {
18*fce4895dSRene Gollent }
19*fce4895dSRene Gollent 
20*fce4895dSRene Gollent 
InstructionInfo(target_addr_t address,target_addr_t targetAddress,target_size_t size,instruction_type type,bool breakpointAllowed,const BString & disassembledLine)21*fce4895dSRene Gollent InstructionInfo::InstructionInfo(target_addr_t address,
22*fce4895dSRene Gollent 	target_addr_t targetAddress, target_size_t size,
23*fce4895dSRene Gollent 	instruction_type type, bool breakpointAllowed,
24*fce4895dSRene Gollent 	const BString& disassembledLine)
25*fce4895dSRene Gollent 	:
26*fce4895dSRene Gollent 	fAddress(address),
27*fce4895dSRene Gollent 	fTargetAddress(targetAddress),
28*fce4895dSRene Gollent 	fSize(size),
29*fce4895dSRene Gollent 	fType(type),
30*fce4895dSRene Gollent 	fBreakpointAllowed(breakpointAllowed),
31*fce4895dSRene Gollent 	fDisassembledLine(disassembledLine)
32*fce4895dSRene Gollent {
33*fce4895dSRene Gollent }
34*fce4895dSRene Gollent 
35*fce4895dSRene Gollent 
36*fce4895dSRene Gollent bool
SetTo(target_addr_t address,target_addr_t targetAddress,target_size_t size,instruction_type type,bool breakpointAllowed,const BString & disassembledLine)37*fce4895dSRene Gollent InstructionInfo::SetTo(target_addr_t address, target_addr_t targetAddress,
38*fce4895dSRene Gollent 	target_size_t size, instruction_type type, bool breakpointAllowed,
39*fce4895dSRene Gollent 	const BString& disassembledLine)
40*fce4895dSRene Gollent {
41*fce4895dSRene Gollent 	fAddress = address;
42*fce4895dSRene Gollent 	fTargetAddress = targetAddress;
43*fce4895dSRene Gollent 	fSize = size;
44*fce4895dSRene Gollent 	fType = type;
45*fce4895dSRene Gollent 	fBreakpointAllowed = breakpointAllowed;
46*fce4895dSRene Gollent 	fDisassembledLine = disassembledLine;
47*fce4895dSRene Gollent 	return disassembledLine.Length() == 0 || fDisassembledLine.Length() > 0;
48*fce4895dSRene Gollent }
49