From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 908703857815; Tue, 19 Jul 2022 02:46:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 908703857815 From: "yuan.bian at windriver dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/29380] New: single step into syscall function will result in program continue in ppc64 Date: Tue, 19 Jul 2022 02:46:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 12.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: yuan.bian at windriver dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2022 02:46:12 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29380 Bug ID: 29380 Summary: single step into syscall function will result in program continue in ppc64 Product: gdb Version: 12.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: yuan.bian at windriver dot com Target Milestone: --- For PPC64 vxworks platform, we use gdb remote debug. Single 'step' into sys= call like '_close' will act as 'continue' which result in inferior exit. Here is disassemble code fragment for _close plt and _close syscall. (gdb) disassemble 0x780000055bc0 Dump of assembler code for function 0000001a.plt_call._close: 0x0000780000055bc0 <+0>: std r2,24(r1) 0x0000780000055bc4 <+4>: ld r12,-20384(r2) 0x0000780000055bc8 <+8>: mtctr r12 0x0000780000055bcc <+12>: bctr 0x0000780000055bd0 <+16>: .long 0x0 0x0000780000055bd4 <+20>: .long 0x0 0x0000780000055bd8 <+24>: .long 0x0 0x0000780000055bdc <+28>: .long 0x0 (gdb) disassemble _close Dump of assembler code for function _close: 0x0000780000056998 <+0>: addis r2,r12,16 0x000078000005699c <+4>: addi r2,r2,5480 0x00007800000569a0 <+8>: li r0,515 0x00007800000569a4 <+12>: sc 0x00007800000569a8 <+16>: cmpwi r3,-1 0x00007800000569ac <+20>: bnelr 0x00007800000569b0 <+24>: b 0x7800000db700 End of assembler dump. When step into _close at this source location (line #543),=20 (gdb)=20 543 value =3D _close (fd); Remote message dump: ... [remote] Sending packet: $Z0,7800000569a0,4#aa [remote] Packet received: OK [remote] Sending packet: $vCont;c:p1.-1#0f [remote] wait: enter [remote] Packet received: T05thread:p1.1;swbreak:; [remote] wait: exit [remote] Sending packet: $g#67 [remote] Packet received: 000078000008c0a00000000000204e000000780000157f00ffffffffffffffff00000000002= 220e000000000002220e0000000000000000000000000000000000000000000000000000000= 00000000000000000000204e100000000000000000000078000005699800000000002290a00= 00000000000000000000000000000000000000000000 ... [remote] Sending packet: $Z0,780000056998,4#8a [remote] Packet received: OK [remote] Sending packet: $vCont;c:p1.-1#0f [remote] wait: enter [remote] Packet received: T05thread:p1.1;swbreak:; [remote] wait: exit As you see, GDB insert a temporary BP at 0x00007800000569a0 (the third instruction for syscall _close as GDB skip plt trampoline and local entry 8byte) and then program stop here (PC=3D0x00007800000569a0). But after that, GDB insert another temporary BP at 0x0000780000056998 (the first instruction for syscall _close) which result in inferior continue and exit as the BP location can't be hit anymore. Above same scenario is working for IA64. --=20 You are receiving this mail because: You are on the CC list for the bug.=