---
name: "sleeping_thread_to_gdb_regs"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/sleeping_thread_to_gdb_regs"
---

# sleeping\_thread\_to\_gdb\_regs(9)

Convert ptrace regs to GDB regs

## NAME

sleeping\_thread\_to\_gdb\_regs - Convert ptrace regs to GDB regs

## SYNOPSIS

**void sleeping\_thread\_to\_gdb\_regs(unsigned long \*** *gdb\_regs***, struct task\_struct \*** *p***);**

## ARGUMENTS

*gdb\_regs*

A pointer to hold the registers in the order GDB wants.

*p*

The struct task\_struct of the desired process.

## DESCRIPTION

Convert the register values of the sleeping process in *p* to the format that GDB expects. This function is called when kgdb does not have access to the struct pt\_regs and therefore it should fill the gdb registers *gdb\_regs* with what has been saved in struct thread\_struct thread field during switch\_to.

## AUTHOR

**Jason Wessel** \<jason.wessel@windriver.com\>

Author.

## COPYRIGHT
