Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
8315814b
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
提交
8315814b
编写于
5月 05, 2018
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#3256 PG debugger: check plugin installation and report to user. Error handling improvements.
上级
a15c6189
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
27 addition
and
10 deletion
+27
-10
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/navigator/NavigatorHandlerObjectOpen.java
...aver/ui/actions/navigator/NavigatorHandlerObjectOpen.java
+3
-2
plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/DBGBaseController.java
...g.core/src/org/jkiss/dbeaver/debug/DBGBaseController.java
+1
-7
plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/core/model/DatabaseDebugTarget.java
...g/jkiss/dbeaver/debug/core/model/DatabaseDebugTarget.java
+1
-1
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugController.java
...ostgresql/debug/internal/impl/PostgreDebugController.java
+3
-0
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
+19
-0
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/navigator/NavigatorHandlerObjectOpen.java
浏览文件 @
8315814b
...
...
@@ -153,8 +153,9 @@ public class NavigatorHandlerObjectOpen extends NavigatorHandlerObjectBase imple
IEditorPart
editor
=
findEntityEditor
(
workbenchWindow
,
selectedNode
);
if
(
editor
!=
null
)
{
boolean
settingsChanged
=
false
;
if
(
editor
.
getEditorInput
()
instanceof
IDatabaseEditorInput
)
{
settingsChanged
=
setInputAttributes
((
DatabaseEditorInput
<?>)
editor
.
getEditorInput
(),
defaultPageId
,
defaultFolderId
,
attributes
);
IEditorInput
editorInput
=
editor
.
getEditorInput
();
if
(
editorInput
instanceof
IDatabaseEditorInput
)
{
settingsChanged
=
setInputAttributes
((
DatabaseEditorInput
<?>)
editorInput
,
defaultPageId
,
defaultFolderId
,
attributes
);
}
if
(
editor
instanceof
ITabbedFolderContainer
&&
defaultFolderId
!=
null
)
{
// Activate default folder
...
...
plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/DBGBaseController.java
浏览文件 @
8315814b
...
...
@@ -67,13 +67,7 @@ public abstract class DBGBaseController implements DBGController {
if
(!
dataSourceContainer
.
isConnected
())
{
throw
new
DBGException
(
"Not connected to database"
);
}
try
{
return
createSession
(
monitor
,
configuration
);
}
catch
(
DBException
e
)
{
String
message
=
NLS
.
bind
(
DebugMessages
.
DatabaseDebugController_e_opening_debug_context
,
dataSourceContainer
);
log
.
error
(
message
,
e
);
throw
new
DBGException
(
message
,
e
);
}
}
@Override
...
...
plugins/org.jkiss.dbeaver.debug.core/src/org/jkiss/dbeaver/debug/core/model/DatabaseDebugTarget.java
浏览文件 @
8315814b
...
...
@@ -178,7 +178,7 @@ public class DatabaseDebugTarget extends DatabaseDebugElement implements IDataba
}
catch
(
DBGException
e
)
{
process
.
terminate
();
throw
new
CoreException
(
GeneralUtils
.
makeExceptionStatus
(
NLS
.
bind
(
"Failed to connect {0} to the target"
,
getName
()),
e
));
GeneralUtils
.
makeExceptionStatus
(
e
));
}
// Initiate breakpoints
IBreakpoint
[]
breakpoints
=
DebugPlugin
.
getDefault
().
getBreakpointManager
().
getBreakpoints
(
modelIdentifier
);
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugController.java
浏览文件 @
8315814b
...
...
@@ -57,6 +57,9 @@ public class PostgreDebugController extends DBGBaseController {
log
.
error
(
e1
);
}
}
if
(
e
instanceof
DBGException
)
{
throw
(
DBGException
)
e
;
}
throw
new
DBGException
(
"Error attaching debug session"
,
e
);
}
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.core/src/org/jkiss/dbeaver/ext/postgresql/debug/internal/impl/PostgreDebugSession.java
浏览文件 @
8315814b
...
...
@@ -92,6 +92,8 @@ public class PostgreDebugSession extends DBGJDBCSession {
private
static
final
String
MAGIC_PORT
=
"PLDBGBREAK"
;
private
static
final
String
SQL_CHECK_PLUGIN
=
"select 'Server version: ' || serverversionstr || '.\nProxy API version: ' || proxyapiver from pldbg_get_proxy_info()"
;
private
static
final
String
SQL_ATTACH
=
"select pldbg_wait_for_target(?sessionid)"
;
private
static
final
String
SQL_ATTACH_TO_PORT
=
"select pldbg_attach_to_port(?portnumber)"
;
private
static
final
String
SQL_PREPARE_SLOT
=
" select pldbg_oid_debug(?objectid)"
;
...
...
@@ -361,6 +363,12 @@ public class PostgreDebugSession extends DBGJDBCSession {
* procedure
*/
public
void
attach
(
DBRProgressMonitor
monitor
,
Map
<
String
,
Object
>
configuration
)
throws
DBException
{
if
(!
checkDebugPlagin
(
monitor
))
{
throw
new
DBGException
(
"PostgreSQL debug plugin is not installed on the server.\n"
+
"Refer to this WIKI article for installation instructions:\n"
+
"https://github.com/dbeaver/dbeaver/wiki/PGDebugger#installation"
);
}
int
functionOid
=
CommonUtils
.
toInt
(
configuration
.
get
(
PostgreDebugConstants
.
ATTR_FUNCTION_OID
));
String
kind
=
String
.
valueOf
(
configuration
.
get
(
PostgreDebugConstants
.
ATTR_ATTACH_KIND
));
boolean
global
=
PostgreDebugConstants
.
ATTACH_KIND_GLOBAL
.
equals
(
kind
);
...
...
@@ -378,6 +386,17 @@ public class PostgreDebugSession extends DBGJDBCSession {
}
}
private
boolean
checkDebugPlagin
(
DBRProgressMonitor
monitor
)
{
try
(
JDBCSession
session
=
getControllerConnection
().
openSession
(
monitor
,
DBCExecutionPurpose
.
UTIL
,
"Check debug plugin installation"
))
{
String
version
=
JDBCUtils
.
executeQuery
(
session
,
SQL_CHECK_PLUGIN
);
log
.
debug
(
"Debug plugin is installed:\n"
+
version
);
return
true
;
}
catch
(
Exception
e
)
{
log
.
debug
(
"Debug plugin not installed: "
+
e
.
getMessage
());
return
false
;
}
}
private
void
detachLocal
(
DBRProgressMonitor
monitor
)
throws
DBGException
{
try
(
JDBCSession
session
=
getControllerConnection
().
openSession
(
monitor
,
DBCExecutionPurpose
.
UTIL
,
"Abort local session"
))
{
JDBCUtils
.
executeQuery
(
session
,
composeAbortCommand
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录