# US 2023/0273872 A1 · Application debuging method and electronic device

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0273872 A1
- Document ID: US20230273872A1
- Status: Published application
- Kind: A1
- Application number: 18/313,302
- Filed: 2023-05-05
- Published: 2023-08-31
- Earliest claimed: 2020-11-24
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Jian Xiao
- Web page: https://patentgrep.com/patent/US20230273872A1

## CPC

- G06F 11/3644: {by instrumenting at runtime}
- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F 11/3636: {by tracing the execution of the program}
- H04N 7/14: Systems for two-way working ({H04N7/12, } H04N7/173 take precedence)
- H04N 21/4363: Adapting the video stream to a specific local network, e.g. a Bluetooth® network
- G06F 11/3656: {using a specific debug interface}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

An application debugging method is provided. In the method, in response to a user operation, an intergrated development environment (IDE) device sends, to a directly connected device, a first debug packet used to debug a to-be-debugged application in the directly connected device and a third debug packet used to debug a to-be-debugged application in an indirectly connected device. The directly connected device receives the first debug packet and the third debug packet. The directly connected device sends the third debug packet to the indirectly connected device. According to a technical solution provided in this disclosure, the IDE device may not need to establish a communication connection to the indirectly connected device.

## Claims

### Claim 1

An application debugging method, the method comprising:
receiving, by a first electronic device, a first operation, the first operation indicating the first electronic device to debug a first application in a second electronic device;
in response to the first operation, obtaining, by the first electronic device, device information of the second electronic device based on path information of the first operation;
generating, by the first electronic device, a first debug packet for debugging the first application based on the device information of the second electronic device and a content of the first operation, wherein the first debug packet includes the device information of the second electronic device; and
sending, by the first electronic device, the first debug packet to the second electronic device through a first debug session between the first electronic device and the second electronic device.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the generating the first debug packet comprises:
generating, by the first electronic device, a second debug packet for debugging the first application based on the device information of the second electronic device and the content of the first operation;
generating, by the first electronic device, the first debug packet based on the second debug packet and the device information of the second electronic device, wherein the first debug packet is different from the second debug packet.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the generatingthe first debug packet comprises:
generating, by the first electronic device, first packet header information including the device information of the second electronic device; and
generating, by the first electronic device, the first debug packet based on the first packet header information and the second debug packet.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the first operation is an operation for setting a breakpoint for debugging the second electronic device; and the content of the first operation comprises a location of the breakpoint, and the path information is a path of the breakpoint.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the device information of the second electronic device comprises one or more of a device identifier (ID) of the second electronic device, a language type of the first application, a debugging process port number of the second electronic device, or an ID of the first application.

### Claim 6 (depends on 1)

The method according to claim 1, before receiving the first operation, the method further comprising:
receiving, by the first electronic device, a second operation;
in response to the second operation, sending, by the first electronic device to the second electronic device, a first request for requesting the second electronic device to establish the first debug session to the second electronic device; and
receiving, by the first electronic device, a first response sent by the second electronic device, the first response indicating that the second electronic device agrees to establish the first debug session with the first electronic device; and
establishing, by the first electronic device, the first debug session with the second electronic device.

### Claim 7 (depends on 6)

The method according to claim 6, before receiving the second operation of the user, the method further comprising:
receiving, by the first electronic device, a third operation;
in response to the third operation, sending, by the first electronic device to the second electronic device, an instruction to obtain the device information of the second electronic device;
receiving, by the first electronic device, the device information of the second electronic device sent by the second electronic device; and
storing, by the first electronic device, the device information of the second electronic device.

### Claim 8 (depends on 1)

The method according to claim 1, wherein that the first operation is used to indicate the first electronic device to debug the first application in the second electronic device comprises: the first operation is used to indicate the first electronic device to debug the first application in the second electronic device and a second application in a third electronic device; and the first operation is tapping by the user a control that is in the first electronic device and that is used to debug the second electronic device and the third electronic device.

### Claim 9

A first electronic device, comprising:
a memory configured to store program instructions;
a processor configured to execute the program instructions, causing the first electronic device to perform:
receiving a first operation indicatingthe first electronic device to debug a first application in a second electronic device;
in response to the first operation, obtaining device information of the second electronic device based on path information of the first operation;
generating a first debug packet for debugging the first application based on the device information of the second electronic device and a content of the first operation, wherein the first debug packet includes the device information of the second electronic device; and
sending the first debug packet to the second electronic device through a first debug session between the first electronic device and the second electronic device.

### Claim 10 (depends on 9)

The device according to claim 9, wherein the processor is configured to execute the program instructions, causing the first electronic device to perform:
generating a second debug packet based on the device information of the second electronic device and the content of the first operation, wherein the second debug packet is used to debug the first application;
generating, by the first electronic device, the first debug packet based on the second debug packet and the device information of the second electronic device, wherein the first debug packet is different from the second debug packet.

### Claim 11 (depends on 10)

The device according to claim 10, wherein the processor is configured to execute the program instructions, causing the first electronic device to perform:
generating, by the first electronic device, first packet header information based on the device information of the second electronic device, wherein the first packet header information includes the device information of the second electronic device; and
generating, by the first electronic device, the first debug packet based on the first packet header information and the second debug packet.

### Claim 12 (depends on 11)

The device according to claim 11, wherein the first operation is an operation for setting a breakpoint for debugging the second electronic device; and the content of the first operation comprises a location of the breakpoint, and the path information is a path of the breakpoint.

### Claim 13 (depends on 9)

The device according to claim 9, wherein the processor is further configured to execute the program instructions, causing the first electronic device to perform:
receiving a second operation;
in response to the second operation, sending a first request to the second electronic device, wherein the first request is used to request the second electronic device to establish the first debug session to the second electronic device; and
receiving a first response sent by the second electronic device; and
establishing the first debug session with the second electronic device, wherein the first response indicates that the second electronic device agrees to establish the first debug session with the first electronic device.

### Claim 14 (depends on 13)

The device according to claim 13, wherein the processor is further configured to execute the program instructions, causing the first electronic device to perform:
receiving a third operation;
in response to the third operation, sending an instruction to the second electronic device, wherein the instruction is used to obtain the device information of the second electronic device;
receiving the device information of the second electronic device sent by the second electronic device; and
storing the device information of the second electronic device.

### Claim 15 (depends on 9)

The device according to claim 9, wherein that the first operation is used to indicate the first electronic device to debug the first application in the second electronic device comprises: the first operation is used to indicate the first electronic device to debug the first application in the second electronic device and a second application in a third electronic device; and the first operation is tapping by the user a control that is in the first electronic device and that is used to debug the second electronic device and the third electronic device.

### Claim 16

A non-transitory readable medium comprising program instruction, when executed by a processor in a first electronic device, causing the first electronic device to perform:
receiving a first operation incidating the first electronic device to debug a first application in a second electronic device;
in response to the first operation, obtaining device information of the second electronic device based on path information of the first operation;
generating a first debug packet for debugging the first application based on the device information of the second electronic device and content of the first operation, wherein the first debug packet includes the device information of the second electronic device; and
sending the first debug packet to the second electronic device through a first debug session between the first electronic device and the second electronic device.

### Claim 17 (depends on 16)

The non-transitory readable medium according to claim 16, wherein the program instructions, when executed by the processor in the first electronic device, cause the first electronic device to perform:
generating a second debug packet based on the device information of the second electronic device and the content of the first operation, wherein the second debug packet is used to debug the first application;
generating the first debug packet based on the second debug packet and the device information of the second electronic device, wherein the first debug packet is different from the second debug packet.

### Claim 18 (depends on 17)

The non-transitory readable medium according to claim 17, wherein the program instructions, when executed by a processor in a first electronic device, cause the first electronic device to perform:
generating first packet header information based on the device information of the second electronic device, wherein the first packet header information includes the device information of the second electronic device; and
generating the first debug packet based on the first packet header information and the second debug packet.

### Claim 19 (depends on 18)

The non-transitory readable medium according to claim 18, wherein the first operation is setting a breakpoint by the user for debugging the second electronic device; and the content of the first operation carried in the first instruction comprises a location of the breakpoint, and the path information is a path of the breakpoint.

### Claim 20 (depends on 16)

The non-transitory readable medium according to claim 16, wherein the device information of the second electronic device comprises one or more of a device identifier (ID) of the second electronic device, a language type of the first application, a debugging process port number of the second electronic device, and an ID of the first application.
