Karl Berry | 3 Jan 03:18 2011

u+1 no longer?

Umpteen years ago, I used to be able to type
as a gdb command, and it would be interpreted as "until +1", since it
couldn't mean anything else. At some point this turned into an error,
"Undefined command".

It seems there is no way to actually define such a command, e.g.,
"define u+1" in .gdbinit gets "Junk in argument list".

Maybe there's a better way to do this now, but I seem to use that
command an awful lot, namely to step through a loop the first time and
then "until" beyond the loop instead of stepping through again.

Clearly it's not a big deal, but since the space is seemingly
unnecessary and useless, I'd just as soon not have to type it.

Can the old intuitive behavior be restored?  Or, alternatively, if a u+1
command could be defined, that'd be good too.


sujoy saraswati | 21 Jan 07:40 2011

Use case for ftag register modification on X86-64

Hi all,
 On X86-64 architectures, (reference Intel 64 and IA-32 architectures software 
developer manual, volume 1, section 8.1.7 
 http://www.intel.com/Assets/PDF/manual/253665.pdf ), the X87 FPU tag word 
description has the folowing comment -
"Software cannot directly load or modify the tags in the tag register. The 
FRSTOR instructions load an image of the tag register into the x87 FPU; however, 
x87 FPU uses those tag values only to determine if the data registers are empty
(11B) or non-empty (00B, 01B, or 10B)."
 However, using a gdb, I can change the ftag register value. I used gdb 6.8, the 
session output is given below.
  I have few questions -
1) Is it right for gdb users to be allowed to change ftag, given the restriction 
stated in the Intel document ?
2) What would be a use case for someone to change the ftag value in a debugging 
session ? I mean, when do gdb users see a need to change ftag value ?
3) When I change the register value from gdb, the ftag value change is not 
always what I give (see example output below). Is the kernel ptrace code 
validating the value before seting the ftag value ?
[sujoys <at> abacus][~][501]$ gdb gdb/mnbn/vla_linux
GNU gdb Fedora (6.8-37.el5)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
(Continue reading)