Triggering method and device of task breakpoint, equipment and storage medium
By introducing a context matching mechanism into the processor system, and using program counter value and process context identifier for dual matching and judgment, the problem of false triggering of breakpoint triggers in multi-tasking environment is solved, more precise breakpoint control is achieved, and the reliability and adaptability of debugging tools are improved.
Patent Information
- Application Number
- CN202511604947.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-04
- Publication Date
- 2025-12-05
AI Technical Summary
In existing processor systems, breakpoint triggers cannot identify the target task in a multitasking environment, leading to false triggering.
By introducing a context matching mechanism into the breakpoint trigger, the program counter value and process context identifier of the task process are read to achieve dual matching and determination of instruction location and task identity, ensuring that the breakpoint behavior is triggered only in the target task process.
It improves the precision and accuracy of breakpoint triggering, reduces system performance interference and debugging chaos, and enhances the reliability and adaptability of debugging tools in multi-tasking environments.
Smart Images

Figure CN121070764A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of processors, and specifically relates to a method, apparatus, electronic device, and computer-readable storage medium for triggering task breakpoints. Background Technology
[0002] In modern processor systems, debugging mechanisms are a crucial component for ensuring software reliability and system stability. Especially in multi-tasking or multi-process scheduling environments, debugging tools typically rely on breakpoint mechanisms to intercept specific instructions or memory accesses, allowing developers to observe program behavior, locate errors, or perform performance analysis.
[0003] In existing technologies, processors typically implement breakpoint functionality through hardware triggers. These triggers generally include a register for storing the breakpoint address and a control register for configuring the triggering conditions. When the program counter (PC) matches the breakpoint address, the trigger determines that the triggering condition is met, thereby executing the breakpoint action.
[0004] However, in a multi-process environment, existing triggers cannot determine whether the current process is the target process for the breakpoint configuration. Therefore, if multiple processes share the same instruction address, the breakpoint may be triggered unintentionally in a non-target process. Summary of the Invention
[0005] This application aims to provide a method, apparatus, electronic device, and computer-readable storage medium for triggering task breakpoints, which at least solves the problem of existing breakpoint triggers being falsely triggered in non-target tasks.
[0006] In a first aspect, embodiments of this application disclose a method for triggering task breakpoints, including: In response to an executing task process, read the program counter and process context identifier of the task process; A first matching relationship is determined between the program count value and the breakpoint matching value stored in the first register, and a second matching relationship is determined between the process context identifier and the target process identifier stored in the second register; the program count value is the instruction address in the task process; the breakpoint matching value is used to characterize the instruction address responding to the breakpoint behavior; the process context identifier is used to characterize the process identity information of the task process; the target process identifier is used to characterize the process identity information of the task process responding to the breakpoint behavior. If both the first matching relationship and the second matching relationship are a match, a breakpoint action is triggered on the task process based on the program counter value.
[0007] Secondly, embodiments of this application also disclose a task breakpoint triggering device, comprising: The task response module is used to respond to the executing task process by reading the program counter value and process context identifier of the task process. The context matching module is used to determine a first matching relationship between the program count value and the breakpoint matching value stored in the first register, and to determine a second matching relationship between the process context identifier and the target process identifier stored in the second register; the program count value is the instruction address in the task process; the breakpoint matching value is used to characterize the instruction address responding to the breakpoint behavior; the process context identifier is used to characterize the process identity information of the task process; the target process identifier is used to characterize the process identity information of the task process responding to the breakpoint behavior; The first breakpoint execution module is used to trigger a breakpoint action on the task process based on the program counter value when both the first matching relationship and the second matching relationship are a match.
[0008] Thirdly, embodiments of this application also disclose an electronic device, including a processor and a memory, wherein the memory stores a program or instructions that can run on the processor, and the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0009] Fourthly, embodiments of this application also disclose a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the method described in the first aspect.
[0010] In summary, in this embodiment, by responding to the executing task process, the program count value and context identifier of the task are read, providing complete execution status information for subsequent matching and determination. This ensures that breakpoint determination has a dual-dimensional input basis, namely instruction location and task identity, thus laying the foundation for more refined trigger control. Furthermore, the first matching relationship determination between the program count value and the breakpoint matching value, and the second matching relationship determination between the process context identifier and the target process identifier are completed. This dual matching mechanism avoids the problem of cross-task false triggering caused by address matching alone, strictly limiting breakpoint triggering behavior to within the target task process. Finally, when both matching relationships are valid, the breakpoint action is triggered based on the program count value, thereby realizing the joint constraint of breakpoint behavior in both the address space and task context dimensions. This not only improves the accuracy of breakpoints and the controllability of debugging but also reduces system performance interference and debugging chaos caused by false triggering. Therefore, the method based on the embodiments of this application introduces a context matching mechanism in the breakpoint trigger, so that the breakpoint determination not only depends on the matching of the program counter value, but also further combines the context identifier of the current task process for judgment, thereby improving the pertinence and accuracy of breakpoint triggering, solving the problem that the breakpoint trigger cannot identify the task identity, improving the reliability and adaptability of the breakpoint mechanism in a multi-tasking environment, enhancing the expressive power of breakpoint configuration while maintaining the efficiency of the hardware trigger path, and improving the application effect of debugging tools in complex systems. Attached Figure Description
[0011] In the attached diagram: Figure 1 This is a flowchart of the steps of a task breakpoint triggering method provided in an embodiment of this application; Figure 2 This is a flowchart of another method for triggering task breakpoints provided in an embodiment of this application; Figure 3 This is a block diagram of a task breakpoint triggering device provided in an embodiment of this application; Figure 4 This is a block diagram of an electronic device provided in one embodiment of this application. Detailed Implementation
[0012] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0013] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0014] In existing technologies, breakpoint control mechanisms typically consist of a breakpoint action control register (tdada1), a breakpoint matching register (tdada2), and a breakpoint trigger module. This mechanism determines whether the current instruction address matches the breakpoint address stored in tdada2 and executes the breakpoint action based on the control instructions in tdada1 upon matching. However, in multi-tasking environments, this mechanism lacks the ability to identify task identities, and breakpoint behavior may be mistakenly triggered in non-target tasks, causing debugging to interfere with the normal execution of other tasks. This is especially problematic in secure isolation or multi-core parallel scenarios, where the accuracy and isolation of breakpoint control are difficult to guarantee. To address these issues, this solution adds a new register (tdada3) to the existing breakpoint mechanism to store the identity information of the target task process and designs a context matching control bit to control whether task identity matching logic is enabled. tdada3 supports a single task identifier or an OR table structure of multiple task identification codes, allowing for flexible configuration of the applicable task range for breakpoint behavior. Meanwhile, to complement the introduction of tdada3, this solution extends the structure of the breakpoint trigger, enabling it to compare the program counter value and the task context identifier simultaneously when determining the breakpoint trigger condition, ensuring that the breakpoint behavior only takes effect in the target task, or is triggered jointly in multiple specified tasks.
[0015] Based on this, such as Figure 1 The image shows a method for triggering task breakpoints provided in an embodiment of this application.
[0016] The method may include the following steps: Step 101: In response to the executing task process, read the program counter and process context identifier of the task process.
[0017] In some embodiments of this application, to enable breakpoint triggers to accurately determine the execution status of the current task process, it is necessary to obtain the program count and process context identifier of the task in a timely manner during task execution. Specifically, the processor responds to the executing task process by reading the program count and process context identifier of the task process. The program count is used to represent the address information of the instructions executed by the current task process, while the process context identifier is used to identify the identity information of the task process in the operating system scheduling, such as the process ID. In this way, the processor can obtain complete execution status input before breakpoint determination, thereby providing basic data support for subsequent address matching and context matching, and improving the targeting and control granularity of breakpoint triggering.
[0018] In a specific example, a processor is executing an image processing task, and the task process triggers the debugging mechanism during execution. The processor responds to the execution status of the task process, reading the current program counter (0x80400010) and the process context identifier (ASID=0x12). After completing this read process, the processor uses this data as input conditions for subsequent breakpoint matching, ensuring that the breakpoint trigger can perform a dual determination based on the current instruction location and the task identity. Ultimately, this breakpoint configuration only triggers when the image processing task executes to the specified instruction address and the context identifier matches, thus avoiding accidental breakpoint triggering in other tasks.
[0019] Step 102: Determine the first matching relationship between the program counter value and the breakpoint matching value stored in the first register, and determine the second matching relationship between the process context identifier and the target process identifier stored in the second register.
[0020] Among them, the program counter value is the instruction address in the task process; the breakpoint matching value is used to characterize the instruction address that responds to the breakpoint behavior; the process context identifier is used to characterize the process identity information of the task process; and the target process identifier is used to characterize the process identity information of the task process that responds to the breakpoint behavior.
[0021] In some embodiments of this application, to achieve accurate identification and control of task processes by breakpoint triggers, a dual matching determination of the instruction address and process identity information of the current task process is required. Specifically, the processor determines a first matching relationship between the program counter value and the breakpoint matching value stored in the first register, and a second matching relationship between the process context identifier and the target process identifier stored in the second register. The breakpoint matching value is used to characterize the instruction address responding to the breakpoint behavior and is the target address configured by the breakpoint trigger; the process context identifier is used to characterize the process identity information of the task process, such as the process ID (PID) or address space identifier (ASID); the target process identifier is used to characterize the process identity information of the task process responding to the breakpoint behavior and is the target identity configured by the breakpoint trigger. In this way, the breakpoint trigger can simultaneously determine whether the instruction location matches the task identity when a candidate event occurs, thereby improving the accuracy of breakpoint triggering and avoiding accidental triggering of breakpoints in non-target tasks.
[0022] In one specific example, a processor is debugging an image recognition task. The process count for this task is 0x80400010, and the process context identifier is ASID=0x12. The breakpoint trigger is configured with a breakpoint match value of 0x80400010, and the target process identifier is ASID=0x12. When the processor executes this task, it determines that the current process count matches the breakpoint match value, and the process context identifier matches the target process identifier; therefore, both matches are successful. Ultimately, the breakpoint trigger activates the breakpoint action based on the process count, which only takes effect within this image recognition task, preventing accidental breakpoint triggering in other task processes. In another specific example, the process count for the task is 0x80400010, and the process context identifier is ASID=0x12. The breakpoint trigger is configured with a breakpoint match value of 0x80400010, but the target process identifier is ASID=0x34. When the processor executes this task, it determines that the current program counter value matches the breakpoint match value, but the process context identifier does not match the target process identifier. Therefore, only the first match is successful, while the second match is unsuccessful. Ultimately, the breakpoint trigger does not activate, preventing breakpoint behavior from being executed in a non-target task process, thus maintaining task isolation and accuracy during debugging.
[0023] Step 103: If both the first and second matching relationships are matches, trigger a breakpoint action on the task process based on the program counter value.
[0024] In some embodiments of this application, to ensure that breakpoint behavior is executed only in task processes that meet preset conditions, the breakpoint action needs to be triggered based on the program counter value when both the first and second matching relationships are matched. In this case, the breakpoint action on the task process will be triggered based on the program counter value when both the first and second matching relationships are matched. Breakpoint actions typically include operations such as pausing task execution, entering debug mode, or recording execution status, to support debugging tools in analyzing program behavior. Ultimately, the breakpoint trigger can implement breakpoint behavior when both the instruction location and task identity meet expectations, thereby achieving precise debugging control of the target task in a multi-tasking environment and reducing system interference caused by accidental triggering.
[0025] In a specific example, a processor is executing an image recognition task. The process count for this task is 0x80400010, and the process context identifier is ASID=0x12. The breakpoint trigger is configured with a breakpoint match value of 0x80400010 and a target process identifier of ASID=0x12. The processor has determined that the current process count matches the breakpoint match value, and the process context identifier matches the target process identifier; therefore, both matches are successful. Subsequently, the processor triggers the breakpoint action based on the process count, pausing the execution of the image recognition task and passing the current state to the debugging tool for analysis, thereby achieving precise debugging of the task.
[0026] In summary, in this embodiment, by responding to the executing task process, the program count value and context identifier of the task are read, providing complete execution status information for subsequent matching and determination. This ensures that breakpoint determination has a dual-dimensional input basis, namely instruction location and task identity, thus laying the foundation for more refined trigger control. Furthermore, the first matching relationship determination between the program count value and the breakpoint matching value, and the second matching relationship determination between the process context identifier and the target process identifier are completed. This dual matching mechanism avoids the problem of cross-task false triggering caused by address matching alone, strictly limiting breakpoint triggering behavior to within the target task process. Finally, when both matching relationships are valid, the breakpoint action is triggered based on the program count value, thereby realizing the joint constraint of breakpoint behavior in both the address space and task context dimensions. This not only improves the accuracy of breakpoints and the controllability of debugging but also reduces system performance interference and debugging chaos caused by false triggering. Therefore, the method based on the embodiments of this application introduces a context matching mechanism in the breakpoint trigger, so that the breakpoint determination not only depends on the matching of the program counter value, but also further combines the context identifier of the current task process for judgment, thereby improving the pertinence and accuracy of breakpoint triggering, solving the problem that the breakpoint trigger cannot identify the task identity, improving the reliability and adaptability of the breakpoint mechanism in a multi-tasking environment, enhancing the expressive power of breakpoint configuration while maintaining the efficiency of the hardware trigger path, and improving the application effect of debugging tools in complex systems.
[0027] Figure 2 This is another method for triggering task breakpoints provided in the embodiments of this application.
[0028] The method may include the following steps: Step 201: In response to the first configuration operation, determine the first configuration target of the first configuration operation.
[0029] In some embodiments of this application, to achieve controllable behavior of breakpoint triggers, it is necessary to identify the target content of the configuration operation during the configuration phase so that corresponding breakpoint parameter settings can be executed according to the target. Specifically, the processor will respond to the first configuration operation and determine the first configuration target of the first configuration operation. The first configuration operation is usually initiated by debugging tools or the operating system and is used to set the behavioral parameters of the breakpoint trigger, such as whether to enable the context matching mechanism. The first configuration target refers to the function item or control field targeted by the configuration operation, such as the context matching control bit or the breakpoint address register. In this way, the system can clearly understand the intent of the configuration operation, thereby providing a basis for subsequent register writing or control bit setting, ensuring that the configuration behavior of the breakpoint trigger is targeted and consistent.
[0030] In a specific example, the debugging tool initiates a breakpoint configuration operation, intending to enable context matching for the breakpoint trigger. The processor responds to this configuration operation, identifying the configuration target as the "context matching control bit." Subsequently, based on this identification result, the system sets the control bit to an enabled or disabled state in subsequent steps, thereby enabling the breakpoint trigger to perform matching determination based on task identity. Ultimately, this configuration process ensures that breakpoint behavior only takes effect within the target task process, improving debugging accuracy and isolation.
[0031] Step 202: If the first configuration goal is to enable the determination behavior for the second matching relationship, set the value in the context matching control bit to the first logical value.
[0032] The context matching control bit is used to enable or disable the determination behavior of the second matching relationship.
[0033] In some embodiments of this application, to enable breakpoint triggers to perform matching decisions based on task identity, it is necessary to enable the logic for judging process identity matching relationships during the configuration phase. Specifically, when the first configuration goal is to enable the determination behavior of the second matching relationship, the value in the context matching control bit needs to be set to a first logical value. The context matching control bit is used to control whether to enable the judgment behavior of the matching relationship between the process context identifier and the target process identifier. When the control bit is set to the first logical value (e.g., "1"), it indicates that the breakpoint trigger will consider the identity information of the task process when triggering the judgment. In this way, the breakpoint configuration process can explicitly activate the context matching function, thereby enabling the breakpoint behavior to have task-level limitation capabilities, improving the accuracy and isolation of breakpoint triggering.
[0034] In a specific example, the debugging tool initiates a breakpoint configuration operation on a processor, intending to restrict the breakpoint behavior to the image recognition task process. The processor recognizes that the goal of this configuration operation is to enable context matching, and subsequently sets the context matching control bit in the breakpoint trigger to the first logical value "1". This setting causes the breakpoint trigger to not only check if the instruction address matches, but also whether the identity of the current task process is consistent with the target configuration during subsequent judgments. Ultimately, this breakpoint configuration ensures that the breakpoint only takes effect in the image recognition task, avoiding the possibility of accidentally triggering the breakpoint in other task processes.
[0035] Step 203: If the configuration goal of the first configuration operation is to disable the determination behavior of the second matching relationship, set the value in the context matching control bit to the second logical value.
[0036] In some embodiments of this application, to support breakpoint triggers in flexibly switching matching strategies under different debugging needs, it is necessary to allow disabling the matching judgment logic for process identity during the configuration phase. Specifically, when the configuration goal of the first configuration operation is to disable the determination behavior of the second matching relationship, the value in the context matching control bit can be set to the second logical value. When this control bit is set to the second logical value (e.g., "0"), it indicates that the breakpoint trigger will no longer consider the identity information of the task process when triggering the judgment, and will only perform matching judgment based on the program counter value. In this way, the system can disable the context matching function according to the needs of debugging configuration, thereby simplifying the breakpoint judgment logic and being suitable for debugging scenarios where it is not necessary to distinguish the task identity.
[0037] In a specific example, a debugging tool initiates a breakpoint configuration operation on a processor, intending to set a universal breakpoint to monitor the execution of a critical instruction across all task processes. The processor recognizes that the configuration operation aims to disable context matching and subsequently sets the context matching control bit in the breakpoint trigger to the second logical value "0". This setting causes the breakpoint trigger to only check if the program counter matches the breakpoint matching value during subsequent checks, without further determining the task process's identity. Ultimately, this breakpoint configuration can be triggered in all tasks, suitable for unified debugging needs across tasks.
[0038] Step 204: Configure a corresponding task process identification code for each task process to be executed.
[0039] In some embodiments of this application, in order for breakpoint triggers to identify and distinguish different task processes in a multi-tasking environment, it is necessary to configure a one-to-one corresponding task process identification code for each task process to be executed. Specifically, this can be achieved by configuring a one-to-one corresponding task process identification code for each task process to be executed. The task process identification code is used to characterize the process identity information of the task process and is usually assigned by the operating system when the task is created or scheduled, such as PID, ASID, or security context identifier. In this way, the system can accurately identify the identity of the current task process during breakpoint determination, providing basic data for subsequent context matching, thereby realizing task-level limitation of breakpoint behavior.
[0040] In a specific example, the operating system is scheduling three tasks to be executed: an image recognition task, an audio processing task, and a data encryption task. The system assigns process identification codes to these three tasks: ASID=0x12, ASID=0x34, and ASID=0x56, respectively. Each identification code is written into the context information structure of the corresponding task and synchronized to the processor's context register during task switching. Ultimately, when executing breakpoint checks, the breakpoint trigger can determine the task's identity based on the identification code in the current context register, thus ensuring that the breakpoint action is triggered only in the target task and avoiding cross-task misjudgment.
[0041] Step 205: In response to the second configuration operation, determine the target task process from all pending task processes.
[0042] In some embodiments of this application, to achieve limited triggering of breakpoint behavior within a specific task process, it is necessary to identify the target task process from all pending task processes during the configuration phase, so that breakpoint parameters and matching conditions can be configured subsequently. Specifically, in response to a second configuration operation, the target task process is determined from all pending task processes. The second configuration operation is typically initiated by a debugging tool or the operating system to specify the task object targeted by the breakpoint behavior. The target task process refers to the task process explicitly selected in the breakpoint trigger configuration, and its identity information will be written into the register of the breakpoint trigger in subsequent steps. In this way, the system can establish a binding relationship between breakpoint behavior and a specific task, providing a clear target benchmark for subsequent context matching, thereby improving the targeting of breakpoint triggering.
[0043] In a specific example, the debugging tool is configuring breakpoints to monitor the execution of critical instructions in the image recognition module. The system currently has three pending tasks: image recognition, audio processing, and data encryption. The debugging tool specifies the image recognition task as the breakpoint target task via a second configuration operation. The processor responds to this configuration operation, identifies the image recognition task process from the list of all tasks, and uses it as the target for subsequent breakpoint configuration. Ultimately, this breakpoint configuration only takes effect during the execution of the image recognition task, preventing accidental triggering of breakpoints in other tasks.
[0044] Step 206: Write the target task process identification code corresponding to the target task process into the second register.
[0045] In some embodiments of this application, in order for the breakpoint trigger to identify the identity of the target task process at runtime, it is necessary to write the identification code of the task process into the register of the breakpoint trigger for subsequent matching and judgment. Specifically, this can be achieved by writing the target task process identification code corresponding to the target task process into a second register. The second register is a dedicated register in the breakpoint trigger used to store the target task identity information, and its contents will be compared with the context identifier of the current task during breakpoint determination. By performing this step, the breakpoint trigger obtains a clear target identity benchmark, thereby enabling task-level breakpoint control based on context matching during subsequent execution.
[0046] In a specific example, the debugging tool has identified the image recognition task as the target process for breakpoint behavior and assigned it an identifier of ASID=0x12. The processor then writes this identifier to the second register of the breakpoint trigger for subsequent context matching. During task execution, when the processor detects that the current task's context identifier is ASID=0x12 and the program counter matches the breakpoint match value, it triggers the breakpoint action. Ultimately, this configuration ensures that breakpoint behavior only takes effect in the image recognition task, improving the specificity of breakpoint triggering and the accuracy of debugging.
[0047] Optionally, if there are multiple target task processes, step 206 includes the following sub-steps: Sub-step 2061 generates an OR table containing all target task process identifiers.
[0048] In some embodiments of this application, to enable breakpoint triggers to support matching and determining multiple target task processes, it is necessary to uniformly organize the identification codes of all target task processes so that they can be subsequently written into registers and participate in breakpoint determination logic. This can be achieved by generating an OR table containing all target task process identification codes. An OR table is a structure used to represent multiple matching items, containing multiple task process identification codes, each representing the process identity information of a target task process. The table can be generated using a linear list, bitmap structure, or index mapping, depending on the processor architecture's support for register fields. In this way, the system can establish a matching set containing multiple target identities, providing a data foundation for subsequent multi-value context matching of breakpoint triggers, thereby expanding the adaptability of breakpoint behavior and supporting joint debugging across multiple tasks.
[0049] In a specific example, the debugging tool needs to set breakpoints simultaneously in image recognition, audio processing, and data encryption tasks. The system identifies the process IDs for these three tasks as ASID=0x12, ASID=0x34, and ASID=0x56, respectively. Based on configuration requirements, the processor organizes these three IDs into an OR table, represented as {0x12, 0x34, 0x56} using a linear list structure. This table is subsequently used for register write operations and participates in context matching as the target identity set during breakpoint determination. Ultimately, the breakpoint trigger can activate the breakpoint action in any matching task, achieving joint debugging control in a multi-task environment.
[0050] Sub-step 2062: Write the OR table into the second register.
[0051] In some embodiments of this application, in order for the breakpoint trigger to perform matching judgments based on the identities of multiple target task processes at runtime, it is necessary to write an OR table containing the identification codes of all target task processes into the second register of the breakpoint trigger. Specifically, the entire OR table can be written into the second register. After writing to this table, the breakpoint trigger can trigger the breakpoint action if any identification code matches. In this way, the system completes the configuration of multi-value context matching, enabling the breakpoint trigger to have the ability to be triggered jointly in multiple task processes, improving the adaptability of the debugging mechanism in complex task environments.
[0052] In a specific example, the debugging tool has generated an OR table containing image recognition, audio processing, and data encryption tasks, with corresponding process IDs ASID=0x12, ASID=0x34, and ASID=0x56, respectively. The processor writes this OR table into the second register of the breakpoint trigger, storing it in a linear list structure as {0x12, 0x34, 0x56}. During task execution, the breakpoint trigger compares the current task's context identifier with any of the IDs in this register. If a match is found and the instruction address also meets the breakpoint condition, the breakpoint action is triggered. Ultimately, this configuration allows breakpoint behavior to take effect across multiple specified tasks, supporting cross-task joint debugging needs.
[0053] Step 207: In response to the executing task process, read the program counter and process context identifier of the task process.
[0054] The method shown in this step has been explained in step 101 and will not be repeated here.
[0055] Step 208: When the value in the context matching control bit of the breakpoint trigger is set to the first logical value, determine the first matching relationship between the program count value and the breakpoint matching value stored in the first register, and determine the second matching relationship between the process context identifier and the target process identifier stored in the second register.
[0056] Among them, the program counter value is the instruction address in the task process; the breakpoint matching value is used to characterize the instruction address that responds to the breakpoint behavior; the process context identifier is used to characterize the process identity information of the task process; and the target process identifier is used to characterize the process identity information of the task process that responds to the breakpoint behavior.
[0057] In some embodiments of this application, to ensure that breakpoint behavior only applies to the target task process at runtime, it is necessary to simultaneously determine whether the instruction address and process identity of the current task meet preset conditions, provided that the context matching function is enabled in the breakpoint trigger. Specifically, when the value in the context matching control bit of the breakpoint trigger is set to a first logical value, the processor determines a first matching relationship between the program counter value and the breakpoint matching value stored in the first register, and determines a second matching relationship between the process context identifier and the target process identifier stored in the second register. In this way, the breakpoint trigger can perform breakpoint determination based on the dual matching relationship when the context matching control bit is enabled, thereby improving the accuracy and isolation of breakpoint behavior and avoiding accidental triggering in non-target tasks.
[0058] In a specific example, the processor is executing an image recognition task. The process count for this task is 0x80400010, and the process context identifier is ASID=0x12. The breakpoint trigger is configured with a breakpoint match value of 0x80400010, a target process identifier of ASID=0x12, and the context match control bit is set to the first logical value "1". When the processor executes this task, it determines that the current process count matches the breakpoint match value, and the process context identifier matches the target process identifier. Therefore, both the first and second match relationships are successful. Ultimately, the breakpoint trigger activates the breakpoint action based on this determination, which only takes effect in the image recognition task, preventing accidental triggering in other task processes.
[0059] Optionally, in order to determine the first matching relationship between the program counter value and the breakpoint matching value stored in the first register, step 208 includes the following sub-steps: Sub-step 2081: If the program count value matches the breakpoint matching value, the first matching relationship is determined as a match.
[0060] In some embodiments of this application, to determine whether the instruction position of the current task process meets the breakpoint triggering conditions, it is necessary to perform a consistency judgment on the relationship between the program counter value and the breakpoint matching value. Specifically, if the program counter value and the breakpoint matching value are consistent, the first matching relationship can be determined as a match. The program counter value is the instruction address in the task process, used to identify the currently executing instruction position; the breakpoint matching value is used to characterize the target instruction address that responds to the breakpoint behavior, and is a breakpoint address pre-configured by the debugging tool or system. In this way, the system can confirm that the current instruction position has met one of the breakpoint triggering conditions, providing an address-dimensional basis for the execution of subsequent breakpoint actions.
[0061] In a specific example, the processor is executing an image recognition task, and the process count for this task is 0x80400010. The breakpoint trigger is configured with a breakpoint match value of 0x80400010. During execution, the processor detects that the current process count matches the breakpoint match value, and therefore determines the first match as a successful match. Ultimately, this determination result is recorded as one of the prerequisites for breakpoint triggering, providing a basis for subsequent joint matching based on task identity information.
[0062] Sub-step 2082: If the program count value and the breakpoint matching value are inconsistent, the first matching relationship is determined to be a mismatch.
[0063] In some embodiments of this application, to avoid erroneous breakpoint triggering when the instruction address does not meet the breakpoint condition, it is necessary to explicitly determine that the address matching relationship is invalid when the program count value and the breakpoint matching value are inconsistent. Specifically, when the program count value and the breakpoint matching value are inconsistent, the first matching relationship will be determined as a mismatch. In this way, the system can exclude breakpoint triggering conditions when the addresses are inconsistent, thereby avoiding the execution of breakpoint actions at non-target instruction locations and improving the accuracy and stability of the breakpoint mechanism.
[0064] In a specific example, the processor is executing an audio processing task with a program counter of 0x80400020, while the breakpoint trigger is configured with a breakpoint match value of 0x80400010. During execution, the processor detects a mismatch between the current program counter and the breakpoint match value, thus determining the first match as a mismatch. Ultimately, this determination prevents the breakpoint action from being triggered, ensuring that the breakpoint behavior does not execute at an unexpected instruction location, maintaining the accuracy of the debugging process and task isolation.
[0065] Optionally, in order to determine a second matching relationship between the process context identifier and the target process identifier stored in the second register, step 208 includes the following sub-steps: Sub-step 2083: If the process context identifier matches the target process identifier, the second matching relationship is determined as a match.
[0066] In some embodiments of this application, in order to determine whether the identity of the current task process meets the target configuration of the breakpoint trigger, it is necessary to perform a consistency judgment on the relationship between the process context identifier and the target process identifier. Specifically, if the process context identifier and the target process identifier are consistent, the second matching relationship can be determined as a match. In this way, the system can confirm that the identity of the current task process meets the configuration requirements of the breakpoint trigger, thereby satisfying the breakpoint triggering condition at the identity level and providing a contextual basis for the execution of subsequent breakpoint actions.
[0067] In a specific example, the processor is executing an image recognition task with a process context identifier of ASID=0x12. The second register of the breakpoint trigger is configured with the target process identifier of ASID=0x12. During execution, the processor detects that the current task's context identifier matches the target identifier, thus determining a match. Ultimately, this determination is recorded as one of the prerequisites for breakpoint triggering, providing support for subsequent joint matching based on instruction address information.
[0068] Sub-step 2084: If the process context identifier and the target process identifier are inconsistent, the second matching relationship is determined to be a mismatch.
[0069] In some embodiments of this application, to avoid accidental triggering of breakpoints in non-target task processes, it is necessary to explicitly determine that the context matching relationship is invalid when the task identity information does not meet the breakpoint configuration requirements. Specifically, if the process context identifier and the target process identifier are inconsistent, the second matching relationship is determined to be mismatched. In this way, the system can exclude breakpoint triggering conditions when the task identities are inconsistent, thereby ensuring that breakpoint behavior only takes effect in the target task process, improving the isolation and accuracy of the debugging process.
[0070] In a specific example, the processor is executing an audio processing task with a context identifier of ASID=0x34, while the target process identifier configured in the second register of the breakpoint trigger is ASID=0x12. During execution, the processor detects that the context identifier of the current task is inconsistent with the target identifier, and therefore determines the second matching relationship as a mismatch. Ultimately, this determination prevents the breakpoint action from being triggered, ensuring that the breakpoint behavior will not be executed in a non-target task, thus avoiding interference and misjudgments during debugging.
[0071] Step 209: If both the first and second matching relationships are matches, trigger a breakpoint action on the task process based on the program counter value.
[0072] The method shown in this step has been explained in step 103 and will not be repeated here.
[0073] Optionally, in order to trigger a breakpoint action on the task process based on the program counter value, step 209 includes the following sub-steps: Sub-step 2091: Obtain the control instruction set for controlling and / or configuring breakpoint actions from the third register.
[0074] In some embodiments of this application, to ensure the configurability and control logic of the breakpoint action execution process, it is necessary to obtain a set of instructions for controlling and / or configuring breakpoint behavior before the breakpoint is triggered. Specifically, the control instruction set for controlling and / or configuring breakpoint actions will be obtained from a third register. The control instruction set is a set of instructions pre-written by the debugging tool or system to define the execution mode of the breakpoint action, such as whether to pause the task, whether to record the status, and whether to jump to a specific address. The third register is a register in the breakpoint trigger specifically used to store this type of control information, and its contents are read when the breakpoint is triggered and used to guide subsequent behavior. In this way, the system can obtain complete control parameters before the breakpoint is triggered, thereby realizing the programmability and flexibility of breakpoint behavior and adapting to breakpoint configuration strategies under different debugging needs.
[0075] In a specific example, the debugging tool is configuring breakpoint behavior to record the current register state and jump to the debugging routine when triggered in an image recognition task. The system writes a set of control instructions, including "state saving" and "feedback character at address 0x90000000," into the third register of the breakpoint trigger. During task execution, when the breakpoint trigger condition is met, the processor reads this set of control instructions from the third register, providing operation instructions for the subsequent execution of breakpoint actions. Ultimately, this reading process ensures that the breakpoint behavior is executed according to the preset logic, achieving controllable and structured management of debugging behavior.
[0076] Sub-step 2092 completes the configuration behavior for the breakpoint action and the jump behavior to the instruction address represented by the program counter value according to the instructions in the control instruction set, so as to trigger the breakpoint action.
[0077] In some embodiments of this application, in order for the breakpoint trigger to execute a preset debugging operation after the triggering condition is met, it is necessary to configure the breakpoint action according to the contents of the control instruction set and jump to a specified instruction address to start the breakpoint behavior. Specifically, the configuration behavior of the breakpoint action and the jump behavior to the instruction address represented by the program counter value are completed according to the instructions in the control instruction set to trigger the breakpoint action. The control instruction set is a set of instructions pre-written into a third register by the debugging tool or system to define the execution mode of the breakpoint action, such as pausing the task, saving the register state, calling the debugging routine, or jumping to a specific address. The program counter value is the instruction address in the task process, used to identify the current execution position or the breakpoint target position. In this way, the system can complete the initialization and jump process of the breakpoint behavior according to the preset instructions, thereby starting the debugging process after the triggering condition is met, realizing the controllability and functional expansion of the breakpoint mechanism.
[0078] In a specific example, the debugging tool has written a control instruction set into the third register, containing three instructions: "save current register state," "output the character at address 0x90000000," and "call the debug routine." When the processor detects that the breakpoint trigger condition is met, it reads this control instruction set and executes the relevant configuration actions sequentially, including writing the current register contents to the debug buffer and outputting the character (error code) at address 0x90000000. Finally, the processor enters the debug routine and begins executing the breakpoint action, achieving debug control of critical instructions in the image recognition task.
[0079] Optionally, corresponding to sub-step 2061 or sub-step 2062 above, the target process identifier stored in the second register is stored in an OR table containing target task process identification codes that correspond one-to-one with multiple target task processes. Then, step 209 is implemented through the following process: Sub-step 2093: If the table contains any target task process identifier that matches the process context identifier, trigger a breakpoint action on the task process based on the program counter value.
[0080] In some embodiments of this application, to support breakpoint triggers in performing identity matching and determination based on multiple target task processes in a multi-task environment, it is necessary to determine whether the identity of the current task process is included in a preset target set when the breakpoint triggering condition is met. Specifically, if any target task process identifier matching the process context identifier is included in the OR table, a breakpoint action on the task process can be triggered based on the program count value. In this way, the breakpoint trigger can determine whether to trigger a breakpoint based on the program count value, provided that the current task identity matches any identifier in the OR table. This enables the joint application of breakpoint behavior in multiple target tasks, improving the flexibility and adaptability of the debugging mechanism.
[0081] In a specific example, the debugging tool configures breakpoint behavior to apply simultaneously to image recognition, audio processing, and data encryption tasks, and writes their corresponding process IDs ASID=0x12, ASID=0x34, and ASID=0x56 into the second register of the breakpoint trigger, forming an OR table {0x12, 0x34, 0x56}. When the processor executes the audio processing task, it detects that the current task's context identifier is ASID=0x34, and the program counter matches the breakpoint value. Since ASID=0x34 is included in the OR table, the breakpoint trigger determines that the match is valid and triggers the breakpoint action based on the program counter value. Ultimately, this breakpoint behavior is activated in the audio processing task and also has the ability to be triggered in other target tasks, realizing shared breakpoint control in multi-task debugging scenarios.
[0082] Optionally, in order to trigger a breakpoint action on the task process based on the program counter value, sub-step 2093 includes the following sub-steps: Sub-step 20931: Obtain the control instruction set for controlling and / or configuring breakpoint actions from the third register.
[0083] The method shown in this step has been explained in sub-step 2091 and will not be repeated here.
[0084] Sub-step 20932 completes the configuration behavior for the breakpoint action and the jump behavior to the instruction address represented by the program counter value according to the instructions in the control instruction set, so as to trigger the breakpoint action.
[0085] The method shown in this step has been explained in sub-step 2092 and will not be repeated here.
[0086] Step 210: When the value in the context match control bit of the breakpoint trigger is set to the second logic value, determine the first match relationship between the program counter value and the breakpoint match value stored in the first register.
[0087] In some embodiments of this application, to support breakpoint triggers in determining breakpoints based on instruction location even when context matching is disabled, address matching is performed only when the context matching control bit is set to the second logical value. Specifically, when the value in the context matching control bit of the breakpoint trigger is set to the second logical value, a first matching relationship is determined between the program counter value and the breakpoint matching value stored in the first register. Thus, the breakpoint trigger can determine breakpoints solely based on instruction addresses without considering task identity, making it suitable for general debugging scenarios where task context does not need to be distinguished.
[0088] In a specific example, the processor is executing a data acquisition task, and the process count for this task is 0x80400010. The breakpoint trigger is configured with a breakpoint match value of 0x80400010, and the context match control bit is set to the second logical value "0". When the processor executes this task, it only checks if the current process count matches the breakpoint match value; therefore, the first match is successful. Since context match is disabled, the breakpoint trigger no longer checks the task identity and directly triggers the breakpoint action based on the address match result. Ultimately, this breakpoint behavior is effective across all tasks, suitable for unified debugging needs across tasks.
[0089] Optionally, in order to determine the first matching relationship between the program counter value and the breakpoint matching value stored in the first register, step 210 includes the following sub-steps: Sub-step 2101: If the program count value and the breakpoint matching value are consistent, the first matching relationship is determined as a match.
[0090] The method shown in this step has been explained in sub-step 2081 and will not be repeated here.
[0091] Sub-step 2102: If the program count value and the breakpoint matching value are inconsistent, the first matching relationship is determined to be a mismatch.
[0092] The method shown in this step has been explained in sub-step 2082 and will not be repeated here.
[0093] Step 211: When the value in the context matching control bit of the breakpoint trigger is set to the second logical value and the first matching relationship is a match, trigger the breakpoint action on the task process according to the program counter value.
[0094] In some embodiments of this application, in order to trigger breakpoint behavior even when context matching is disabled, breakpoint actions need to be executed only when instruction address matching is satisfied. Specifically, this is achieved by setting the value in the context matching control bit of the breakpoint trigger to the second logical value and ensuring a match in the first matching relationship, triggering a breakpoint action on the task process based on the program counter value. Thus, the system can implement breakpoint behavior in debugging scenarios without context constraints, making it suitable for cross-task unified monitoring or rapid debugging needs.
[0095] In a specific example, the processor is executing a data acquisition task, and the program counter for this task process is 0x80400010. The breakpoint trigger is configured with a breakpoint match value of 0x80400010, and the context match control bit is set to the second logical value "0". The processor determines that the current program counter value matches the breakpoint match value, therefore the first match is successful. Since the context match function has been disabled, the breakpoint trigger no longer determines the task identity and directly triggers the breakpoint action based on the address match result. Ultimately, this breakpoint behavior is triggered in the data acquisition task, and it also has the potential to be triggered in other task processes, making it suitable for debugging scenarios where critical instructions need to be monitored uniformly.
[0096] Optionally, in order to trigger a breakpoint action on the task process based on the program counter value, step 211 includes the following sub-steps: Sub-step 2111: Obtain the control instruction set for controlling and / or configuring breakpoint actions from the third register.
[0097] The method shown in this step has been explained in sub-step 2091 and will not be repeated here.
[0098] Sub-step 2112 completes the configuration behavior for the breakpoint action and the jump behavior to the instruction address represented by the program counter value according to the instructions in the control instruction set, so as to trigger the breakpoint action.
[0099] The method shown in this step has been explained in sub-step 2092 and will not be repeated here.
[0100] In summary, in this embodiment, by responding to the executing task process, the program count value and context identifier of the task are read, providing complete execution status information for subsequent matching and determination. This ensures that breakpoint determination has a dual-dimensional input basis, namely instruction location and task identity, thus laying the foundation for more refined trigger control. Furthermore, the first matching relationship determination between the program count value and the breakpoint matching value, and the second matching relationship determination between the process context identifier and the target process identifier are completed. This dual matching mechanism avoids the problem of cross-task false triggering caused by address matching alone, strictly limiting breakpoint triggering behavior to within the target task process. Finally, when both matching relationships are valid, the breakpoint action is triggered based on the program count value, thereby realizing the joint constraint of breakpoint behavior in both the address space and task context dimensions. This not only improves the accuracy of breakpoints and the controllability of debugging but also reduces system performance interference and debugging chaos caused by false triggering. Therefore, the method based on the embodiments of this application introduces a context matching mechanism in the breakpoint trigger, so that the breakpoint determination not only depends on the matching of the program counter value, but also further combines the context identifier of the current task process for judgment, thereby improving the pertinence and accuracy of breakpoint triggering, solving the problem that the breakpoint trigger cannot identify the task identity, improving the reliability and adaptability of the breakpoint mechanism in a multi-tasking environment, enhancing the expressive power of breakpoint configuration while maintaining the efficiency of the hardware trigger path, and improving the application effect of debugging tools in complex systems.
[0101] refer to Figure 3 It illustrates a task breakpoint triggering device 30 provided in an embodiment of this application, comprising: The task response module 301 is used to respond to the executing task process by reading the program counter value and process context identifier of the task process. The context matching module 302 is used to determine a first matching relationship between the program count value and the breakpoint matching value stored in the first register, and to determine a second matching relationship between the process context identifier and the target process identifier stored in the second register; the program count value is the instruction address in the task process; the breakpoint matching value is used to characterize the instruction address that responds to the breakpoint behavior; the process context identifier is used to characterize the process identity information of the task process; the target process identifier is used to characterize the process identity information of the task process that responds to the breakpoint behavior. The first breakpoint execution module 303 is used to trigger a breakpoint action on the task process based on the program counter value when both the first matching relationship and the second matching relationship are a match.
[0102] Optionally, the context matching module 302 includes: The first matching confirmation submodule is used to determine the first matching relationship as a match when the program count value and the breakpoint matching value are consistent. The first match rejection submodule is used to determine the first match relationship as a mismatch when the program counter value and the breakpoint match value are inconsistent.
[0103] Optionally, the first breakpoint execution module 303 includes: The first instruction set extraction submodule is used to obtain the control instruction set for controlling and / or configuring breakpoint actions from the third register; The first breakpoint execution submodule is used to configure the breakpoint action according to the instructions in the control instruction set, and to jump to the instruction address represented by the program counter value to trigger the breakpoint action.
[0104] Optionally, the context matching module 302 includes: The context matching submodule is used to determine a first matching relationship between the program counter value and the breakpoint matching value stored in the first register, and to determine a second matching relationship between the process context identifier and the target process identifier stored in the second register, when the value in the context matching control bit of the breakpoint trigger is set to the first logical value; the context matching control bit is used to control the enabling or disabling of the determination behavior of the second matching relationship.
[0105] Optionally, the task breakpoint triggering device 30 further includes: enabling or disabling the determination behavior of the second matching relationship via a context matching control bit. The first configuration module is used to determine the first configuration target of the first configuration operation in response to the first configuration operation; The first matching enable module is used to set the value in the context matching control bit to a first logical value when the first configuration goal is to enable the determination behavior of the second matching relationship; The first match rejection module is used to set the value in the context match control bit to a second logical value when the configuration goal of the first configuration operation is to disable the determination behavior of the second match relationship.
[0106] Optionally, the context matching module 302 includes: The second matching determination submodule is used to determine the second matching relationship as a match when the process context identifier and the target process identifier are consistent. The second match rejection submodule is used to determine that the second match relationship is not a match when the process context identifier and the target process identifier are inconsistent.
[0107] Optionally, the task breakpoint triggering device 30 further includes: The process number module is used to configure a unique task process identification code for each task process to be executed. The second configuration identification module is used to determine the target task process from all pending task processes in response to the second configuration operation. The second configuration module is used to write the target task process identification code corresponding to the target task process into the second register.
[0108] Optionally, when there are multiple target task processes, the second configuration module includes: The OR table generation submodule is used to generate an OR table containing all target task process identification codes; The OR table write submodule is used to write the OR table to the second register.
[0109] Optionally, the target process identifier stored in the second register is stored in an OR table containing target task process identification codes that correspond one-to-one with multiple target task processes. The first breakpoint execution module 303 includes: The OR table breakpoint submodule is used to trigger a breakpoint action on the task process based on the program counter value if the OR table contains any target task process identifier that matches the process context identifier.
[0110] Optional, or table breakpoint submodules include: The instruction set fetching unit is used to retrieve the control instruction set for controlling and / or configuring breakpoint actions from the third register; The breakpoint execution unit is used to configure breakpoint actions according to the instructions in the control instruction set, and to jump to the instruction address represented by the program counter value to trigger the breakpoint action.
[0111] Optionally, the task breakpoint triggering device 30 also includes: The normal matching module is used to determine the first matching relationship between the program counter value and the breakpoint matching value stored in the first register when the value in the context matching control bit of the breakpoint trigger is set to the second logical value. The second breakpoint execution module is used to trigger a breakpoint action on the task process based on the program counter value when the value in the context matching control bit of the breakpoint trigger is set to the second logical value and the first matching relationship is a match.
[0112] Optionally, the second breakpoint execution module includes: The second instruction set extraction submodule is used to obtain the control instruction set for controlling and / or configuring breakpoint actions from the third register; The second breakpoint execution submodule is used to configure the breakpoint action according to the instructions in the control instruction set, and to jump to the instruction address represented by the program counter value to trigger the breakpoint action.
[0113] Optional, standard matching modules include: The first matching confirmation unit is used to determine the first matching relationship as a match when the program count value and the breakpoint matching value are consistent. The first match rejection unit is used to determine the first match relationship as a mismatch when the program count value and the breakpoint match value are inconsistent.
[0114] In summary, in this embodiment, by responding to the executing task process, the program count value and context identifier of the task are read, providing complete execution status information for subsequent matching and determination. This ensures that breakpoint determination has a dual-dimensional input basis, namely instruction location and task identity, thus laying the foundation for more refined trigger control. Furthermore, the first matching relationship determination between the program count value and the breakpoint matching value, and the second matching relationship determination between the process context identifier and the target process identifier are completed. This dual matching mechanism avoids the problem of cross-task false triggering caused by address matching alone, strictly limiting breakpoint triggering behavior to within the target task process. Finally, when both matching relationships are valid, the breakpoint action is triggered based on the program count value, thereby realizing the joint constraint of breakpoint behavior in both the address space and task context dimensions. This not only improves the accuracy of breakpoints and the controllability of debugging but also reduces system performance interference and debugging chaos caused by false triggering. Therefore, the method based on the embodiments of this application introduces a context matching mechanism in the breakpoint trigger, so that the breakpoint determination not only depends on the matching of the program counter value, but also further combines the context identifier of the current task process for judgment, thereby improving the pertinence and accuracy of breakpoint triggering, solving the problem that the breakpoint trigger cannot identify the task identity, improving the reliability and adaptability of the breakpoint mechanism in a multi-tasking environment, enhancing the expressive power of breakpoint configuration while maintaining the efficiency of the hardware trigger path, and improving the application effect of debugging tools in complex systems.
[0115] Reference Figure 4 The electronic device 500 may include one or more of the following components: processing component 502, memory 504, power supply component 506, multimedia component 508, audio component 510, input / output (I / O) interface 512, sensor component 514, and communication component 516.
[0116] Processing component 502 typically controls the overall operation of electronic device 500, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 502 may include one or more processors 520 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 502 may include one or more modules to facilitate interaction between processing component 502 and other components. For example, processing component 502 may include a multimedia module to facilitate interaction between multimedia component 508 and processing component 502.
[0117] Memory 504 is used to store various types of data to support the operation of electronic device 500. Examples of this data include instructions for any application or method operating on electronic device 500, contact data, phonebook data, messages, pictures, multimedia, etc. Memory 504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0118] Power supply component 506 provides power to various components of electronic device 500. Power supply component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 500.
[0119] Multimedia component 508 includes an interface that provides an output interface between electronic device 500 and user. In some embodiments, the interface may include a liquid crystal display (LCD) and a touch panel (TP). If the interface includes a touch panel, the interface may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may not only sense the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 508 includes a front-facing camera and / or a rear-facing camera. When electronic device 500 is in an operating mode, such as shooting mode or multimedia mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0120] Audio component 510 is used to output and / or input audio signals. For example, audio component 510 includes a microphone (MIC) used to receive external audio signals when electronic device 500 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 504 or transmitted via communication component 516. In some embodiments, audio component 510 also includes a speaker for outputting audio signals.
[0121] Input / output (I / O) interface 512 provides an interface between processing component 502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0122] Sensor assembly 514 includes one or more sensors for providing state assessments of various aspects of electronic device 500. For example, sensor assembly 514 may detect the on / off state of electronic device 500, the relative positioning of components such as the display and keypad of electronic device 500, changes in position of electronic device 500 or a component of electronic device 500, the presence or absence of user contact with electronic device 500, orientation or acceleration / deceleration of electronic device 500, and temperature changes of electronic device 500. Sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 514 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0123] Communication component 516 facilitates wired or wireless communication between electronic device 500 and other devices. Electronic device 500 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 5G), or combinations thereof. In one exemplary embodiment, communication component 516 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 516 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0124] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to implement the methods provided in the embodiments of this application.
[0125] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, which can be executed by a processor 520 of an electronic device 500 to perform the above-described method. For example, the non-transitory storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0126] In an exemplary embodiment, the electronic device 500 may also be provided as a server, including a processing component 502, which further includes one or more processors, and memory resources represented by memory 504 for storing instructions, such as applications, that can be executed by the processing component 502. The applications stored in memory 504 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 502 is configured to execute instructions to perform the methods provided in the embodiments of this application.
[0127] Electronic device 500 may also include a power supply component 506 configured to perform power management of electronic device 500, a wired or wireless communication component 516 configured to connect electronic device 500 to a network, and an input / output (I / O) interface 512. Electronic device 500 may operate on an operating system stored in memory 504, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.
[0128] It should be noted that, for the sake of simplicity, the method embodiments of this application are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential to the embodiments of this application.
[0129] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0130] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for triggering a task breakpoint, characterized in that, The method comprises: reading a program count value and a process context identifier of a task process in execution in response to the task process; determining a first matching relationship between the program count value and a breakpoint matching value stored in a first register, and determining a second matching relationship between the process context identifier and a target process identifier stored in a second register; the program count value is an instruction address in the task process; the breakpoint matching value is used to represent an instruction address in response to a breakpoint behavior; the process context identifier is used to represent process identity information of the task process; the target process identifier is used to represent process identity information of a task process in response to the breakpoint behavior; in a case where both the first matching relationship and the second matching relationship are matched, triggering a breakpoint action on the task process according to the program count value.
2. The method of claim 1, wherein the task breakpoint is triggered when the task is executed. The determination of the first matching relationship between the program count value and the breakpoint matching value stored in the first register, and the determination of the second matching relationship between the process context identifier and the target process identifier stored in the second register, comprise: in a case where a value in a context matching control bit of a breakpoint trigger is set to a first logic value, determining the first matching relationship between the program count value and the breakpoint matching value stored in the first register, and determining the second matching relationship between the process context identifier and the target process identifier stored in the second register; the context matching control bit is used to control enabling or disabling of the determination behavior of the second matching relationship.
3. The method of claim 1, wherein the task breakpoint is triggered when the task is executed. The task breakpoint triggering method further comprises: in response to a first configuration operation, determining a first configuration target of the first configuration operation; in a case where the first configuration target is to enable the determination behavior of the second matching relationship, setting the value in the context matching control bit to the first logic value; in a case where the configuration target of the first configuration operation is to disable the determination behavior of the second matching relationship, setting the value in the context matching control bit to a second logic value.
4. The method of claim 1, wherein the task breakpoint is triggered when the task is executed. The determination of the second matching relationship between the process context identifier and the target process identifier stored in the second register comprises: in a case where the process context identifier is consistent with the target process identifier, determining the second matching relationship as matched; in a case where the process context identifier is not consistent with the target process identifier, determining the second matching relationship as not matched.
5. The method of claim 1, wherein the task breakpoint is triggered when the task is executed. The task breakpoint triggering method further comprises: configuring a one-to-one corresponding task process identifier for each task process to be executed; in response to a second configuration operation, determining a target task process from all the task processes to be executed; writing a target task process identifier corresponding to the target task process into the second register.
6. The method of claim 5, wherein the task breakpoint is triggered when the task is executed. In a case where the target task process is multiple, the writing of the target task process identifier corresponding to the target task process into the second register comprises: generating an or table containing all the target task process identifiers; write the or table into the second register.
7. The method of claim 1, wherein the task breakpoint is triggered when the task is executed. The target process identification stored in the second register is stored by an or table containing target task process identification codes respectively corresponding to a plurality of target task processes, and the breakpoint action on the task process triggered according to the program count value in the case where both the first matching relationship and the second matching relationship are matching, comprises: In the case where any one of the target task process identification codes in the or table matches the process context identification, the breakpoint action on the task process triggered according to the program count value.
8. The method of claim 1, wherein the task breakpoint is triggered when the task is executed. The task breakpoint triggering method further comprises: In the case where the value in the context matching control bit of the breakpoint trigger is set to the second logic value, determining the first matching relationship between the program count value and the breakpoint matching value stored in the first register; In the case where the value in the context matching control bit of the breakpoint trigger is set to the second logic value and the first matching relationship is matching, triggering the breakpoint action on the task process according to the program count value.
9. The method of claim 1 or 8, wherein, The determination of the first matching relationship between the program count value and the breakpoint matching value stored in the first register comprises: In the case where the program count value is consistent with the breakpoint matching value, the first matching relationship is determined as matching; In the case where the program count value is inconsistent with the breakpoint matching value, the first matching relationship is determined as not matching.
10. The method of claim 1, 7, 8, wherein, The triggering of the breakpoint action on the task process according to the program count value comprises: Obtaining a control instruction set for controlling and / or configuring the breakpoint action from a third register; According to the instructions in the control instruction set, completing the configuration behavior of the breakpoint action and the jump behavior to the instruction address represented by the program count value, so as to trigger the breakpoint action.
11. An apparatus for triggering a task breakpoint, the apparatus comprising: Comprise: A task response module for reading the program count value and the process context identification of the task process in response to the task process in execution; A context matching module for determining the first matching relationship between the program count value and the breakpoint matching value stored in the first register, and determining the second matching relationship between the process context identification and the target process identification stored in the second register; the program count value is an instruction address in the task process; the breakpoint matching value is used to represent the instruction address responding to the breakpoint behavior; the process context identification is used to represent the process identity information of the task process; The target process identification is used to represent the process identity information of the task process responding to the breakpoint behavior; A first breakpoint execution module for triggering the breakpoint action on the task process according to the program count value in the case where both the first matching relationship and the second matching relationship are matching.
12. A computer-readable storage medium, characterized in that, The computer program stored on the computer readable storage medium is executed by the processor to realize the task breakpoint triggering method according to any one of claims 1 to 10.
13. An electronic device, comprising: A computer program product comprising a processor, a memory, and a computer program stored on the memory and loadable on the processor, the computer program implementing the steps of the method for triggering a task breakpoint according to any one of claims 1 to 10 when executed by the processor.