iPXE
gdbudp.h File Reference

GDB remote debugging over UDP. More...

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (FORBIDDEN)
network device name

Set up the UDP transport with network address

@addr IP address and UDP listen port, may be NULL and fields may be zero

Return values
transportsuitable for starting the GDB stub or NULL on error
struct gdb_transportgdbudp_configure (const char *name, struct sockaddr_in *addr)

Detailed Description

GDB remote debugging over UDP.

Definition in file gdbudp.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( FORBIDDEN )

References addr, and name.

◆ gdbudp_configure()

struct gdb_transport * gdbudp_configure ( const char * name,
struct sockaddr_in * addr )

Definition at line 214 of file gdbudp.c.

214 {
215 struct settings *settings;
216
217 /* Release old network device */
218 netdev_put ( netdev );
219
220 netdev = find_netdev ( name );
221 if ( !netdev ) {
222 return NULL;
223 }
224
225 /* Hold network device */
226 netdev_get ( netdev );
227
228 /* Source UDP port */
229 source_addr.sin_port = ( addr && addr->sin_port ) ? addr->sin_port : htons ( DEFAULT_PORT );
230
231 /* Source IP address */
232 if ( addr && addr->sin_addr.s_addr ) {
233 source_addr.sin_addr.s_addr = addr->sin_addr.s_addr;
234 } else {
235 settings = netdev_settings ( netdev );
236 fetch_ipv4_setting ( settings, &ip_setting, &source_addr.sin_addr );
237 if ( source_addr.sin_addr.s_addr == 0 ) {
238 netdev_put ( netdev );
239 netdev = NULL;
240 return NULL;
241 }
242 }
243
244 return &udp_gdb_transport;
245}
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
const char * name
Definition ath9k_hw.c:1986
uint32_t addr
Buffer address.
Definition dwmac.h:9
static struct sockaddr_in source_addr
Definition gdbudp.c:56
static struct net_device * netdev
Definition gdbudp.c:53
@ DEFAULT_PORT
Definition gdbudp.c:48
#define htons(value)
Definition byteswap.h:136
struct net_device * find_netdev(const char *name)
Get network device by name.
Definition netdevice.c:989
static struct net_device * netdev_get(struct net_device *netdev)
Get reference to network device.
Definition netdevice.h:565
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
Definition netdevice.h:576
A settings block.
Definition settings.h:133

References addr, DEFAULT_PORT, fetch_ipv4_setting(), find_netdev(), htons, ip_setting, name, netdev, netdev_get(), netdev_put(), netdev_settings(), NULL, and source_addr.

Referenced by gdbudp_init().