Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
ae6adfe4
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ae6adfe4
编写于
1月 15, 2018
作者:
A
Alexander Fedorov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#2556 move SQL outside of PostgreDebugBreakpointDescriptor
上级
caf9f108
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
25 addition
and
33 deletion
+25
-33
plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/DBGSession.java
...er.debug.core/src/org/jkiss/dbeaver/debug/DBGSession.java
+1
-1
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/console/Debugger.java
...eaver/ext/postgresql/debug/internal/console/Debugger.java
+3
-3
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugBreakpointDescriptor.java
...debug/internal/impl/PostgreDebugBreakpointDescriptor.java
+0
-20
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugSession.java
...t/postgresql/debug/internal/impl/PostgreDebugSession.java
+21
-9
未找到文件。
plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/DBGSession.java
浏览文件 @
ae6adfe4
...
...
@@ -26,7 +26,7 @@ public interface DBGSession {
List
<?
extends
DBGBreakpointDescriptor
>
getBreakpoints
();
DBGBreakpointDescriptor
setBreakpoint
(
DBGObjectDescriptor
obj
,
DBGBreakpointProperties
properties
)
throws
DBGException
;
void
addBreakpoint
(
DBGObjectDescriptor
object
,
DBGBreakpointProperties
properties
)
throws
DBGException
;
void
removeBreakpoint
(
DBGBreakpointDescriptor
bp
)
throws
DBGException
;
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/console/Debugger.java
浏览文件 @
ae6adfe4
...
...
@@ -543,12 +543,12 @@ public class Debugger {
break
;
}
DBGBreakpointProperties
bp
p
=
lineNo
>
0
?
new
PostgreDebugBreakpointProperties
(
lineNo
,
true
)
DBGBreakpointProperties
bp
=
lineNo
>
0
?
new
PostgreDebugBreakpointProperties
(
lineNo
,
true
)
:
new
PostgreDebugBreakpointProperties
(
true
);
DBGBreakpointDescriptor
bp
=
debugSession
.
setBreakpoint
(
debugObject
,
bp
p
);
debugSession
.
addBreakpoint
(
debugObject
,
b
p
);
System
.
out
.
println
(
"Breakpoint
set
"
);
System
.
out
.
println
(
"Breakpoint
added
"
);
System
.
out
.
println
(
bp
.
toString
());
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugBreakpointDescriptor.java
浏览文件 @
ae6adfe4
...
...
@@ -18,9 +18,6 @@
package
org.jkiss.dbeaver.ext.postgresql.debug.internal.impl
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
org.jkiss.dbeaver.debug.DBGBreakpointDescriptor
;
import
org.jkiss.dbeaver.debug.DBGException
;
...
...
@@ -33,28 +30,11 @@ public class PostgreDebugBreakpointDescriptor implements DBGBreakpointDescriptor
private
final
PostgreDebugBreakpointProperties
properties
;
private
static
final
String
SQL_SET_GLOBAL
=
"select pldbg_set_global_breakpoint(?sessionid, ?obj, ?line, ?target)"
;
private
static
final
String
SQL_SET
=
"select pldbg_set_breakpoint(?sessionid, ?obj, ?line)"
;
public
PostgreDebugBreakpointDescriptor
(
PostgreDebugSession
session
,
PostgreDebugObjectDescriptor
obj
,
PostgreDebugBreakpointProperties
properties
)
throws
DBGException
{
this
.
session
=
session
;
this
.
obj
=
obj
;
this
.
properties
=
properties
;
try
(
Statement
stmt
=
session
.
getConnection
().
createStatement
())
{
String
sqlCommand
=
properties
.
isGlobal
()
?
SQL_SET_GLOBAL
:
SQL_SET
;
stmt
.
executeQuery
(
sqlCommand
.
replaceAll
(
"\\?sessionid"
,
String
.
valueOf
(
session
.
getSessionId
()))
.
replaceAll
(
"\\?obj"
,
String
.
valueOf
(
obj
.
getID
()))
.
replaceAll
(
"\\?line"
,
properties
.
isOnStart
()
?
"-1"
:
String
.
valueOf
(
properties
.
getLineNo
()))
.
replaceAll
(
"\\?target"
,
properties
.
isAll
()
?
"null"
:
String
.
valueOf
(
properties
.
getTargetId
())));
}
catch
(
SQLException
e
)
{
throw
new
DBGException
(
"SQL error"
,
e
);
}
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugSession.java
浏览文件 @
ae6adfe4
...
...
@@ -70,7 +70,6 @@ public class PostgreDebugSession implements DBGSession {
private
static
final
String
SQL_ATTACH
=
"select pldbg_wait_for_target(?sessionid)"
;
private
static
final
String
SQL_ATTACH_BREAKPOINT
=
"select pldbg_wait_for_breakpoint(?sessionid)"
;
private
static
final
String
SQL_LISTEN
=
"select pldbg_create_listener() as sessionid"
;
...
...
@@ -88,14 +87,15 @@ public class PostgreDebugSession implements DBGSession {
private
static
final
String
SQL_ABORT
=
"select pldbg_abort_target(?sessionid)"
;
private
static
final
String
SQL_SET_GLOBAL_BREAKPOINT
=
"select pldbg_set_global_breakpoint(?sessionid, ?obj, ?line, ?target)"
;
private
static
final
String
SQL_SET_BREAKPOINT
=
"select pldbg_set_breakpoint(?sessionid, ?obj, ?line)"
;
private
static
final
String
SQL_DROP_BREAKPOINT
=
"select pldbg_drop_breakpoint(?sessionid, ?obj, ?line)"
;
private
static
final
String
SQL_ATTACH_BREAKPOINT
=
"select pldbg_wait_for_breakpoint(?sessionid)"
;
private
final
ReentrantReadWriteLock
lock
=
new
ReentrantReadWriteLock
(
true
);
private
List
<
PostgreDebugBreakpointDescriptor
>
breakpoints
=
new
ArrayList
<
PostgreDebugBreakpointDescriptor
>(
1
);
private
PostgreDebugBreakpointDescriptor
entry
=
null
;
private
FutureTask
<
Void
>
task
;
private
Thread
workerThread
=
null
;
...
...
@@ -146,8 +146,7 @@ public class PostgreDebugSession implements DBGSession {
PostgreDebugBreakpointProperties
properties
=
new
PostgreDebugBreakpointProperties
(
true
);
PostgreDebugObjectDescriptor
obj
=
new
PostgreDebugObjectDescriptor
(
OID
,
"ENTRY"
,
"SESSION"
,
"THIS"
,
"PG"
);
this
.
entry
=
new
PostgreDebugBreakpointDescriptor
(
this
,
obj
,
properties
);
addBreakpoint
(
obj
,
properties
);
runAsync
(
SQL_ATTACH
.
replaceAll
(
"\\?sessionid"
,
String
.
valueOf
(
sessionId
)),
String
.
valueOf
(
sessionId
)
+
" global attached to "
+
String
.
valueOf
(
targetId
));
...
...
@@ -189,21 +188,34 @@ public class PostgreDebugSession implements DBGSession {
}
@Override
public
DBGBreakpointDescriptor
setBreakpoint
(
DBGObjectDescriptor
obj
,
DBGBreakpointProperties
properties
)
throws
DBGException
{
public
void
addBreakpoint
(
DBGObjectDescriptor
object
,
DBGBreakpointProperties
properties
)
throws
DBGException
{
acquireReadLock
();
PostgreDebugBreakpointDescriptor
bp
=
null
;
try
{
bp
=
new
PostgreDebugBreakpointDescriptor
(
this
,
(
PostgreDebugObjectDescriptor
)
obj
,
(
PostgreDebugBreakpointProperties
)
properties
);
PostgreDebugBreakpointProperties
bpd
=
(
PostgreDebugBreakpointProperties
)
properties
;
bp
=
new
PostgreDebugBreakpointDescriptor
(
this
,
(
PostgreDebugObjectDescriptor
)
object
,
bpd
);
try
(
Statement
stmt
=
getConnection
().
createStatement
())
{
String
sqlCommand
=
bpd
.
isGlobal
()
?
SQL_SET_GLOBAL_BREAKPOINT
:
SQL_SET_BREAKPOINT
;
stmt
.
executeQuery
(
sqlCommand
.
replaceAll
(
"\\?sessionid"
,
String
.
valueOf
(
getSessionId
()))
.
replaceAll
(
"\\?obj"
,
String
.
valueOf
(
object
.
getID
()))
.
replaceAll
(
"\\?line"
,
bpd
.
isOnStart
()
?
"-1"
:
String
.
valueOf
(
bpd
.
getLineNo
()))
.
replaceAll
(
"\\?target"
,
bpd
.
isAll
()
?
"null"
:
String
.
valueOf
(
bpd
.
getTargetId
())));
}
catch
(
SQLException
e
)
{
throw
new
DBGException
(
"SQL error"
,
e
);
}
breakpoints
.
add
(
bp
);
}
finally
{
lock
.
readLock
().
unlock
();
}
return
bp
;
}
@Override
...
...
@@ -415,7 +427,7 @@ public class PostgreDebugSession implements DBGSession {
* @return java.sql.Connection
* @throws DBGException
*/
p
ublic
Connection
getConnection
()
throws
DBGException
{
p
rivate
Connection
getConnection
()
throws
DBGException
{
try
{
return
getConnection
(
connection
);
}
catch
(
SQLException
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录