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]

Re: [patch/rfc] Use insert_step_resume_breakpoint everywhere


   Date: Tue, 11 May 2004 19:29:56 -0400
   From: Andrew Cagney <cagney@gnu.org>

   Further testing revealed an additional bug in this assertion (next vs 
   nexti) vis:

   +  /* Remember, if the call instruction is the last in the step range,
   +     the breakpoint will land just beyond that.  Hence ``<=
   +     step_range_end''.  Also, ignore check when "nexti".  */
   +  gdb_assert (step_range_start == step_range_end
   +             || (get_frame_pc (step_frame) >= step_range_start
   +                 && get_frame_pc (step_frame) <= step_range_end));

   So I've tweaked that and checked it in.

   Andrew

   > 2004-05-10  Andrew Cagney  <cagney@redhat.com>
   > 
   > 	* infrun.c (step_over_function): Delete function.
   > 	(handle_step_into_function): Use insert_step_resume_breakpoint.
   > 	(insert_step_resume_breakpoint): Fix assertion.
   > 

This patch, or one of your other patches breaks FreeBSD signal
trampoline handling.  I now get:

32      } /* handler */
1: x/i $pc  0x8048545 <handler+13>:     leave  
(gdb) step
../../src/gdb/infrun.c:2672: internal-error: insert_step_resume_breakpoint: Asse
rtion `frame_id_eq (step_frame_id, get_frame_id (step_frame))' failed.
A problem internal to GDB has been detected,
FAIL: gdb.base/siginfo.exp: step out of handler (GDB internal error)

when running the testsuite.  Looks like we're setting a step-resume
breakpoint when one is already set.  The backtrace at this point is:

#0  internal_error (file=0x81b9f76 "../../src/gdb/infrun.c", line=2672, 
    string=0x81b9ff5 "%s: Assertion `%s' failed.") at ../../src/gdb/utils.c:836
#1  0x080b6e9a in insert_step_resume_breakpoint (step_frame=0x825e0fc, 
    ecs=0xbfbfef5c) at ../../src/gdb/infrun.c:2672
#2  0x080b5783 in handle_step_into_function (ecs=0xbfbfef5c)
    at ../../src/gdb/infrun.c:1253
#3  0x080b6a00 in handle_inferior_event (ecs=0xbfbfef5c)
    at ../../src/gdb/infrun.c:2420
#4  0x080b52e0 in wait_for_inferior () at ../../src/gdb/infrun.c:1022
#5  0x080b515b in proceed (addr=4294967295, siggnal=TARGET_SIGNAL_DEFAULT, 
    step=1) at ../../src/gdb/infrun.c:841
#6  0x080b2956 in step_1 (skip_subroutines=0, single_inst=0, count_string=0x0)
    at ../../src/gdb/infcmd.c:661
#7  0x080b26ed in step_command (count_string=0x0, from_tty=1)
    at ../../src/gdb/infcmd.c:549

The value of step_frame_id indicates that we were stepping in handler,
and then try to set a step-resume breakpoint in main.  It might be
relevant to note that on FreeBSD, the signal trampoline calls the
handler, and that signal trampoline is provided by the kernel so we
don't have debug info for it.

Mark


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