This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

tui/2023: Add option to display leading zeros on hexidecimal output


>Number:         2023
>Category:       tui
>Synopsis:       Add option to display leading zeros on hexidecimal output
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 01 19:58:01 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Sean Gies
>Release:        unknown-1.0
>Organization:
>Environment:

>Description:
It would be very useful, particularly when debugging low-level bit-twiddling code, to have an way to make GDB display hexidecimal numbers with leading zeros appropriate for their size.
>How-To-Repeat:
For example, given the following code:

	#include <stdint.h>
	struct Hex {
		uint8_t  i8;
		uint16_t i16;
		uint32_t i32;
		uint64_t i64;
	};
	int main(int argc, char** argv) {
		struct Hex hex = {4, 5, 6, 7};
		return hex.i32;
	}
	

I would like to see something like this:

	(gdb) set output-radix 16.
	Output radix now set to decimal 16, hex 10, octal 20.
	(gdb) info locals
	hex = {
	  i8 = 0x4, 
	  i16 = 0x5, 
	  i32 = 0x6, 
	  i64 = 0x7
	}
	(gdb) set output-hex-leading-zeros 1
	(gdb) info locals
	hex = {
	  i8 = 0x04, 
	  i16 = 0x0005, 
	  i32 = 0x00000006, 
	  i64 = 0x0000000000000007
	}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]