* Question about adding a new option vs extending an existing one
@ 2026-04-29 12:45 Zander Work via Gdb
2026-04-29 14:40 ` Guinevere Larsen via Gdb
0 siblings, 1 reply; 3+ messages in thread
From: Zander Work via Gdb @ 2026-04-29 12:45 UTC (permalink / raw)
To: gdb
Hello,
I'm interested in writing a patch for GDB which allows a user to change the radix used for displaying function offsets in instruction listings (example below), right now it only uses decimal, and doesn't respect the existing radix settings (either `radix` or `output-radix`).
I want to contribute a patch that allows the user to change the radix used for displaying these offsets, but I'm not sure if it would be best to re-use the value of `output-radix`, or to define a new setting (eg, `offset-radix` maybe).
Additionally, if a new option should be added, would it be appropriate to have `set radix` also set that new one (I would assume yes).
Does anyone have any opinions on this? My personal feeling is that reusing `output-radix` would be best.
---
(gdb) set radix 16
Input and output radices now set to decimal 16, hex 10, octal 20.
(gdb) x/8i $rip
=> 0x7ffff7fe0c00 <_start>: mov %rsp,%rdi
0x7ffff7fe0c03 <_start+3>: call 0x7ffff7fe1750 <_dl_start>
0x7ffff7fe0c08 <_dl_start_user>: mov %rax,%r12
0x7ffff7fe0c0b <_dl_start_user+3>: mov %rsp,%r13
0x7ffff7fe0c0e <_dl_start_user+6>: mov 0x1cb9c(%rip),%edx # 0x7ffff7ffd7b0 <_rtld_global+1968>
0x7ffff7fe0c14 <_dl_start_user+12>: test $0x2,%edx
0x7ffff7fe0c1a <_dl_start_user+18>: je 0x7ffff7fe0c2d <_dl_start_user+37>
0x7ffff7fe0c1c <_dl_start_user+20>: mov $0x1,%esi
^^ i am referring to these offsets
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Question about adding a new option vs extending an existing one
2026-04-29 12:45 Question about adding a new option vs extending an existing one Zander Work via Gdb
@ 2026-04-29 14:40 ` Guinevere Larsen via Gdb
2026-04-30 15:46 ` Zander Work via Gdb
0 siblings, 1 reply; 3+ messages in thread
From: Guinevere Larsen via Gdb @ 2026-04-29 14:40 UTC (permalink / raw)
To: Zander Work, gdb
On 4/29/26 9:45 AM, Zander Work via Gdb wrote:
> Hello,
>
> I'm interested in writing a patch for GDB which allows a user to change the radix used for displaying function offsets in instruction listings (example below), right now it only uses decimal, and doesn't respect the existing radix settings (either `radix` or `output-radix`).
>
> I want to contribute a patch that allows the user to change the radix used for displaying these offsets, but I'm not sure if it would be best to re-use the value of `output-radix`, or to define a new setting (eg, `offset-radix` maybe).
>
> Additionally, if a new option should be added, would it be appropriate to have `set radix` also set that new one (I would assume yes).
>
> Does anyone have any opinions on this? My personal feeling is that reusing `output-radix` would be best.
In this case, based on how "set radix" is described in the manual, I
think this is actually a bug and the offset should already be using the
specified (output-)radix, so I guess I am with you on the opinion, but
from the POV that it should already be happening and you're fixing a
bug, not that it is a feature being extended
--
Cheers,
Guinevere Larsen
It/she
>
> ---
>
> (gdb) set radix 16
> Input and output radices now set to decimal 16, hex 10, octal 20.
> (gdb) x/8i $rip
> => 0x7ffff7fe0c00 <_start>: mov %rsp,%rdi
> 0x7ffff7fe0c03 <_start+3>: call 0x7ffff7fe1750 <_dl_start>
> 0x7ffff7fe0c08 <_dl_start_user>: mov %rax,%r12
> 0x7ffff7fe0c0b <_dl_start_user+3>: mov %rsp,%r13
> 0x7ffff7fe0c0e <_dl_start_user+6>: mov 0x1cb9c(%rip),%edx # 0x7ffff7ffd7b0 <_rtld_global+1968>
> 0x7ffff7fe0c14 <_dl_start_user+12>: test $0x2,%edx
> 0x7ffff7fe0c1a <_dl_start_user+18>: je 0x7ffff7fe0c2d <_dl_start_user+37>
> 0x7ffff7fe0c1c <_dl_start_user+20>: mov $0x1,%esi
> ^^ i am referring to these offsets
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question about adding a new option vs extending an existing one
2026-04-29 14:40 ` Guinevere Larsen via Gdb
@ 2026-04-30 15:46 ` Zander Work via Gdb
0 siblings, 0 replies; 3+ messages in thread
From: Zander Work via Gdb @ 2026-04-30 15:46 UTC (permalink / raw)
To: Guinevere Larsen; +Cc: gdb
Cool, that makes sense! Patch (hopefully) coming soon for this.
-Zander
On Wednesday, April 29th, 2026 at 10:40 AM, Guinevere Larsen <guinevere@redhat.com> wrote:
> On 4/29/26 9:45 AM, Zander Work via Gdb wrote:
> > Hello,
> >
> > I'm interested in writing a patch for GDB which allows a user to change the radix used for displaying function offsets in instruction listings (example below), right now it only uses decimal, and doesn't respect the existing radix settings (either `radix` or `output-radix`).
> >
> > I want to contribute a patch that allows the user to change the radix used for displaying these offsets, but I'm not sure if it would be best to re-use the value of `output-radix`, or to define a new setting (eg, `offset-radix` maybe).
> >
> > Additionally, if a new option should be added, would it be appropriate to have `set radix` also set that new one (I would assume yes).
> >
> > Does anyone have any opinions on this? My personal feeling is that reusing `output-radix` would be best.
>
> In this case, based on how "set radix" is described in the manual, I
> think this is actually a bug and the offset should already be using the
> specified (output-)radix, so I guess I am with you on the opinion, but
> from the POV that it should already be happening and you're fixing a
> bug, not that it is a feature being extended
>
> --
> Cheers,
> Guinevere Larsen
> It/she
>
> >
> > ---
> >
> > (gdb) set radix 16
> > Input and output radices now set to decimal 16, hex 10, octal 20.
> > (gdb) x/8i $rip
> > => 0x7ffff7fe0c00 <_start>: mov %rsp,%rdi
> > 0x7ffff7fe0c03 <_start+3>: call 0x7ffff7fe1750 <_dl_start>
> > 0x7ffff7fe0c08 <_dl_start_user>: mov %rax,%r12
> > 0x7ffff7fe0c0b <_dl_start_user+3>: mov %rsp,%r13
> > 0x7ffff7fe0c0e <_dl_start_user+6>: mov 0x1cb9c(%rip),%edx # 0x7ffff7ffd7b0 <_rtld_global+1968>
> > 0x7ffff7fe0c14 <_dl_start_user+12>: test $0x2,%edx
> > 0x7ffff7fe0c1a <_dl_start_user+18>: je 0x7ffff7fe0c2d <_dl_start_user+37>
> > 0x7ffff7fe0c1c <_dl_start_user+20>: mov $0x1,%esi
> > ^^ i am referring to these offsets
> >
> >
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-30 15:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-29 12:45 Question about adding a new option vs extending an existing one Zander Work via Gdb
2026-04-29 14:40 ` Guinevere Larsen via Gdb
2026-04-30 15:46 ` Zander Work via Gdb
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox