€•ˆXŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ'/translations/zh_CN/arch/powerpc/ptrace”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/zh_TW/arch/powerpc/ptrace”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/it_IT/arch/powerpc/ptrace”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ja_JP/arch/powerpc/ptrace”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ko_KR/arch/powerpc/ptrace”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/pt_BR/arch/powerpc/ptrace”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/sp_SP/arch/powerpc/ptrace”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒPtrace”h]”hŒPtrace”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒA/var/lib/git/docbuild/linux/Documentation/arch/powerpc/ptrace.rst”h´KubhŒ paragraph”“”)”}”(hŒQGDB intends to support the following hardware debug features of BookE processors:”h]”hŒQGDB intends to support the following hardware debug features of BookE processors:”…””}”(hhÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hŒŒ4 hardware breakpoints (IAC) 2 hardware watchpoints (read, write and read-write) (DAC) 2 value conditions for the hardware watchpoints (DVC)”h]”hŒŒ4 hardware breakpoints (IAC) 2 hardware watchpoints (read, write and read-write) (DAC) 2 value conditions for the hardware watchpoints (DVC)”…””}”(hhÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hX5For that, we need to extend ptrace so that GDB can query and set these resources. Since we're extending, we're trying to create an interface that's extendable and that covers both BookE and server processors, so that GDB doesn't need to special-case each of them. We added the following 3 new ptrace requests.”h]”hX=For that, we need to extend ptrace so that GDB can query and set these resources. Since we’re extending, we’re trying to create an interface that’s extendable and that covers both BookE and server processors, so that GDB doesn’t need to special-case each of them. We added the following 3 new ptrace requests.”…””}”(hhéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hh·h²hubh¶)”}”(hhh]”(h»)”}”(hŒ1. PPC_PTRACE_GETHWDBGINFO”h]”hŒ1. PPC_PTRACE_GETHWDBGINFO”…””}”(hhúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh÷h²hh³hÊh´KubhÌ)”}”(hXaQuery for GDB to discover the hardware debug features. The main info to be returned here is the minimum alignment for the hardware watchpoints. BookE processors don't have restrictions here, but server processors have an 8-byte alignment restriction for hardware watchpoints. We'd like to avoid adding special cases to GDB based on what it sees in AUXV.”h]”hXeQuery for GDB to discover the hardware debug features. The main info to be returned here is the minimum alignment for the hardware watchpoints. BookE processors don’t have restrictions here, but server processors have an 8-byte alignment restriction for hardware watchpoints. We’d like to avoid adding special cases to GDB based on what it sees in AUXV.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh÷h²hubhÌ)”}”(hX/Since we're at it, we added other useful info that the kernel can return to GDB: this query will return the number of hardware breakpoints, hardware watchpoints and whether it supports a range of addresses and a condition. The query will fill the following structure provided by the requesting process::”h]”hX0Since we’re at it, we added other useful info that the kernel can return to GDB: this query will return the number of hardware breakpoints, hardware watchpoints and whether it supports a range of addresses and a condition. The query will fill the following structure provided by the requesting process:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh÷h²hubhŒ literal_block”“”)”}”(hX0struct ppc_debug_info { unit32_t version; unit32_t num_instruction_bps; unit32_t num_data_bps; unit32_t num_condition_regs; unit32_t data_bp_alignment; unit32_t sizeof_condition; /* size of the DVC register */ uint64_t features; /* bitmask of the individual flags */ };”h]”hX0struct ppc_debug_info { unit32_t version; unit32_t num_instruction_bps; unit32_t num_data_bps; unit32_t num_condition_regs; unit32_t data_bp_alignment; unit32_t sizeof_condition; /* size of the DVC register */ uint64_t features; /* bitmask of the individual flags */ };”…””}”hj&sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1j$h³hÊh´K hh÷h²hubhÌ)”}”(hŒAfeatures will have bits indicating whether there is support for::”h]”hŒ@features will have bits indicating whether there is support for:”…””}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K*hh÷h²hubj%)”}”(hX]#define PPC_DEBUG_FEATURE_INSN_BP_RANGE 0x1 #define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x2 #define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x4 #define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x8 #define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x10 #define PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 0x20”h]”hX]#define PPC_DEBUG_FEATURE_INSN_BP_RANGE 0x1 #define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x2 #define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x4 #define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x8 #define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x10 #define PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 0x20”…””}”hjDsbah}”(h]”h ]”h"]”h$]”h&]”j4j5uh1j$h³hÊh´K,hh÷h²hubhŒenumerated_list”“”)”}”(hhh]”hŒ list_item”“”)”}”(hŒPPC_PTRACE_SETHWDEBUG ”h]”hÌ)”}”(hŒPPC_PTRACE_SETHWDEBUG”h]”hŒPPC_PTRACE_SETHWDEBUG”…””}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K3hjYubah}”(h]”h ]”h"]”h$]”h&]”uh1jWhjTh²hh³hÊh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ.”Œstart”Kuh1jRhh÷h²hh³hÊh´K3ubhÌ)”}”(hŒOSets a hardware breakpoint or watchpoint, according to the provided structure::”h]”hŒNSets a hardware breakpoint or watchpoint, according to the provided structure:”…””}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K5hh÷h²hubj%)”}”(hXy struct ppc_hw_breakpoint { uint32_t version; #define PPC_BREAKPOINT_TRIGGER_EXECUTE 0x1 #define PPC_BREAKPOINT_TRIGGER_READ 0x2 #define PPC_BREAKPOINT_TRIGGER_WRITE 0x4 uint32_t trigger_type; /* only some combinations allowed */ #define PPC_BREAKPOINT_MODE_EXACT 0x0 #define PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE 0x1 #define PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE 0x2 #define PPC_BREAKPOINT_MODE_MASK 0x3 uint32_t addr_mode; /* address match mode */ #define PPC_BREAKPOINT_CONDITION_MODE 0x3 #define PPC_BREAKPOINT_CONDITION_NONE 0x0 #define PPC_BREAKPOINT_CONDITION_AND 0x1 #define PPC_BREAKPOINT_CONDITION_EXACT 0x1 /* different name for the same thing as above */ #define PPC_BREAKPOINT_CONDITION_OR 0x2 #define PPC_BREAKPOINT_CONDITION_AND_OR 0x3 #define PPC_BREAKPOINT_CONDITION_BE_ALL 0x00ff0000 /* byte enable bits */ #define PPC_BREAKPOINT_CONDITION_BE(n) (1<<((n)+16)) uint32_t condition_mode; /* break/watchpoint condition flags */ uint64_t addr; uint64_t addr2; uint64_t condition_value; };”h]”hXy struct ppc_hw_breakpoint { uint32_t version; #define PPC_BREAKPOINT_TRIGGER_EXECUTE 0x1 #define PPC_BREAKPOINT_TRIGGER_READ 0x2 #define PPC_BREAKPOINT_TRIGGER_WRITE 0x4 uint32_t trigger_type; /* only some combinations allowed */ #define PPC_BREAKPOINT_MODE_EXACT 0x0 #define PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE 0x1 #define PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE 0x2 #define PPC_BREAKPOINT_MODE_MASK 0x3 uint32_t addr_mode; /* address match mode */ #define PPC_BREAKPOINT_CONDITION_MODE 0x3 #define PPC_BREAKPOINT_CONDITION_NONE 0x0 #define PPC_BREAKPOINT_CONDITION_AND 0x1 #define PPC_BREAKPOINT_CONDITION_EXACT 0x1 /* different name for the same thing as above */ #define PPC_BREAKPOINT_CONDITION_OR 0x2 #define PPC_BREAKPOINT_CONDITION_AND_OR 0x3 #define PPC_BREAKPOINT_CONDITION_BE_ALL 0x00ff0000 /* byte enable bits */ #define PPC_BREAKPOINT_CONDITION_BE(n) (1<<((n)+16)) uint32_t condition_mode; /* break/watchpoint condition flags */ uint64_t addr; uint64_t addr2; uint64_t condition_value; };”…””}”hj‹sbah}”(h]”h ]”h"]”h$]”h&]”j4j5uh1j$h³hÊh´K7hh÷h²hubhÌ)”}”(hŒÎA request specifies one event, not necessarily just one register to be set. For instance, if the request is for a watchpoint with a condition, both the DAC and DVC registers will be set in the same request.”h]”hŒÎA request specifies one event, not necessarily just one register to be set. For instance, if the request is for a watchpoint with a condition, both the DAC and DVC registers will be set in the same request.”…””}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KRhh÷h²hubhÌ)”}”(hŒÙWith this GDB can ask for all kinds of hardware breakpoints and watchpoints that the BookE supports. COMEFROM breakpoints available in server processors are not contemplated, but that is out of the scope of this work.”h]”hŒÙWith this GDB can ask for all kinds of hardware breakpoints and watchpoints that the BookE supports. COMEFROM breakpoints available in server processors are not contemplated, but that is out of the scope of this work.”…””}”(hj§h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KVhh÷h²hubhÌ)”}”(hX ptrace will return an integer (handle) uniquely identifying the breakpoint or watchpoint just created. This integer will be used in the PPC_PTRACE_DELHWDEBUG request to ask for its removal. Return -ENOSPC if the requested breakpoint can't be allocated on the registers.”h]”hXptrace will return an integer (handle) uniquely identifying the breakpoint or watchpoint just created. This integer will be used in the PPC_PTRACE_DELHWDEBUG request to ask for its removal. Return -ENOSPC if the requested breakpoint can’t be allocated on the registers.”…””}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KZhh÷h²hubhÌ)”}”(hŒ(Some examples of using the structure to:”h]”hŒ(Some examples of using the structure to:”…””}”(hjÃh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K_hh÷h²hubhŒ bullet_list”“”)”}”(hhh]”(jX)”}”(hX^set a breakpoint in the first breakpoint register:: p.version = PPC_DEBUG_CURRENT_VERSION; p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; p.addr = (uint64_t) address; p.addr2 = 0; p.condition_value = 0; ”h]”(hÌ)”}”(hŒ3set a breakpoint in the first breakpoint register::”h]”hŒ2set a breakpoint in the first breakpoint register:”…””}”(hjÚh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KahjÖubj%)”}”(hXp.version = PPC_DEBUG_CURRENT_VERSION; p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; p.addr = (uint64_t) address; p.addr2 = 0; p.condition_value = 0;”h]”hXp.version = PPC_DEBUG_CURRENT_VERSION; p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; p.addr = (uint64_t) address; p.addr2 = 0; p.condition_value = 0;”…””}”hjèsbah}”(h]”h ]”h"]”h$]”h&]”j4j5uh1j$h³hÊh´KchjÖubeh}”(h]”h ]”h"]”h$]”h&]”uh1jWhjÓh²hh³hÊh´NubjX)”}”(hXtset a watchpoint which triggers on reads in the second watchpoint register:: p.version = PPC_DEBUG_CURRENT_VERSION; p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; p.addr = (uint64_t) address; p.addr2 = 0; p.condition_value = 0; ”h]”(hÌ)”}”(hŒLset a watchpoint which triggers on reads in the second watchpoint register::”h]”hŒKset a watchpoint which triggers on reads in the second watchpoint register:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kkhjüubj%)”}”(hXp.version = PPC_DEBUG_CURRENT_VERSION; p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; p.addr = (uint64_t) address; p.addr2 = 0; p.condition_value = 0;”h]”hXp.version = PPC_DEBUG_CURRENT_VERSION; p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; p.addr = (uint64_t) address; p.addr2 = 0; p.condition_value = 0;”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”j4j5uh1j$h³hÊh´Kmhjüubeh}”(h]”h ]”h"]”h$]”h&]”uh1jWhjÓh²hh³hÊh´NubjX)”}”(hX˜set a watchpoint which triggers only with a specific value:: p.version = PPC_DEBUG_CURRENT_VERSION; p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; p.condition_mode = PPC_BREAKPOINT_CONDITION_AND | PPC_BREAKPOINT_CONDITION_BE_ALL; p.addr = (uint64_t) address; p.addr2 = 0; p.condition_value = (uint64_t) condition; ”h]”(hÌ)”}”(hŒEnumerated list start value not ordinal-1: “2†(ordinal 2)”…””}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhjbubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”hÊŒline”Kuh1j`hh÷h²hh³hÊh´K3ubja)”}”(hhh]”hÌ)”}”(hŒ:Enumerated list start value not ordinal-1: "3" (ordinal 3)”h]”hŒ>Enumerated list start value not ordinal-1: “3†(ordinal 3)”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËhj~ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j{Œsource”hÊŒline”Kuh1j`hh÷h²hh³hÊh´K™ubeŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.