#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
#include <ctype.h>
#include <ipxe/console.h>
Go to the source code of this file.
|
struct | autocolour |
| A colour assigned to an autocolourised debug message stream. More...
|
|
◆ DBGCOL_MIN
Base message stream colour.
We default to using 31 (red foreground) as the base colour.
Definition at line 131 of file debug.c.
◆ DBGCOL_MAX
Maximum number of separately coloured message streams.
Six is the realistic maximum; there are 8 basic ANSI colours, one of which will be the terminal default and one of which will be invisible on the terminal because it matches the background colour.
Definition at line 142 of file debug.c.
◆ FILE_LICENCE()
FILE_LICENCE |
( |
GPL2_OR_LATER_OR_UBDL |
| ) |
|
◆ dbg_hex_dump_da_row()
static void dbg_hex_dump_da_row |
( |
unsigned long |
dispaddr, |
|
|
const void * |
data, |
|
|
unsigned long |
len, |
|
|
unsigned int |
offset |
|
) |
| |
|
static |
Print row of a hex dump with specified display address.
- Parameters
-
dispaddr | Display address |
data | Data to print |
len | Length of data |
offset | Starting offset within data |
Definition at line 82 of file debug.c.
95 ( ( ( i % 16 ) == 8 ) ?
'-' :
' ' ),
bytes[i] );
static int isprint(int character)
Check if character is printable.
uint8_t data[48]
Additional event data.
uint16_t offset
Offset to command line.
void dbg_printf(const char *fmt,...)
Print debug message.
References bytes, data, dbg_printf(), isprint(), len, and offset.
Referenced by dbg_hex_dump_da().
◆ dbg_autocolour()
static int dbg_autocolour |
( |
unsigned long |
stream | ) |
|
|
static |
Choose colour index for debug autocolourisation.
- Parameters
-
- Return values
-
Definition at line 159 of file debug.c.
161 static unsigned long use;
164 unsigned int oldest_last_used;
170 for ( i = 0 ; i < (
sizeof ( acs ) /
sizeof ( acs[0] ) ) ; i++ ) {
179 oldest_last_used = use;
180 for ( i = 0 ; i < (
sizeof ( acs ) /
sizeof ( acs[0] ) ) ; i++ ) {
181 if ( acs[i].
last_used < oldest_last_used ) {
182 oldest_last_used = acs[i].last_used;
186 acs[oldest].stream =
stream;
187 acs[oldest].last_used = use;
#define DBGCOL_MIN
Base message stream colour.
#define DBGCOL_MAX
Maximum number of separately coloured message streams.
unsigned long last_used
Last recorded usage.
A colour assigned to an autocolourised debug message stream.
unsigned long stream
Message stream ID.
References DBGCOL_MAX, DBGCOL_MIN, autocolour::last_used, and autocolour::stream.
Referenced by dbg_autocolourise().