exp/1926: Info registers command produces no output for "standard register names"

fnf@specifixinc.com fnf@specifixinc.com
Mon Apr 25 14:38:00 GMT 2005


>Number:         1926
>Category:       exp
>Synopsis:       Info registers command produces no output for "standard register names"
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          patch
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 25 14:38:01 UTC 2005
>Closed-Date:
>Last-Modified:
>Originator:     fnf@specifixinc.com
>Release:        head of development tree
>Organization:
>Environment:
i686-pc-linux-gnu for example, but affects all
>Description:
The "info register sp" command prints no output of any kind,
not even a message that this is not supported.  Same thing for the other "user registers" (fp, pc, ps).
>How-To-Repeat:
Run any executable to a breakpoint and try "info register sp".

(gdb) br main
Breakpoint 1 at 0x8048350: file t.c, line 3.
(gdb) run
Starting program: /links/build/sourceware/gdb/i686-pc-linux-gnu/gdb/t

Breakpoint 1, main () at t.c:3
3       }
(gdb) info register sp
(gdb) info register esp
esp            0xbffff5d0       0xbffff5d0
(gdb)
>Fix:
The attached patch fixes the problem, but may or may not be the best way to deal with the issue.  Perhaps gdb should simply say that info registers only supports printing using the canonical mnemonics for registers (to use the terms in the gdb documentation).
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="gdb.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gdb.diff"

SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvY3ZzL3NyYy9zcmMvZ2RiL0No
YW5nZUxvZyx2CnJldHJpZXZpbmcgcmV2aXNpb24gMS43MDg2CmRpZmYgLWMgLXAgLXIxLjcwODYg
Q2hhbmdlTG9nCioqKiBDaGFuZ2VMb2cJMjIgQXByIDIwMDUgMTk6NTI6MTcgLTAwMDAJMS43MDg2
Ci0tLSBDaGFuZ2VMb2cJMjUgQXBy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CioqKioqKioqKioqKioqKgoqKiogNDYsNTEgKioq
KgotLS0gNDYsNTIgLS0tLQogICNpbmNsdWRlICJibG9jay5oIgogICNpbmNsdWRlIDxjdHlwZS5o
PgogICNpbmNsdWRlICJnZGJfYXNzZXJ0LmgiCisgI2luY2x1ZGUgInVzZXItcmVncy5oIgogIAog
IC8qIEZ1bmN0aW9ucyBleHBvcnRlZCBmb3IgZ2VuZXJhbCB1c2UsIGluIGluZmVyaW9yLmg6ICov
CiAgCioqKioqKioqKioqKioqKiBkZWZhdWx0X3ByaW50X3JlZ2lzdGVyc19pbmZvIChzdHJ1Y3Qg
Z2RiCioqKiAxNTI1LDE1MzAgKioqKgotLS0gMTUyNiwxNTM4IC0tLS0KICAgIGNvbnN0IGludCBu
dW1yZWdzID0gTlVNX1JFR1MgKyBOVU1fUFNFVURPX1JFR1M7CiAgICBjaGFyIGJ1ZmZlcltNQVhf
UkVHSVNURVJfU0laRV07CiAgCisgICAvKiBJZiB0aGlzIGlzIGEgdXNlciByZWdpc3RlciwgdHJ5
IHRvIHByaW50IGl0ICovCisgICBpZiAocmVnbnVtID49IG51bXJlZ3MpCisgICAgIHsKKyAgICAg
ICBkZWZhdWx0X3ByaW50X3VzZXJfcmVnaXN0ZXJzX2luZm8gKGdkYmFyY2gsIGZpbGUsIGZyYW1l
LCByZWdudW0pOworICAgICAgIHJldHVybjsKKyAgICAgfQorIAogICAgZm9yIChpID0gMDsgaSA8
IG51bXJlZ3M7IGkrKykKICAgICAgewogICAgICAgIC8qIERlY2lkZSBiZXR3ZWVuIHByaW50aW5n
IGFsbCByZWdzLCBub24tZmxvYXQgLyB2ZWN0b3IgcmVncywgb3IKSW5kZXg6IHVzZXItcmVncy5j
Cj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT0KUkNTIGZpbGU6IC9jdnMvc3JjL3NyYy9nZGIvdXNlci1yZWdzLmMsdgpyZXRy
aWV2aW5nIHJ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