head	1.1;
branch	1.1.1;
access;
symbols
	perseant-exfatfs-base-20261102:1.1.1.2
	netbsd-11-1-RELEASE:1.1.1.1
	netbsd-11-0-RELEASE:1.1.1.1
	netbsd-11-0-RC7:1.1.1.1
	netbsd-11-0-RC6:1.1.1.1
	netbsd-11-0-RC5:1.1.1.1
	netbsd-11-0-RC4:1.1.1.1
	netbsd-11-0-RC3:1.1.1.1
	gdb-17-1:1.1.1.2
	netbsd-11-0-RC2:1.1.1.1
	netbsd-11-0-RC1:1.1.1.1
	gdb-16-3:1.1.1.2
	perseant-exfatfs-base-20250801:1.1.1.1
	netbsd-11:1.1.1.1.0.4
	netbsd-11-base:1.1.1.1
	gdb-15-1:1.1.1.1
	perseant-exfatfs-base-20240630:1.1.1.1
	perseant-exfatfs:1.1.1.1.0.2
	perseant-exfatfs-base:1.1.1.1
	gdb-13-2:1.1.1.1
	FSF:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2023.07.30.22.44.25;	author christos;	state Exp;
branches
	1.1.1.1;
next	;
commitid	HEIv4Prd74m1wSyE;

1.1.1.1
date	2023.07.30.22.44.25;	author christos;	state Exp;
branches
	1.1.1.1.2.1;
next	1.1.1.2;
commitid	HEIv4Prd74m1wSyE;

1.1.1.2
date	2025.08.27.17.28.47;	author christos;	state Exp;
branches;
next	;
commitid	vgUAu9EQfEWNko8G;

1.1.1.1.2.1
date	2026.11.04.23.06.57;	author perseant;	state Exp;
branches;
next	;
commitid	3QTNojfCEH9lUb2H;


desc
@@


1.1
log
@Initial revision
@
text
@# gr28-gr31, fr31, icc3, fcc3 are used as tmps.
# consider them call clobbered by these macros.

	.macro start
	.data
failmsg:
	.ascii "fail\n"
passmsg:
	.ascii "pass\n"
	.text
	.global _start
_start:
	; enable data and insn caches in copy-back mode
	; Also enable all registers
	or_spr_immed	0xc80003c0,hsr0
	and_spr_immed	0xfffff3ff,hsr0

	; turn on psr.nem, psr.cm, psr.ef, psr.em, psr.esr,
	; disable external interrupts
	or_spr_immed	0x69f8,psr

	; If fsr exists, enable all fp_exceptions except inexact
	movsg		psr,gr28
	srli		gr28,28,gr28
	subicc 		gr28,0x2,gr0,icc3 ; is fr400?
	beq 		icc3,0,nofsr0
	or_spr_immed	0x3d000000,fsr0
nofsr0:

	; Set the stack pointer
	sethi.p		0x7,sp
	setlo		0xfffc,sp	; TODO -- what's a good value for this?

	; Set the TBR address
	sethi.p		0xf,gr28
	setlo		0xf000,gr28
	movgs		gr28,tbr	; TODO -- what's a good value for this?

	; Go to user mode -- causes too many problems
	;and_spr_immed	0xfffffffb,psr
	.endm

; Set GR with another GR
	.macro set_gr_gr src targ
	addi	\src,0,\targ
	.endm

; Set GR with immediate value
	.macro set_gr_immed val reg
	.if (\val >= -32768) && (\val <= 23767)
	setlos	\val,\reg
	.else
	setlo.p	%lo(\val),\reg
	sethi	%hi(\val),\reg
	.endif
	.endm

	.macro set_gr_limmed valh vall reg
	sethi.p	\valh,\reg
	setlo	\vall,\reg
	.endm

; Set GR with address value
	.macro set_gr_addr addr reg
	sethi.p	%hi(\addr),\reg
	setlo	%lo(\addr),\reg
	.endm

; Set GR with SPR
	.macro set_gr_spr src targ
	movsg	\src,\targ
	.endm

; Set GR with a value from memory
	.macro set_gr_mem addr reg
	set_gr_addr	\addr,gr28
	ldi		@@(gr28,0),\reg
	.endm

; Increment GR with immediate value
	.macro inc_gr_immed val reg
	.if (\val >= -2048) && (\val <= 2047)
	addi \reg,\val,\reg
	.else
	set_gr_immed \val,gr28
	add \reg,gr28,\reg
	.endif
	.endm

; AND GR with immediate value
	.macro and_gr_immed val reg
	.if (\val >= -2048) && (\val <= 2047)
	andi \reg,\val,\reg
	.else
	set_gr_immed \val,gr28
	and \reg,gr28,\reg
	.endif
	.endm

; OR GR with immediate value
	.macro or_gr_immed val reg
	.if (\val >= -2048) && (\val <= 2047)
	ori \reg,\val,\reg
	.else
	set_gr_immed \val,gr28
	or \reg,gr28,\reg
	.endif
	.endm

; Set FR with another FR
	.macro set_fr_fr src targ
	fmovs	\src,\targ
	.endm

; Set FR with integer immediate value
	.macro set_fr_iimmed valh vall reg
	set_gr_limmed	\valh,\vall,gr28
	movgf		gr28,\reg
	.endm

; Set FR with integer immediate value
	.macro set_fr_immed val reg
	set_gr_immed	\val,gr28
	movgf		gr28,\reg
	.endm

; Set FR with a value from memory
	.macro set_fr_mem addr reg
	set_gr_addr	\addr,gr28
	ldfi		@@(gr28,0),\reg
	.endm

; Set double FR with another double FR
	.macro set_dfr_dfr src targ
	fmovd	\src,\targ
	.endm

; Set double FR with a value from memory
	.macro set_dfr_mem addr reg
	set_gr_addr	\addr,gr28
	lddfi		@@(gr28,0),\reg
	.endm

; Set CPR with immediate value
	.macro set_cpr_immed val reg
	addi		sp,-4,gr28
	set_gr_immed	\val,gr29
	st		gr29,@@(gr28,gr0)
	ldc		@@(gr28,gr0),\reg
	.endm

	.macro set_cpr_limmed valh vall reg
	addi		sp,-4,gr28
	set_gr_limmed	\valh,\vall,gr29
	st		gr29,@@(gr28,gr0)
	ldc		@@(gr28,gr0),\reg
	.endm

; Set SPR with immediate value
	.macro set_spr_immed val reg
	set_gr_immed	\val,gr28
	movgs		gr28,\reg
	.endm

	.macro set_spr_limmed valh vall reg
	set_gr_limmed	\valh,\vall,gr28
	movgs		gr28,\reg
	.endm

	.macro set_spr_addr addr reg
	set_gr_addr	\addr,gr28
	movgs		gr28,\reg
	.endm

; increment SPR with immediate value
	.macro inc_spr_immed val reg
	movsg		\reg,gr28
	inc_gr_immed 	\val,gr28
	movgs		gr28,\reg
	.endm

; OR spr with immediate value
	.macro or_spr_immed val reg
	movsg		\reg,gr28
	set_gr_immed 	\val,gr29
	or		gr28,gr29,gr28
	movgs		gr28,\reg
	.endm

; AND spr with immediate value
	.macro and_spr_immed val reg
	movsg		\reg,gr28
	set_gr_immed 	\val,gr29
	and		gr28,gr29,gr28
	movgs		gr28,\reg
	.endm

; Set accumulator with immediate value
	.macro set_acc_immed val reg
	set_fr_immed	\val,fr31
	mwtacc		fr31,\reg
	.endm

; Set accumulator guard with immediate value
	.macro set_accg_immed val reg
	set_fr_immed	\val,fr31
	mwtaccg		fr31,\reg
	.endm

; Set memory with immediate value
	.macro set_mem_immed val base
	set_gr_immed	\val,gr28
	sti		gr28,@@(\base,0)
	.endm

	.macro set_mem_limmed valh vall base
	set_gr_limmed	\valh,\vall,gr28
	sti		gr28,@@(\base,0)
	.endm

; Set memory with GR value
	.macro set_mem_gr reg addr
	set_gr_addr	\addr,gr28
	sti		\reg,@@(gr28,0)
	.endm

; Test the value of a general register against another general register
	.macro test_gr_gr reg1 reg2
	subcc \reg1,\reg2,gr0,icc3
	beq icc3,0,test_gr\@@
	fail
test_gr\@@:
	.endm

; Test the value of an immediate against a general register
	.macro test_gr_immed val reg
	.if (\val >= -512) && (\val <= 511)
	subicc \reg,\val,gr0,icc3
	.else
	set_gr_immed \val,gr28
	subcc \reg,gr28,gr0,icc3
	.endif
	beq icc3,0,test_gr\@@
	fail
test_gr\@@:
	.endm

	.macro test_gr_limmed valh vall reg
	set_gr_limmed \valh,\vall,gr28
	subcc \reg,gr28,gr0,icc3
	beq icc3,0,test_gr\@@
	fail
test_gr\@@:
	.endm

; Test the value of an floating register against an integer immediate
	.macro test_fr_limmed valh vall reg
	movfg		\reg,gr29
	set_gr_limmed	\valh,\vall,gr28
	subcc		gr29,gr28,gr0,icc3
	beq icc3,0,test_gr\@@
	fail
test_gr\@@:
	.endm

	.macro test_fr_iimmed val reg
	movfg		\reg,gr29
	set_gr_immed	\val,gr28
	subcc		gr29,gr28,gr0,icc3
	beq icc3,0,test_gr\@@
	fail
test_gr\@@:
	.endm

; Test the value of a floating register against another floating point register
	.macro test_fr_fr reg1 reg2
	fcmps	\reg1,\reg2,fcc3
	fbeq 	fcc3,0,test_gr\@@
	fail
test_gr\@@:
	.endm

; Test the value of a double floating register against another
; double floating point register
	.macro test_dfr_dfr reg1 reg2
	fcmpd	\reg1,\reg2,fcc3
	fbeq 	fcc3,0,test_gr\@@
	fail
test_gr\@@:
	.endm

; Test the value of a special purpose register against an integer immediate
	.macro test_spr_immed val reg
	movsg		\reg,gr29
	set_gr_immed	\val,gr28
	subcc		gr29,gr28,gr0,icc3
	beq icc3,0,test_gr\@@
	fail
test_gr\@@:
	.endm

	.macro test_spr_limmed valh vall reg
	movsg		\reg,gr29
	set_gr_limmed	\valh,\vall,gr28
	subcc		gr29,gr28,gr0,icc3
	beq icc3,0,test_gr\@@
	fail
test_gr\@@:
	.endm

	.macro test_spr_gr spr gr
	movsg		\spr,gr28
	test_gr_gr	\gr,gr28
	.endm

	.macro test_spr_addr addr reg
	movsg		\reg,gr29
	set_gr_addr	\addr,gr28
	test_gr_gr	gr28,gr29
	.endm

; Test spr bits masked and shifted against the given value
	.macro test_spr_bits	mask,shift,val,reg
	movsg		\reg,gr28
	set_gr_immed 	\mask,gr29
	and		gr28,gr29,gr28
	srli		gr28,\shift,gr29
	test_gr_immed	\val,gr29
	.endm
	

; Test the value of an accumulator against an integer immediate
	.macro test_acc_immed val reg
	mrdacc		\reg,fr31
	test_fr_iimmed	\val,fr31
	.endm

; Test the value of an accumulator against an integer immediate
	.macro test_acc_limmed valh vall reg
	mrdacc		\reg,fr31
	test_fr_limmed	\valh,\vall,fr31
	.endm

; Test the value of an accumulator guard against an integer immediate
	.macro test_accg_immed val reg
	mrdaccg		\reg,fr31
	test_fr_iimmed	\val,fr31
	.endm

; Test CPR agains an immediate value
	.macro test_cpr_limmed valh vall reg
	addi		sp,-4,gr31
	stc		\reg,@@(gr31,gr0)
	test_mem_limmed	\valh,\vall,gr31
	.endm

; Test the value of an immediate against memory
	.macro test_mem_immed val base
	ldi		@@(\base,0),gr29
	.if (\val >= -512) && (\val <= 511)
	subicc gr29,\val,gr0,icc3
	.else
	set_gr_immed \val,gr28
	subcc gr29,gr28,gr0,icc3
	.endif
	beq icc3,0,test_gr\@@
	fail
test_gr\@@:
	.endm

	.macro test_mem_limmed valh vall base
	ldi		@@(\base,0),gr29
	set_gr_limmed \valh,\vall,gr28
	subcc gr29,gr28,gr0,icc3
	beq icc3,0,test_gr\@@
	fail
test_gr\@@:
	.endm

; Set an integer condition code
	.macro set_icc mask iccno
	set_gr_immed	4,gr29
	smuli		gr29,\iccno,gr30
	addi		gr31,16,gr31
	set_gr_immed	0xf,gr28
	sll		gr28,gr31,gr28
	not		gr28,gr28
	movsg		ccr,gr29
	and		gr28,gr29,gr29
	set_gr_immed	\mask,gr28
	sll		gr28,gr31,gr28
	or		gr28,gr29,gr29
	movgs		gr29,ccr
	.endm
; started here
; Test the condition codes
	.macro test_icc N Z V C iccno
	.if (\N == 1)
	bp   \iccno,0,fail\@@
	.else
	bn   \iccno,0,fail\@@
	.endif
	.if (\Z == 1)
	bne  \iccno,0,fail\@@
	.else
	beq   \iccno,0,fail\@@
	.endif
	.if (\V == 1)
	bnv \iccno,0,fail\@@
	.else
	bv   \iccno,0,fail\@@
	.endif
	.if (\C == 1)
	bnc   \iccno,0,fail\@@
	.else
	bc   \iccno,0,fail\@@
	.endif
	bra test_cc\@@
fail\@@:
	fail
test_cc\@@:
	.endm

; Set an floating point condition code
	.macro set_fcc mask fccno
	set_gr_immed	4,gr29
	smuli		gr29,\fccno,gr30
	set_gr_immed	0xf,gr28
	sll		gr28,gr31,gr28
	not		gr28,gr28
	movsg		ccr,gr29
	and		gr28,gr29,gr29
	set_gr_immed	\mask,gr28
	sll		gr28,gr31,gr28
	or		gr28,gr29,gr29
	movgs		gr29,ccr
	.endm

; Test the condition codes
	.macro test_fcc val fccno
	set_gr_immed	4,gr29
	smuli		gr29,\fccno,gr30
	movsg		ccr,gr29
	srl		gr29,gr31,gr29
	andi		gr29,0xf,gr29
	test_gr_immed	\val,gr29
	.endm

; Set PSR.ET
	.macro set_psr_et val
	movsg		psr,gr28
	.if (\val == 1)
	ori		gr28,1,gr28		; Turn on SPR.ET
	.else
	andi		gr28,0xfffffffe,gr28	; Turn off SPR.ET
	.endif
	movgs		gr28,psr
	.endm

; Floating point constants
	.macro float_constants
f0:		.float	0.0
f1:		.float	1.0
f2:		.float	2.0
f3:		.float	3.0
f6:		.float	6.0
f9:		.float	9.0
fn0:		.float	-0.0
fn1:		.float	-1.0
finf:		.long	0x7f800000
fninf:		.long	0xff800000
fmax:		.long	0x7f7fffff
fmin:		.long	0xff7fffff
feps:		.long	0x00400000
fneps:		.long	0x80400000
fnan1:		.long	0x7fc00000
fnan2:		.long	0x7f800001
	.endm

	.macro double_constants
d0:		.double	0.0
d1:		.double	1.0
d2:		.double	2.0
d3:		.double	3.0
d6:		.double	6.0
d9:		.double	9.0
dn0:		.double	-0.0
dn1:		.double	-1.0
dinf:		.long	0x7ff00000
		.long	0x00000000
dninf:		.long	0xfff00000
		.long	0x00000000
dmax:		.long	0x7fefffff
		.long	0xffffffff
dmin:		.long	0xffefffff
		.long	0xffffffff
deps:		.long	0x00080000
		.long	0x00000000
dneps:		.long	0x80080000
		.long	0x00000000
dnan1:		.long	0x7ff80000
		.long	0x00000000
dnan2:		.long	0x7ff00000
		.long	0x00000001
	.endm

; Load floating point constants
	.macro load_float_constants
	set_fr_mem	fninf,fr0
	set_fr_mem	fmin,fr4
	set_fr_mem	fn1,fr8
	set_fr_mem	fneps,fr12
	set_fr_mem	fn0,fr16
	set_fr_mem	f0,fr20
	set_fr_mem	feps,fr24
	set_fr_mem	f1,fr28
	set_fr_mem	f2,fr32
	set_fr_mem	f3,fr36
	set_fr_mem	f6,fr40
	set_fr_mem	f9,fr44
	set_fr_mem	fmax,fr48
	set_fr_mem	finf,fr52
	set_fr_mem	fnan1,fr56
	set_fr_mem	fnan2,fr60
	.endm

	.macro load_float_constants1
	set_fr_mem	fninf,fr1
	set_fr_mem	fmin,fr5
	set_fr_mem	fn1,fr9
	set_fr_mem	fneps,fr13
	set_fr_mem	fn0,fr17
	set_fr_mem	f0,fr21
	set_fr_mem	feps,fr25
	set_fr_mem	f1,fr29
	set_fr_mem	f2,fr33
	set_fr_mem	f3,fr37
	set_fr_mem	f6,fr41
	set_fr_mem	f9,fr45
	set_fr_mem	fmax,fr49
	set_fr_mem	finf,fr53
	set_fr_mem	fnan1,fr57
	set_fr_mem	fnan2,fr61
	.endm

	.macro load_float_constants2
	set_fr_mem	fninf,fr2
	set_fr_mem	fmin,fr6
	set_fr_mem	fn1,fr10
	set_fr_mem	fneps,fr14
	set_fr_mem	fn0,fr18
	set_fr_mem	f0,fr22
	set_fr_mem	feps,fr26
	set_fr_mem	f1,fr30
	set_fr_mem	f2,fr34
	set_fr_mem	f3,fr38
	set_fr_mem	f6,fr42
	set_fr_mem	f9,fr46
	set_fr_mem	fmax,fr50
	set_fr_mem	finf,fr54
	set_fr_mem	fnan1,fr58
	set_fr_mem	fnan2,fr62
	.endm

	.macro load_float_constants3
	set_fr_mem	fninf,fr3
	set_fr_mem	fmin,fr7
	set_fr_mem	fn1,fr11
	set_fr_mem	fneps,fr15
	set_fr_mem	fn0,fr19
	set_fr_mem	f0,fr23
	set_fr_mem	feps,fr27
	set_fr_mem	f1,fr31
	set_fr_mem	f2,fr35
	set_fr_mem	f3,fr39
	set_fr_mem	f6,fr43
	set_fr_mem	f9,fr47
	set_fr_mem	fmax,fr51
	set_fr_mem	finf,fr55
	set_fr_mem	fnan1,fr59
	set_fr_mem	fnan2,fr63
	.endm

	.macro load_double_constants
	set_dfr_mem	dninf,fr0
	set_dfr_mem	dmin,fr4
	set_dfr_mem	dn1,fr8
	set_dfr_mem	dneps,fr12
	set_dfr_mem	dn0,fr16
	set_dfr_mem	d0,fr20
	set_dfr_mem	deps,fr24
	set_dfr_mem	d1,fr28
	set_dfr_mem	d2,fr32
	set_dfr_mem	d3,fr36
	set_dfr_mem	d6,fr40
	set_dfr_mem	d9,fr44
	set_dfr_mem	dmax,fr48
	set_dfr_mem	dinf,fr52
	set_dfr_mem	dnan1,fr56
	set_dfr_mem	dnan2,fr60
	.endm

; Lock the insn cache at the given address
	.macro lock_insn_cache address
	icpl		\address,gr0,1
	.endm

; Lock the data cache at the given address
	.macro lock_data_cache address
	dcpl		\address,gr0,1
	.endm

; Invalidate the data cache at the given address
	.macro invalidate_data_cache address
	dci		@@(\address,gr0)
	.endm

; Flush the data cache at the given address
	.macro flush_data_cache address
	dcf		@@(\address,gr0)
	.endm

; Write a bctrlr 0,0 insn at the address contained in the given register
	.macro set_bctrlr_0_0 address
	set_mem_immed	0x80382000,\address	; bctrlr 0,0
	flush_data_cache \address
	.endm

; Exit with return code
	.macro exit rc
	setlos		#1,gr7
	set_gr_immed	\rc,gr8
	tira		gr0,#0
	.endm

; Pass the test case
	.macro pass
pass\@@:
	setlos.p	#5,gr10
	setlos		#1,gr8
	setlos		#5,gr7
	set_gr_addr  	passmsg,gr9
	tira		gr0,#0
	exit		#0
	.endm

; Fail the testcase
	.macro fail
fail\@@:
	setlos.p	#5,gr10
	setlos		#1,gr8
	setlos		#5,gr7
	set_gr_addr	failmsg,gr9
	tira		gr0,#0
	exit		#1
	.endm
@


1.1.1.1
log
@Import gdb-13.2 over gdb-11.0.50

May 27th, 2023: GDB 13.2 Released!
The latest version of GDB, version 13.2, is available for download.

This is a minor corrective release over GDB 13.1, fixing the following issues:

PR testsuite/30158 (rustc testsuite fails with 13.1, apparently
		    worked before with trunk 20230114 on i686-linux-gnu and
		    powerpc64le-linux-gnu)
PR gdb/30214 (GDB 13.1 does not compile on FreeBSD 13.1)
PR gdb/30240 ((linux/aarch) thread.c:86: internal-error: inferior_thread:
              Assertion `current_thread_ != nullptr' failed)
PR gdb/30249 ([13 regression] hookpost-extended-remote will not work)
PR exp/30271 (Addresses of static thread_local fields are badly
              calculated sometimes)
PR symtab/30357 (Segmentation fault for the 'start' command)
PR symtab/30369 ([gdb/symtab] False match issue in
skip_prologue_using_linetable)

PR gdb/30423 (Build failures with clang 16)
PR build/30450 (Build failure (linux-low.cc:5393:45: error: expected
		':' before ')' token) with musl-1.2.4)

See the NEWS file for a more complete and detailed list of what this release
 includes.

Feb 19th, 2023: GDB 13.1 Released!

The latest version of GDB, version 13.1, is available for download.
This version of GDB includes the following changes and enhancements:
Support for the following new targets has been added in both GDB and GDBserver:
GNU/Linux/LoongArch (gdbserver) loongarch*-*-linux*
GNU/Linux/CSKY (gdbserver) csky*-*linux*
The Windows native target now supports target async.
FreeBSD:
Arm and AArch64: Support for Thread Local Storage (TLS) variables
Hardware watchpoint support on AArch64 FreeBSD
Floating-point support has now been added on LoongArch GNU/Linux.
New commands:
set print nibbles [on|off]
show print nibbles

This controls whether the 'print/t' command will display binary
values in groups of four bits, known as "nibbles". The default is
'off'.

Various styling-related commands. See the gdb/NEWS file for more details.
Various maintenance commands. These are normally aimed at GDB
experts or developers. See the gdb/NEWS file for more details.

Python API improvements:
New Python API for instruction disassembly.

The new attribute 'locations' of gdb.Breakpoint returns a list of
gdb.BreakpointLocation objects specifying the locations where the
breakpoint is inserted into the debuggee.
New Python type gdb.BreakpointLocation.
New function gdb.format_address(ADDRESS, PROGSPACE, ARCHITECTURE)
that formats ADDRESS as 'address '
New function gdb.current_language that returns the name of the
current language. Unlike gdb.parameter('language'), this will never
return 'auto'.
New function gdb.print_options that returns a dictionary of the
prevailing print options, in the form accepted by gdb.Value.format_string.
New method gdb.Frame.language that returns the name of the frame's language.
gdb.Value.format_string now uses the format provided by 'print',
if it is called during a 'print' or other similar operation.
gdb.Value.format_string now accepts the 'summary' keyword. This
can be used to request a shorter representation of a value, the
way that 'set print frame-arguments scalars' does.
The gdb.register_window_type method now restricts the set of
acceptable window names. The first character of a window's name
must start with a character in the set [a-zA-Z], every subsequent
character of a window's name must be in the set [-_.a-zA-Z0-9].
` GDB/MI changes:  MI version 1 is deprecated, and will be removed
in GDB 14.  The async record stating the stopped reason 'breakpoint-hit'
now contains an optional field locno.

Miscellaneous improvements:
gdb now supports zstd compressed debug sections (ELFCOMPRESS_ZSTD) for ELF.
New convenience variable $_inferior_thread_count contains the number
of live threads in the current inferior.
New convenience variables $_hit_bpnum and $_hit_locno, set to the
breakpoint number and the breakpoint location number of the breakpoint
last hit.
The "info breakpoints" now displays enabled breakpoint locations
of disabled breakpoints as in the "y-" state.
The format of 'disassemble /r' and 'record instruction-history /r'
has changed to match the layout of GNU objdump when disassembling.

A new format "/b" has been introduce to provide the old behavior of "/r".
The TUI no longer styles the source and assembly code highlighted
by the current position indicator by default. You can however
re-enable styling using the new "set style tui-current-position"
command.
It is now possible to use the "document" command to document
user-defined commands.
Support for memory tag data for AArch64 MTE.
Support Removal notices:
DBX mode has been removed.
Support for building against Python version 2 has been removed. It
is now only possible to build GDB against Python 3.
Support for the following commands has been removed:

set debug aix-solib on|off
show debug aix-solib
set debug solib-frv on|off
show debug solib-frv

Use the "set/show debug solib" commands instead.
See the NEWS file for a more complete and detailed list of what
this release includes.

Dec 18th, 2022: GDB 13 branch created
The GDB 13 branch (gdb-13-branch) has been created. To check out
a copy of the branch use:

git clone --branch gdb-13-branch https://sourceware.org/git/binutils-gdb.git
May 1st, 2022: GDB 12.1 Released!
The latest version of GDB, version 12.1, is available for download.

This version of GDB includes the following changes and enhancements:

New support for the following native configuration:
GNU/Linux/OpenRISC or1k*-*-linux*
New support for the following targets:
GNU/Linux/LoongArch loongarch*-*-linux*
New GDBserver support on the following configuration:
GNU/Linux/OpenRISC or1k*-*-linux*
Support for the following target has been removed:
S+core score-*-*
Multithreaded symbol loading is now enabled by default

Deprecation Notices:
GDB 12 is the last release of GDB that will support building against Python 2
DBX mode is deprecated, and will be removed in GDB 13
GDB/MI changes:
The '-add-inferior' with no option flags now inherits the connection
of the current inferior, this restores the behaviour of GDB as it
was prior to GDB 10.
The '-add-inferior' command now accepts a '--no-connection' option,
which causes the new inferior to start without a connection.

Python API enhancements:
It is now possible to add GDB/MI commands implemented in Python
New function gdb.Architecture.integer_type()
New gdb.events.gdb_exiting event
New 'gdb.events.connection_removed' event registry
New gdb.TargetConnection object
New gdb.Inferior.connection property
New read-only attribute gdb.InferiorThread.details
New gdb.RemoteTargetConnection.send_packet method
New read-only attributes gdb.Type.is_scalar and gdb.Type.is_signed
The gdb.Value.format_string method now takes a 'styling' argument
Various new function in the "gdb" module
Miscellaneous:
The FreeBSD native target now supports async mode

Improved C++ template support
Support for disabling source highlighting through GNU of the Pygments
library instead.
The "print" command has been changed so as to print floating-point
values with a base-modifying formats such as "/x" to display the
underlying bytes of the value in the desired base.
The "clone-inferior" command now ensures that the TTY, CMD and ARGS
settings are copied from the original inferior to the new one. All
modifications to the environment variables done using the 'set
environment' or 'unset environment' commands are also copied to
the new inferior.
Various new commands have been introduced
See the NEWS file for a more complete and detailed list of what
this release includes.

Mar 20th, 2022: GDB 12 branch created
The GDB 12 branch (gdb-12-branch) has been created. To check out a copy of the branch use:

git clone --branch gdb-12-branch https://sourceware.org/git/binutils-gdb.git
January 16th, 2022: GDB 11.2 Released!
The latest version of GDB, version 11.2, is available for download.

This is a minor corrective release over GDB 11.1, fixing the following issues:

PR sim/28302 (gdb fails to build with glibc 2.34)
PR build/28318 (std::thread support configure check does not use CXX_DIALECT)
PR gdb/28405 (arm-none-eabi: internal-error: ptid_t
	      remote_target::select_thread_for_ambiguous_stop_reply(const
	      target_waitstatus*): Assertion `first_resumed_thread != nullptr'
	      failed)
PR tui/28483 ([gdb/tui] breakpoint creation not displayed)
PR build/28555 (uclibc compile failure since commit
		4655f8509fd44e6efabefa373650d9982ff37fd6)
PR rust/28637 (Rust characters will be encoded using DW_ATE_UTF)
PR gdb/28758 (GDB 11 doesn't work correctly on binaries with a
              SHT_RELR (.relr.dyn) section)
PR gdb/28785 (Support SHT_RELR (.relr.dyn) section)
See the NEWS file for a more complete and detailed list of what
this release includes.

September 13th, 2021: GDB 11.1 Released!
The latest version of GDB, version 11.1, is available for download.

This version of GDB includes the following changes and enhancements:

Support for ARM Symbian (arm*-*-symbianelf*) has been removed.
Building GDB now requires GMP (The GNU Multiple Precision Arithmetic Library).
New command-line options "--early-init-command" (or "-eix") and
"--early-init-eval-command" (or "-eiex")

GDB/MI Changes:
New --qualified option for the '-break-insert' and '-dprintf-insert' commands.
New --force-condition option for the '-break-insert' and
'-dprintf-insert' commands.
New --force option for the '-break-condition' command.
The '-file-list-exec-source-files' now accepts an optional regular
expression to filter the source files included in the result.
The results from '-file-list-exec-source-files' now include a
'debug-fully-read' field to indicate if the corresponding source's
debugging information has been partially read (false) or has been
fully read (true).

TUI Improvements:
Mouse actions are now supported. The mouse wheel scrolls the
appropriate window.  Key combinations that do not have a specific
action on the focused window are now passed to GDB.

Python enhancements:
Inferior objects now contain a read-only 'connection_num' attribute
that gives the connection number as seen in 'info connections' and
'info inferiors'.
New method gdb.Frame.level() which returns the stack level of the frame object.
New method gdb.PendingFrame.level() which returns the stack level
of the frame object.
When hitting a catchpoint, the Python API will now emit a
gdb.BreakpointEvent rather than a gdb.StopEvent. The gdb.Breakpoint
attached to the event will have type BP_CATCHPOINT.
Python TUI windows can now receive mouse click events. If the Window
object implements the click method, it is called for each mouse
click event in this window.  New setting "python ignore-environment
on|off"; if "on", causes GDB's builtin Python to ignore any
environment variable that would otherwise affect how Python behaves
(needs to be set during "early initialization" (see above).  New
setting "python dont-write-bytecode auto|on|off".

Guile API enhancements:
Improved support for rvalue reference values.
New procedures for obtaining value variants: value-reference-value,
value-rvalue-reference-value and value-const-value.
New "qMemTags" and "QMemTags" remote protocol packets (associated
with Memory Tagging).
GDB will now look for the .gdbinit file in a config directory before
looking for ~/.gdbinit. The file is searched for in the following
locations: $XDG_CONFIG_HOME/gdb/gdbinit, $HOME/.config/gdb/gdbinit,
$HOME/.gdbinit. On Apple hosts the search order is instead:
$HOME/Library/Preferences/gdb/gdbinit, $HOME/.gdbinit.  The "break
[...] if CONDITION" command no longer returns an error when the
condition is invalid at one or more locations. Instead, if the
condition is valid at one or more locations, the locations where
the condition is not valid are disabled.
The behavior of the "condition" command is changed to match the
new behavior of the "break" command.

Support for general memory tagging functionality (currently limited
to AArch64 MTE)

Core file debugging now supported for x86_64 Cygwin programs.
New "org.gnu.gdb.riscv.vector" feature for RISC-V targets.
GDB now supports fixed point types which are described in DWARF as
base types with a fixed-point encoding. Additionally, support for
the DW_AT_GNU_numerator and DW_AT_GNU_denominator has also been
added.

Miscellaneous:
New "startup-quietly on|off" setting; when "on", behaves the same
as passing the "-silent" option on the command line.
New "print type hex on|off" setting; when 'on', the 'ptype' command
uses hexadecimal notation to print sizes and offsets of struct
members. When 'off', decimal notation is used.
The "inferior" command, when run without argument, prints information
about the current inferior.
The "ptype" command now supports "/x" and "/d", affecting the base
used to print sizes and offsets.
The output of the "info source" has been restructured.
New "style version foreground | background | intensity" commands
to control the styling of the GDB version number.
Various debug and maintenance commands (mostly useful for the GDB
developers) See the NEWS file for a more complete and detailed list
of what this release includes.
@
text
@@


1.1.1.1.2.1
log
@Sync with HEAD
@
text
@d350 1
a350 1
; Test CPR against an immediate value
@


1.1.1.2
log
@Import gdb 16.3; previous was 15.1

April 20th, 2025: GDB 16.3 Released!

    The latest version of GDB, version 16.3, is available for download.

    This is a corrective release over GDB 16.2, fixing the following issues:

        PR symtab/32309 ([gdb/symtab, fission] gdb/dwarf2/read.h:289:
	    internal-error: version: Assertion `m_dwarf_version != 0' failed)
        PR corefiles/32441 (gdb segfaults when generating a core file if
	    target_fileio_read_alloc fails)
        PR tui/32623 (TUI console window doesn't update while inferior is
	    running)
        PR corefiles/32634 ([gdb/corefiles] segfault in
	    gdb.arch/i386-biarch-core.exp)
        PR backtrace/32757 ("Assertion `stashed' failed" when inline frame #0
	    is duplicated)
        PR tdep/32770 ([gdb/tdep, i386] FAIL: gdb.reverse/recvmsg-reverse.exp:
	    continue to breakpoint: marker2)
        PR gdb/32775 ([AArch64] gdbserver crashes on SVE/SME-enabled systems)
        PR record/32784 ([gdb/record, aarch64] Stack smashing detected in
	    aarch64_record_asimd_load_store)
        PR tui/32797 (Escape sequences to only reset foreground or background
	    color to default fail)
        PR gdb/32828 (gstack regression: missing file names and line numbers)

    See the NEWS file for a more complete and detailed list of what this
    release includes.

February 1st, 2025: GDB 16.2 Released!

    The latest version of GDB, version 16.2, is available for download.

    This is a corrective release over GDB 16.1, fixing the following issues:

        PR build/32578 (cannot build GDB 16.1 out of tree when calling the
	    configure script with a relative path)
        PR tui/32592 ([gdb/tui] internal error in
	    tui-winsource.c:340:refresh_window)
        PR remote/32593 (Incompatibilities between GDB's and LLDB's 'x'
	    packet implementation)
        PR build/32610 (Missing #include file in darwin_nat.c)

    See the NEWS file for a more complete and detailed list of what this
    release includes.

January 18th, 2025: GDB 16.1 Released!

    The latest version of GDB, version 16.1, is available for download.
    This version of GDB includes the following changes and enhancements:

        record/replay support now available on loongarch*-linux*
        GDB now supports watchpoints for tagged data pointers.
        MTE (Memory Tagging Extension) debugging is now supported on AArch64
	    baremetal.
        New bash script gstack uses GDB to print stack traces of running
	    processes.
        Enhanced breakpoint support
            For breakpoints that are created in the 'pending' state, any
	    'thread' or 'task' keywords are parsed at the time the breakpoint
	    is created, rather than at the time the breakpoint becomes
	    non-pending.

            Thread-specific breakpoints are only inserted into the program
	    space in which the thread of interest is running.
        Enhanced Intel Processor Trace support
            Support for printing of asynchronous events
            Support for printing of ptwrite payloads
        Changed commands
            The "remove-symbol-file -a ADDRESS" command now accepts a full
	    expression as the ADDRESS.

            The "show configuration" command now prints the version of GNU
	    readline that GDB is using.

            The "maintenance print remote-registers" now provides an
	    "Expedited" column indicating which registers were included in
	    the last stop reply packet received by GDB.

            Various command taking filenames as argument now require file
	    names to be quoted if the argument contains white spaces or
	    quote characters.
        Python API changes
	    New module gdb.missing_objfile that facilitates dealing
	    with missing objfiles when opening a core-file. GDB
	    commands to query, enable and disable handlers created
	    using this API have also been added.

            New event gdb.tui_enabled.

            Added the gdb.Symbol.is_artificial attribute.

	    New gdb.record.clear function to clear the trace data
	    of the current recording.

	    The 'signed' argument to gdb.Architecture.integer_type()
	    will no longer accept non-bool types.

	    The gdb.MICommand.installed property can only be set
	    to True or False.

	    The 'qualified' argument to gdb.Breakpoint constructor
	    will no longer accept non-bool types.

        Debugger Adapter Protocol changes
	    The "scopes" request will now return a scope holding
	    global variables from the stack frame's compilation
	    unit.

	    The "scopes" request will return a "returnValue" scope
	    holding the return value from the latest "stepOut"
	    command, when appropriate.

	    The "launch" and "attach" requests were rewritten in
	    accordance with some clarifications to the spec. Now
	    they can be sent at any time after the "initialized"
	    event, but will not take effect (or send a response)
	    until after the "configurationDone" request has been
	    sent.

            The "variables" request will not return artificial symbols.
        Remote Protocol
            New remote packet: vFile:stat
            New remote packet: x addr,length
        Miscellaneous
            The Ada 'Object_Size attribute is now supported.

            Styling now available for line numbers, GDB commands and header
	    lines of lists.

            It is now possible to turn the warning emitted when specifying a
	    language that does not match the current frame off.

	    For ARM targets, the offset of the pc in the jmp_buf
	    has been fixed to match glibc 2.20 and later. This
	    should only matter when not using libc probes. This
	    may cause breakage when using an incompatible libc,
	    like uclibc or newlib, or an older glibc.
        Deprecated or removed
            Support for QNX Neutrino has been removed
            Support for Nios II targets has been removed
            Support for Intel MPX has been removed

    See the NEWS file for a more complete and detailed list of what this
    release includes.

December 29th, 2024: GDB 16 branch created

    The GDB 16 branch (gdb-16-branch) has been created. To check out a copy
    of the branch use:

    git clone --branch gdb-16-branch https://sourceware.org/git/binutils-gdb.git

September 29th, 2024: GDB 15.2 Released!

    The latest version of GDB, version 15.2, is available for download.

    This is a minor corrective release over GDB 15.1, fixing the
    following issues:

        PR gdb/31727 (-exec-next fails in mingw (infrun.c:2794:
	    internal-error: resume_1: Assertion `pc_in_thread_step_range
	    (pc, tp)' failed))
        PR c++/31900 (libstdc++-prettyprinters/debug.cc print redirected fails
	    since gdb-14-branchpoint-2123-g4e417d7bb1c)
        PR python/31946 (sys.exit from Python no longer exits the GDB process)
        PR record/31971 (Loading a saved record file asserts if we try to
	    execute the inferior)
        PR gdb/32005 (frv_current_sos doesn't set solib::lm_info)
        PR exp/32015 (GDB crashes while printing large D array)
        PR gdb/32025 (Fatal error when the disassemble command is interrupted
	    with SIGINT)
        PR gdb/32143 ([15 Regression] arch/amd64.c:71: internal-error:
	    amd64_create_target_description: Assertion `!is_x32' failed)
        PR symtab/32158 ([gdb/symtab] enum class enumerator has incorrect
	    parent in cooked index)
        PR symtab/32160 ([gdb/symtab] Parent map: die parent or scope parent?)

    See the NEWS file for a more complete and detailed list of what this
    release includes.
@
text
@d350 1
a350 1
; Test CPR against an immediate value
@

