ps macros from debugscripts print correct proc address on i386, but print only half of address on amd64 How-To-Repeat: on amd64 host: # cd/usr/obj/usr/src/sys/GENERIC # make gdbinit # kgdb kernel.debug /dev/mem (kgdb) ps During symbol reading, Incomplete CFI data; unspecified registers at 0xffffffff805479c9. pid proc uid ppid pgrp flag stat comm wchan 76791 57d01000 1001 75925 31548 10004002 1 inkscape 76789 042978b0 0 35574 76789 10004002 1 kgdb ... (kgdb) p *(struct proc*) 0x042978b0 Error accessing memory address 0x42978b0: Bad address.
> >Fix: > --- tools/debugscripts/gdbinit.kernel.orig 2009-04-16 14:09:42.000000000 +0400 > +++ tools/debugscripts/gdbinit.kernel 2009-04-16 15:33:52.000000000 +0400 > @@ -199,7 +199,7 @@ > set $nproc = nprocs > set $aproc = allproc.lh_first > set $proc = allproc.lh_first > - printf " pid proc uid ppid pgrp flag stat comm wchan\n" > + printf " pid proc uid ppid pgrp flag stat comm wchan\n" > while (--$nproc >= 0) > set $pptr = $proc.p_pptr > if ($pptr == 0) > @@ -208,7 +208,7 @@ > if ($proc.p_state) > set $thread = $proc->p_threads.tqh_first > while ($thread) > - printf "%5d %08x %4d %5d %5d %06x %d %-10s ", \ > + printf "%5d %18p %4d %5d %5d %06x %d %-10s ", \ > $proc.p_pid, $aproc, \ > $proc.p_ucred->cr_ruid, $pptr->p_pid, \ > $proc.p_pgrp->pg_id, $proc.p_flag, $proc.p_state, \ It makes kgdb output on i386 system looks ugly. Is there a way to make gdbinit platform aware? -- Maxim Konovalov
> It makes kgdb output on i386 system looks ugly. Is there a way to > make gdbinit platform aware? Simplest way is to have 2 slightly different variants of ps macro - in gdbinit.i386 and default in gdbinit.kernel But copy-paste is not good way in this case. -- Anton Yuzhaninov
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>