bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Program received signal SIGTRAP, Trace/breakpoint ...


From: David Xu
Subject: Program received signal SIGTRAP, Trace/breakpoint ...
Date: Wed, 07 Jul 2004 14:33:23 +0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1

I am writting pthread target module for FreeBSD 5,  I have patch for
gdb 5.2, that works fine, but because recently they imported gdb 6.1
into tree, I have updated my patch for gdb 6.1, and found it does not
work well,  when debugging a threaded process, I always get message
"Program received signal SIGTRAP, Trace/breakpoint ", <http://sources.redhat.com/ml/gdb/2003-05/msg00239.html>
and if I type "next", program crashes with SIGSEGV.
Deeply digging into gdb 6.1 source code, found that in file
infrun.c, function adjust_pc_after_break() sometimes does not
adjust pc, this happens when a new thread hits a breakpoint after
'next' command,
in the case, the following condition are true in adjust_pc_after_break() :
 software_breakpoint_inserted_here_p (stop_pc)
 currently_stepping (ecs)
 prev_pc != stop_pc
 step_range_end
the following condition is false:
  INNER_THAN (read_sp (), (step_sp - 16))

If I remove 'INNER_THAN' from the function, everything works again,
is the INNER_THAN condition meanful for new thread while inferior_ptid
is still referencing the previous waited ptid ?

David Xu






reply via email to

[Prev in Thread] Current Thread [Next in Thread]