public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/29380] New: single step into syscall function will result in program continue in ppc64
@ 2022-07-19  2:46 yuan.bian at windriver dot com
  2022-07-19  2:47 ` [Bug gdb/29380] " yuan.bian at windriver dot com
  2022-07-19  2:50 ` [Bug tdep/29380] " yuan.bian at windriver dot com
  0 siblings, 2 replies; 3+ messages in thread
From: yuan.bian at windriver dot com @ 2022-07-19  2:46 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29380

            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 syscall
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 <syscallErrorExit+8>
End of assembler dump.

When step into _close at this source location (line #543), 
(gdb) 
543         value = _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:
000078000008c0a00000000000204e000000780000157f00ffffffffffffffff00000000002220e000000000002220e000000000000000000000000000000000000000000000000000000000000000000000000000204e100000000000000000000078000005699800000000002290a0000000000000000000000000000000000000000000000
...
[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=0x00007800000569a0).
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug gdb/29380] single step into syscall function will result in program continue in ppc64
  2022-07-19  2:46 [Bug gdb/29380] New: single step into syscall function will result in program continue in ppc64 yuan.bian at windriver dot com
@ 2022-07-19  2:47 ` yuan.bian at windriver dot com
  2022-07-19  2:50 ` [Bug tdep/29380] " yuan.bian at windriver dot com
  1 sibling, 0 replies; 3+ messages in thread
From: yuan.bian at windriver dot com @ 2022-07-19  2:47 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29380

yuan.bian at windriver dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|12.1                        |unknown

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tdep/29380] single step into syscall function will result in program continue in ppc64
  2022-07-19  2:46 [Bug gdb/29380] New: single step into syscall function will result in program continue in ppc64 yuan.bian at windriver dot com
  2022-07-19  2:47 ` [Bug gdb/29380] " yuan.bian at windriver dot com
@ 2022-07-19  2:50 ` yuan.bian at windriver dot com
  1 sibling, 0 replies; 3+ messages in thread
From: yuan.bian at windriver dot com @ 2022-07-19  2:50 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29380

yuan.bian at windriver dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|gdb                         |tdep

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-19  2:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19  2:46 [Bug gdb/29380] New: single step into syscall function will result in program continue in ppc64 yuan.bian at windriver dot com
2022-07-19  2:47 ` [Bug gdb/29380] " yuan.bian at windriver dot com
2022-07-19  2:50 ` [Bug tdep/29380] " yuan.bian at windriver dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).