This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] enable software single step on alpha-osf


One of our customers who is using multi-processor alpha-osf machines
has informed us that the next/step operations do not function correctly
on their machine.

Among other things, they saw messages like these:
       
       Program received signal SIGSEGV, Segmentation fault
       <__gnat_malloc> (size=8208) at s-memory.adb:92

or

       Program received signal SIGTRAP, Trace/breakpoint trap.
       0x1201ee89c in mate.types.data....

or sometimes the behavior of the program becomes odd, and the
debugger stops at a bizarre location...

It turned out that procfs does not seem to be handling multi-cpu machines
very well, as far as next/step operations are concerned. We could not
test this ourselves, because we don't have a multi-cpu alpha-osf
machine, but as soon as we enabled the software-single-step capability,
most these problems were gone...

Other problems surfaced, however. The SIGSEGVs and the SIGTRAPs
disappeared, but "next" sometimes stopped at the wrong location.

The following patch enables software single stepping. It also fixes
all the problems I found when comparing the testsuite results before and
after the switch. The test results are now identical before and after my
changes. For the record, here is a summary of the results I get:

        # of expected passes            7246
        # of unexpected failures        680
        # of unexpected successes       5
        # of expected failures          149
        # of unresolved testcases       59
        # of untested testcases         3
        # of unsupported tests          2

I also verified on a linux machine, where software
single-stepping is not enabled, that no regression was introduced.

It would be interesting to see how this change influences the results
of alpha-netbsd. It should improve them.

Ok to commit?

2002-07-18  Joel Brobecker  <brobecker@gnat.com>

        * alpha-osf1-tdep.c (alpha_osf1_init_abi): Unfortunately,
        procfs appears to be broken when debugging on multi-processor
        machines. So enable software single stepping in order to avoid
        using the procfs interface to do next/step operations, using
        internal breakpoints instead.

        * infrun.c (handle_inferior_event): When receiving a SIGTRAP
        signal, check whether we hit a breakpoint before checking for a
        single step breakpoint. Otherwise, GDB fails to notice that a
        breakpoint has been hit when stepping onto a breakpoint.
        Readjust the stop_pc by DECR_PC_AFTER_BREAK when hitting a
        single step breakpoint, to make this pc address equal to the
        value it would have if the system stepping capability was used.

        * breakpoint.c (bpstat_stop_status): Do not adjust the PC
        address by DECR_PC_AFTER_BREAK when software single step is
        in use for this architecture, as this has already been taken
        care of in handle_inferior_event().

-- 
Joel

Attachment: sw_single_step.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]