This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
tdep/1503: hppa-tdep recognition of std-with-modify is busted
- From: mec dot gnu at mindspring dot com
- To: gdb-gnats at sources dot redhat dot com
- Cc: dave at hiauly1 dot hia dot nrc dot ca
- Date: 9 Jan 2004 03:13:53 -0000
- Subject: tdep/1503: hppa-tdep recognition of std-with-modify is busted
- Reply-to: mec dot gnu at mindspring dot com
>Number: 1503
>Category: tdep
>Synopsis: hppa-tdep recognition of std-with-modify is busted
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jan 09 03:18:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: mec.gnu@mindspring.com
>Release: gdb 6.0
>Organization:
>Environment:
target = native, host = hppa2.0-hp-hpux11.11
>Description:
This code has a problem:
hppa_frame_find_saved_regs
...
/* A std has explicit post_modify_forms. */
else if ((inst & 0xfc00000c0) == 0x70000008)
frame_saved_regs[reg] = get_frame_base (frame_info);
else
...
The problem is that "0xfc00000c0" is 9 hex digits long. gcc 3.3.2 throws a warning (but gcc 3.2-7-rh does not) and the code turns into an "if (0)".
This code was introduced in hppa-tdep.c version 1.1.1.10 on 1999-08-31.
>How-To-Repeat:
That is tough. It doesn't happen with HP ansi c and HP aCC on my test system, using a gcov'ed version of gdb on the whole test suite.
>Fix:
Don't just change the instruction. That "if" test is way suspicious. There are two forms of std, and it handles only one form. It doesn't handle non-zero immediate displacemnts. The code in the "else" actually probably does a better job.
Someone who knows their way around pa-risc instruction set and the ABI has to look at this. That might be me, in the future.
PA-RISC instruction set:
http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,2533,00.html
page 7-136 (page 138 in chapter 7 of the PDF)
>Release-Note:
>Audit-Trail:
>Unformatted: