问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

用vimgdb调试c++时候,当调试到cin语句要求输入时,gdb就卡在那里等待输入,请问这个问题有解决办法吗?谢

发布网友 发布时间:2022-04-11 23:45

我来回答

2个回答

懂视网 时间:2022-04-12 04:07

转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/18461845 发生read by other session 等待事件,肯定是两个会话同时物理读同一个数据块,假设有两个会话,会话1发生物理读,会话2正要去物理读发现会话1正在物读理产生,此时会话2发生等待,

转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/18461845

发生read by other session 等待事件,肯定是两个会话同时物理读同一个数据块,假设有两个会话,会话1发生物理读,会话2正要去物理读发现会话1正在物读理产生,此时会话2发生等待,此等待就是read by other session 等待事件。

实验步骤如下:

gyj@OCM> select spid from v$session s,v$process p where s.paddr=p.addr and sid in(select distinct sid from v$mystat);

SPID
------------------------
7376

2、刷新buffer cache,目的就是让select发生物理读

gyj@OCM> alter system flush buffer_cache;

System altered.

3、通过进程号7376,打开gdb

[oracle@mydb ~]$ gdb $ORACLE_HOME/bin/oracle 7376
GNU gdb Fedora (6.8-27.el5)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...
(no debugging symbols found)
Attaching to program: /u01/app/oracle/product/11.2.0/bin/oracle, process 7376
Reading symbols from /u01/app/oracle/product/11.2.0/lib/libodm11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/lib/libodm11.so
Reading symbols from /u01/app/oracle/product/11.2.0/lib/libcell11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/lib/libcell11.so
Reading symbols from /u01/app/oracle/product/11.2.0/lib/libskgxp11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/lib/libskgxp11.so
Reading symbols from /lib64/librt.so.1...done.
Loaded symbols for /lib64/librt.so.1
Reading symbols from /u01/app/oracle/product/11.2.0/lib/libnnz11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/lib/libnnz11.so
Reading symbols from /u01/app/oracle/product/11.2.0/lib/libclsra11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/lib/libclsra11.so
Reading symbols from /u01/app/oracle/product/11.2.0/lib/libdbcfg11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/lib/libdbcfg11.so
Reading symbols from /u01/app/oracle/product/11.2.0/lib/libhasgen11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/lib/libhasgen11.so
Reading symbols from /u01/app/oracle/product/11.2.0/lib/libskgxn2.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/lib/libskgxn2.so
Reading symbols from /u01/app/oracle/product/11.2.0/lib/libocr11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/lib/libocr11.so
Reading symbols from /u01/app/oracle/product/11.2.0/lib/libocrb11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/lib/libocrb11.so
Reading symbols from /u01/app/oracle/product/11.2.0/lib/libocrutl11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/lib/libocrutl11.so
Reading symbols from /usr/lib64/libaio.so.1...done.
Loaded symbols for /usr/lib64/libaio.so.1
Reading symbols from /lib64/libdl.so.2...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libm.so.6...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libpthread.so.0...done.
[Thread debugging using libthread_db enabled]
[New Thread 0x2b0b8fef0910 (LWP 7376)]
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/libnsl.so.1...done.
Loaded symbols for /lib64/libnsl.so.1
Reading symbols from /lib64/libc.so.6...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /usr/lib64/libnuma.so.1...done.
Loaded symbols for /usr/lib64/libnuma.so.1
Reading symbols from /lib64/libnss_files.so.2...done.
Loaded symbols for /lib64/libnss_files.so.2
Reading symbols from /u01/app/oracle/product/11.2.0/lib/libnque11.so...done.
Loaded symbols for /u01/app/oracle/product/11.2.0/lib/libnque11.so
0x0000003f0d40d290 in __read_nocancel () from /lib64/libpthread.so.0
(gdb) 

4、在会话1,执行select语句,此时select被阻塞

gyj@OCM> select * from gyj_test where id=1;

5、在gdb设断点,用等待事件的函数,并运行

(gdb) b kslwtbctx
Breakpoint 1 at 0x8f9a5c2
(gdb) c
Continuing.
6、查等待事件kslwtbctx函数的第一个参数,用命令info all-register显示寄存器
(gdb) info all-register
rax  0x62657100 1650815232
rbx  0x15c 348
rcx  0x0 0
rdx  0x1 1
rsi  0x7a59 31321
rdi  0x7fff1c576d40 140733668879680
rbp  0x7fff1c576ce0 0x7fff1c576ce0
rsp  0x7fff1c576ce0 0x7fff1c576ce0
r8  0x2 2
r9  0x25 37
r10  0x7 7
r11  0x0 0
r12  0x0 0
r13  0xbb0c348 196133704
r14  0xbb09d40 196123968
r15  0x1 1
rip  0x8f9a5c2 0x8f9a5c2 
eflags  0x246 [ PF ZF IF ]
cs  0x33 51
ss  0x2b 43
ds  0x0 0
es  0x0 0
fs  0x0 0
gs  0x0 0
st0  0 (raw 0x00000000000000000000)
---Type  to continue, or q  to quit---
st1  0 (raw 0x00000000000000000000)
st2  0 (raw 0x00000000000000000000)
st3  0 (raw 0x00000000000000000000)
st4  0 (raw 0x00000000000000000000)
st5  0 (raw 0x00000000000000000000)
st6  73280 (raw 0x400f8f20000000000000)
st7  73280 (raw 0x400f8f20000000000000)
fctrl  0x27f 639
fstat  0x0 0
ftag  0xffff 65535
fiseg  0x0 0
fioff  0x9394e95 154750613
foseg  0x7fff 32767
fooff  0x1c573f50 475479888
fop  0x0 0

8、用x/32命令查内存中32个字节

gdb) x/32 0x7fff1c576d40
0x7fff1c576d40: 0x1c577a59 0x00007fff 0x1c576e50 0x00007fff
0x7fff1c576d50: 0x1c576ee0 0x00007fff 0x0918adf2 0x00000000
0x7fff1c576d60: 0x00000000 0x00000000 0x00000000 0x00000000
0x7fff1c576d70: 0x00000000 0x00000001 0x00000000 0x00000000
0x7fff1c576d80: 0x002adb17 0x00000000 0x00000000 0x00000000
0x7fff1c576d90: 0x00000000 0x00000000 0x00000001 0x00000000
0x7fff1c576da0: 0x09b958cc 0x00000000 0x0000015c 0x00000000
0x7fff1c576db0: 0x7fffffff 0x00000000 0x62657100 0x00000000

9、找到0x0000015c,通过此等待事件号,找等待事件

gyj@OCM> select name from v$event_name where event# in(select to_number('15c','xxxxxxxxxxxxxx') from dual);


NAME
----------------------------------------------------------------
SQL*Net message to client

10、重复第5、6、7、8、9步(注用从第5步的c命令开始)

(gdb) c
Continuing.

Breakpoint 1, 0x0000000008f9a5c2 in kslwtbctx ()
(gdb) info all-register
rax  0x0 0
rbx  0x2000 8192
rcx  0x0 0
rdx  0x0 0
rsi  0x0 0
rdi  0x7fff1c574c38 140733668871224
rbp  0x7fff1c574970 0x7fff1c574970
rsp  0x7fff1c574970 0x7fff1c574970
r8  0x5bbb295 96187029
r9  0x2f8b5f0 49853936
r10  0x52da848e 1390052494
r11  0x2b0b9057e7a8 47328666314664
r12  0x99837da8 2575531432
r13  0x0 0
r14  0x0 0
r15  0x99437498 2571334808
rip  0x8f9a5c2 0x8f9a5c2 
eflags  0x246 [ PF ZF IF ]
cs  0x33 51
ss  0x2b 43
ds  0x0 0
es  0x0 0
fs  0x0 0
gs  0x0 0
st0  0 (raw 0x00000000000000000000)
---Type  to continue, or q  to quit---
st1  0 (raw 0x00000000000000000000)
st2  0 (raw 0x00000000000000000000)
st3  0 (raw 0x00000000000000000000)
st4  0 (raw 0x00000000000000000000)
st5  0 (raw 0x00000000000000000000)
st6  73280 (raw 0x400f8f20000000000000)
st7  73280 (raw 0x400f8f20000000000000)
fctrl  0x27f 639
fstat  0x0 0
ftag  0xffff 65535
fiseg  0x0 0
fioff  0x9394e95 154750613
foseg  0x7fff 32767
fooff  0x1c573f50 475479888
fop  0x0 0
xmm0  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 
 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm1  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 
 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm2  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 
 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm3  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0, 0x0, 0x0, 0x0, 0x54, 0x3, 0x1, 0x0, 0x0, 0x0, 0x0, 
 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {0x0, 0x0, 0x354, 0x1, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x10354, 0x0, 0x0}, v2_int64 = {
 0x1035400000000, 0x0}, uint128 = 0x00000000000000000001035400000000}
xmm4  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x64, 0x0 }, v8_int16 = {0x64, 0x0, 
---Type  to continue, or q  to quit---
 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x64, 0x0, 0x0, 0x0}, v2_int64 = {0x64, 0x0}, uint128 = 0x00000000000000000000000000000064}
xmm5  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x32, 0xa3, 0xd7, 0x2, 0x0 }, 
 v8_int16 = {0xa332, 0x2d7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x2d7a332, 0x0, 0x0, 0x0}, v2_int64 = {0x2d7a332, 0x0}, 
 uint128 = 0x00000000000000000000000002d7a332}
xmm6  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 
 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm7  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0xda, 0x87, 0xd7, 0x2, 0x0 }, 
 v8_int16 = {0x87da, 0x2d7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x2d787da, 0x0, 0x0, 0x0}, v2_int64 = {0x2d787da, 0x0}, 
 uint128 = 0x00000000000000000000000002d787da}
xmm8  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 
 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm9  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 
 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm10  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 
 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm11  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 
 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm12  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x18, 0xe, 0x73, 0x90, 0xb, 0x2b, 0x0, 0x0, 0x0, 0x0, 
 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {0xe18, 0x9073, 0x2b0b, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x90730e18, 0x2b0b, 0x0, 0x0}, 
 v2_int64 = {0x2b0b90730e18, 0x0}, uint128 = 0x000000000000000000002b0b90730e18}
xmm13  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 
 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm14  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 
 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm15  {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 
---Type  to continue, or q  to quit---
 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
mxcsr  0x1fa1 [ IE PE IM DM ZM OM UM PM ]
(gdb) 
(gdb) x/32 0x7fff1c574c38
0x7fff1c574c38: 0x08f97a59 0x00000000 0x9079c6d8 0x00002b0b
0x7fff1c574c48: 0x90742970 0x00002b0b 0x9079c748 0x00002b0b
0x7fff1c574c58: 0x1c574df0 0x00007fff 0x9079c748 0x00002b0b
0x7fff1c574c68: 0x9079c6d8 0x00002b0b 0x00000000 0x00000000
0x7fff1c574c78: 0x00000000 0x00000000 0x00000013 0x20000000
0x7fff1c574c88: 0x00000000 0x00000000 0x00000001 0x00000000
0x7fff1c574c98: 0x0a0fcd50 0x00000000 0x00000092 0x00000000
0x7fff1c574ca8: 0x7fffffff 0x00000000 0x00000006 0x00000000
(gdb) 
gyj@OCM> gyj@OCM> select name from v$event_name where event# in(select to_number('92','xxxxxxxxxxxxxx') from dual);

NAME
----------------------------------------------------------------
db file sequential read
gyj@OCM> select sid from v$mystat where rownum=1;

 SID
----------
 146

 gyj@OCM> select * from gyj_test where id=1;
sys@OCM> select sid ,event from v$session_wait where sid=146 and wait_class<>'Idle';

 SID EVENT
---------- ----------------------------------------------------------------
 146 read by other session

哈哈。。。终于发现了read by other session等待事件,以后可以用同样的方法去研究其它等待事件!

热心网友 时间:2022-04-12 01:15

本来就必须等待输入啊,没有输入程序如何继续运行呢?追问请问怎么输入呢?在vim里面貌似不能输入

追答没用过,不用vim很久了。。

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
Linux系统安装FTP服务器 Linux系统的网络文件共享 建筑的七盏明灯的内容简介 面向对象设计七大原则 简单说 交互设计七大定律 交互设计的“根”——七大定律 交互设计原则和理论2——七大定律 七大设计原则 附近的加油站有哪些 附近的加油站有哪些地方 buffer busy waits 和 read by other session的区别 SQL如何将几条语句查询结果求和 我想实现数据库中的多条记录的数据相加生成一条记录,应该怎么做? 求SQL数据库实现多条记录自动求和语句 excel表多条件多字段求和 在一个电子表格中,有一个人的多条信息,如何将他求和合成一条 foxpro多条记录求和 在SQL Server中一个表里同一字段,根据多条记录不同条件,使用sum单独求和。 sqlserver计算同一表中多条记录(至多3条,至少1条)的同一字段之和 VB如何将数据库里多条数字记录相加 统计多条记录多个字段的总和 单元格内的多条记录数据,如何识别并自动求和并填充在另一列中。 excel,多条相同数据记录,汇总成一条,数值求和 求助EXCEL高手!关于多条记录通过函数求和问题 用JDBC的结果集ResultSet是不是已经把所有的查询结果放到内存中了 从表中查询数据,rs的结果为什么是com.mysql.jdbc.JDBC4ResultSet@38879ca7 ResultSet中如何判断和删除记录 error C2664: &quot;OCIBindByPos&quot;: 不能将参数 5 从&quot;CString&quot;转换为&quot;void *&quot; Oracle硬解析和软解析的区别分析 苹果手机从数据类型vaichai转换为numeric出错,怎么解决? 汽车零部件latch是什么意思 latch和register是什么器件 Quartus II 中的latch(参数化锁存器)怎么用?功能?真值表?最好有图!求解 fpga问题:latches是什么 oracle中的latch hit是什么意思 汽车中控锁,门锁执行器(actuator)和latch是什么关系? latch on是什么意思 latch up test 是什么意思 时钟脉冲有效电平即将到达下降沿的最后的状态为实际状态? 什么时候使用CountDownLatch 为什么我的电脑连不上网络了,提示拒绝远程连接,因为未识别出您提供的用户名和密码组合 如何估算PGA,SGA的大小,配置数据库服务器的内存 64g的数据库sga是多大 公司原来上的SAP ERP,最近又要引入HANA,有谁对SAP HANA比较了解,能否介绍一下? sap hana是属于哪一种数据库技术方案 各位SAP HANA是什么意思 SAP HANA插上32路CPU,性能多大飞跃 sap hana插上32路cpu,性能有多大飞跃 sap hana 为什么抛弃oracle hana的应用软件