Bug 18605

Summary: single step over ARM Cortex 'udiv' instruction
Product: gdb Reporter: Mikhail I. Krivtsov <m.krivtsov>
Component: tdepAssignee: Yao Qi <qiyao>
Status: RESOLVED FIXED    
Severity: normal CC: kinetik, qiyao, ramana.radhakrishnan, rearnsha
Priority: P2    
Version: HEAD   
Target Milestone: 7.10   
Host: Target:
Build: Last reconfirmed:
Project(s) to access: ssh public key:
Attachments: test case
test case log

Description Mikhail I. Krivtsov 2015-06-26 08:58:10 UTC
While hunting for bug in application on ARM development board I met strange GDB behavior - it fails to single step over 'udiv' instruction complaining about memory access failure:

> Cannot access memory at address 0xffffffd3
Comment 1 Mikhail I. Krivtsov 2015-06-26 08:59:59 UTC
Created attachment 8395 [details]
test case

armv7l-tizen-linux-gnueabi-gcc -O0 -Wall -Wextra -o udiv-test udiv-test.c -save-temps -g
Comment 2 Mikhail I. Krivtsov 2015-06-26 09:00:45 UTC
Created attachment 8396 [details]
test case log
Comment 3 Yao Qi 2015-06-26 14:52:31 UTC
GDB doesn't handle this instruction correctly during software single step.  I'll take a look.
Comment 4 Yao Qi 2015-06-29 16:33:51 UTC
Patch is posted here https://sourceware.org/ml/gdb-patches/2015-06/msg00610.html
Comment 5 Sourceware Commits 2015-06-30 08:26:02 UTC
The master branch has been updated by Yao Qi <qiyao@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7b9be803fed8f500b512d5685773c84fffcdf63f

commit 7b9be803fed8f500b512d5685773c84fffcdf63f
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Jun 30 09:24:43 2015 +0100

    Handle media instructions in arm software single step.
    
    This patch fixes PR 18605 which is about incorrectly decoding media
    instructions in software single step.
    
    gdb:
    
    2015-06-30  Yao Qi  <yao.qi@linaro.org>
    
    	PR tdep/18605
    	* arm-tdep.c (arm_get_next_pc_raw): Break for media
    	instructions.
Comment 6 Yao Qi 2015-06-30 08:47:43 UTC
Patch is pushed in.  Close this bug.