gdb/20: record_text_segment_lowaddr has precedence screw (hpux 64)
Tue Feb 13 18:38:00 GMT 2001

>Number:         20
>Category:       gdb
>Synopsis:       record_text_segment_lowaddr has precedence screw (hpux 64)
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 13 18:38:00 PST 2001
>Originator:     Michael Chastain
>Release:        CVS 2001-02-12
hpux 64 bit
File hppa_tdep.c function record_text_segment_lowaddr has a classic "a & b == b" operator precedence bug:

  if ((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY)

The code as written reduces to "section->flags & 1", the same as "section->flags & SEC_ALLOC".
This is not what the author meant.

This function is used only in hpux 64 bit mode.

I found this by noticing that gcc warned about it.
I haven't traced what happens when the code executes.

Build a configuration with hppa-tdep.c included and see gcc warning about it.
Any configuration, even a 32-bit configuration, will give the warning.
'(' ')'

Also decide whether SEC_ALLOC might really be what is intended!


More information about the Gdb-prs mailing list