gdb
[Top][All Lists]
Advanced

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

[Gdb] stepping problem with sh4, gdbserver


From: peter garrone
Subject: [Gdb] stepping problem with sh4, gdbserver
Date: Wed, 02 Feb 2005 14:51:44 +0800

Hi,
 While debugging remotely with gdbserver and stepping the gdb (6.3) test 
program "break.c" at line 96, the "next" command causes a segfault at frame.c 
line 1244 (frame->next != NULL) because frame is null. The relevant backtrace 
is:

get_frame_pc(frame = 0)  frame.c:1244
insert_step_resume_breakpoint_at_frame(return_frame=0) infrun.c:2670
handle_inferior_event infrun.c:2449
wait_for_inferior infrun.c:991

Tracing the execution of gdb itself, handle_inferior_event is invoked one 
instruction before and then at the point of calling the function marker1, 
according to the value of stop_pc at infrun.c:1547. This second invocation of 
handle_inferior_event inserts a breakpoint at the return point (stop_pc + 4) 
and returns. Then handle_inferior_event is invoked again, this time stop_pc is 
set to the address of the very first instruction of the marker1 function. The 
test at infrun.c:2285 if(frame_id_eq(.....)) returns true and the block 
following  is taken.
Execution proceeds to line 2449 
"insert_step_resume_breakpoint_at_frame(get_prev_frame(get_current_frame())" 
where the error occurs.

I dont understand why gdb would set a breakpoint in marker1 when it is stepping 
over the function. At the first instruction of marker1, the stack would still 
be unchanged from its value in the top function, since the sh4 does not change 
the stack when it calls a subroutine, so perhaps this has something to do with 
it.

I am using gdb 6.3, but have seen a similar error on previous versions. 
Configuration is for sh4-xxx-linux-gnu, gdb_target=linux, --enable-shared, 
--enable-threads
The only relevant source change is an include in gdbserver/linux-sh-low.c where 
#include <sys/reg.h> is commented out.

Any help appreciated.
Peter Garrone
-- 
______________________________________________
Check out the latest SMS services @ http://www.linuxmail.org 
This allows you to send and receive SMS through your mailbox.


Powered by Outblaze




reply via email to

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