Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
Stella
Commits
a95d40c6
Commit
a95d40c6
authored
Jan 12, 2021
by
thrust26
Browse files
create DebuggerDialog and included OptionsDialog on demand only
parent
b225a684
Pipeline
#10358
passed with stages
in 2 minutes and 41 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/debugger/Debugger.cxx
View file @
a95d40c6
...
...
@@ -84,7 +84,6 @@ Debugger::Debugger(OSystem& osystem, Console& console)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Debugger
::~
Debugger
()
{
delete
myDialog
;
myDialog
=
nullptr
;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
...
...
@@ -100,11 +99,6 @@ void Debugger::initialize()
myOSystem
.
settings
().
setValue
(
"dbg.res"
,
mySize
);
delete
myDialog
;
myDialog
=
nullptr
;
myDialog
=
new
DebuggerDialog
(
myOSystem
,
*
this
,
0
,
0
,
mySize
.
w
,
mySize
.
h
);
myCartDebug
->
setDebugWidget
(
&
(
myDialog
->
cartDebug
()));
saveOldState
();
}
...
...
@@ -129,8 +123,8 @@ bool Debugger::start(const string& message, int address, bool read,
buf
<<
message
;
if
(
address
>
-
1
)
buf
<<
cartDebug
().
getLabel
(
address
,
read
,
4
);
myD
ialog
->
message
().
setText
(
buf
.
str
());
myD
ialog
->
message
().
setToolTip
(
toolTip
);
d
ialog
().
message
().
setText
(
buf
.
str
());
d
ialog
().
message
().
setToolTip
(
toolTip
);
return
true
;
}
return
false
;
...
...
@@ -143,7 +137,7 @@ bool Debugger::startWithFatalError(const string& message)
{
// This must be done *after* we enter debug mode,
// so the dialog is properly shown
myD
ialog
->
showFatalMessage
(
message
);
d
ialog
().
showFatalMessage
(
message
);
return
true
;
}
return
false
;
...
...
@@ -580,8 +574,8 @@ void Debugger::nextFrame(int frames)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void
Debugger
::
updateRewindbuttons
(
const
RewindManager
&
r
)
{
myD
ialog
->
rewindButton
().
setEnabled
(
!
r
.
atFirst
());
myD
ialog
->
unwindButton
().
setEnabled
(
!
r
.
atLast
());
d
ialog
().
rewindButton
().
setEnabled
(
!
r
.
atFirst
());
d
ialog
().
unwindButton
().
setEnabled
(
!
r
.
atLast
());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
...
...
@@ -685,13 +679,13 @@ void Debugger::setStartState()
updateRewindbuttons
(
r
);
// Set the 're-disassemble' flag, but don't do it until the next scheduled time
myD
ialog
->
rom
().
invalidate
(
false
);
d
ialog
().
rom
().
invalidate
(
false
);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void
Debugger
::
setQuitState
()
{
myD
ialog
->
saveConfig
();
d
ialog
().
saveConfig
();
saveOldState
();
// Bus must be unlocked for normal operation when leaving debugger mode
...
...
@@ -846,6 +840,18 @@ bool Debugger::canExit() const
return
baseDialogIsActive
();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DebuggerDialog
&
Debugger
::
dialog
()
{
if
(
myDialog
==
nullptr
)
{
myDialog
=
make_unique
<
DebuggerDialog
>
(
myOSystem
,
*
this
,
0
,
0
,
mySize
.
w
,
mySize
.
h
);
myCartDebug
->
setDebugWidget
(
&
(
myDialog
->
cartDebug
()));
}
return
*
myDialog
;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
std
::
array
<
Debugger
::
BuiltinFunction
,
18
>
Debugger
::
ourBuiltinFunctions
=
{
{
// left joystick:
...
...
src/debugger/Debugger.hxx
View file @
a95d40c6
...
...
@@ -279,7 +279,7 @@ class Debugger : public DialogContainer
/**
Return (and possibly create) the bottom-most dialog of this container.
*/
Dialog
*
baseDialog
()
override
{
return
myD
ialog
;
}
Dialog
*
baseDialog
()
override
{
return
&
d
ialog
()
;
}
private:
/**
...
...
@@ -332,11 +332,16 @@ class Debugger : public DialogContainer
void
loadState
(
int
state
);
void
loadAllStates
();
/**
Return (and possibly create) the debugger dialog.
*/
DebuggerDialog
&
dialog
();
private:
Console
&
myConsole
;
System
&
mySystem
;
DebuggerDialog
*
myDialog
{
nullptr
}
;
unique_ptr
<
DebuggerDialog
>
myDialog
;
unique_ptr
<
DebuggerParser
>
myParser
;
unique_ptr
<
CartDebug
>
myCartDebug
;
unique_ptr
<
CpuDebug
>
myCpuDebug
;
...
...
src/debugger/DebuggerParser.cxx
View file @
a95d40c6
...
...
@@ -1251,7 +1251,7 @@ void DebuggerParser::executeDump()
const
string
outStr
=
out
.
str
();
const
string
resultStr
=
commandResult
.
str
();
DebuggerDialog
*
dlg
=
debugger
.
myD
ialog
;
DebuggerDialog
*
dlg
=
&
debugger
.
d
ialog
()
;
BrowserDialog
::
show
(
dlg
,
"Save Dump as"
,
path
.
str
(),
BrowserDialog
::
Mode
::
FileSave
,
[
this
,
dlg
,
outStr
,
resultStr
]
...
...
@@ -1892,7 +1892,7 @@ void DebuggerParser::executeSave()
{
if
(
argCount
&&
argStrings
[
0
]
==
"?"
)
{
DebuggerDialog
*
dlg
=
debugger
.
myD
ialog
;
DebuggerDialog
*
dlg
=
&
debugger
.
d
ialog
()
;
BrowserDialog
::
show
(
dlg
,
"Save Workbench as"
,
dlg
->
instance
().
userDir
().
getPath
()
+
cartName
()
+
".script"
,
...
...
@@ -1916,7 +1916,7 @@ void DebuggerParser::executeSaveAccess()
{
if
(
argCount
&&
argStrings
[
0
]
==
"?"
)
{
DebuggerDialog
*
dlg
=
debugger
.
myD
ialog
;
DebuggerDialog
*
dlg
=
&
debugger
.
d
ialog
()
;
BrowserDialog
::
show
(
dlg
,
"Save Access Counters as"
,
dlg
->
instance
().
userDir
().
getPath
()
+
cartName
()
+
".csv"
,
...
...
@@ -1947,7 +1947,7 @@ void DebuggerParser::executeSavedisassembly()
{
if
(
argCount
&&
argStrings
[
0
]
==
"?"
)
{
DebuggerDialog
*
dlg
=
debugger
.
myD
ialog
;
DebuggerDialog
*
dlg
=
&
debugger
.
d
ialog
()
;
BrowserDialog
::
show
(
dlg
,
"Save Disassembly as"
,
dlg
->
instance
().
userDir
().
getPath
()
+
cartName
()
+
".asm"
,
...
...
@@ -1971,7 +1971,7 @@ void DebuggerParser::executeSaverom()
{
if
(
argCount
&&
argStrings
[
0
]
==
"?"
)
{
DebuggerDialog
*
dlg
=
debugger
.
myD
ialog
;
DebuggerDialog
*
dlg
=
&
debugger
.
d
ialog
()
;
BrowserDialog
::
show
(
dlg
,
"Save ROM as"
,
dlg
->
instance
().
userDir
().
getPath
()
+
cartName
()
+
".a26"
,
...
...
@@ -1999,7 +1999,7 @@ void DebuggerParser::executeSaveses()
if
(
argCount
&&
argStrings
[
0
]
==
"?"
)
{
DebuggerDialog
*
dlg
=
debugger
.
myD
ialog
;
DebuggerDialog
*
dlg
=
&
debugger
.
d
ialog
()
;
BrowserDialog
::
show
(
dlg
,
"Save Session as"
,
dlg
->
instance
().
userDir
().
getPath
()
+
filename
.
str
(),
...
...
src/debugger/gui/DebuggerDialog.cxx
View file @
a95d40c6
...
...
@@ -67,9 +67,6 @@ DebuggerDialog::DebuggerDialog(OSystem& osystem, DialogContainer& parent,
// Inform the TIA output widget about its associated zoom widget
myTiaOutput
->
setZoomWidget
(
myTiaZoom
);
myOptions
=
make_unique
<
OptionsDialog
>
(
osystem
,
parent
,
this
,
w
,
h
,
Menu
::
AppMode
::
debugger
);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
...
...
@@ -255,7 +252,17 @@ void DebuggerDialog::handleCommand(CommandSender* sender, int cmd,
case
kDDOptionsCmd
:
saveConfig
();
if
(
myOptions
==
nullptr
)
{
uInt32
w
=
0
,
h
=
0
;
getDynamicBounds
(
w
,
h
);
myOptions
=
make_unique
<
OptionsDialog
>
(
instance
(),
parent
(),
this
,
w
,
h
,
Menu
::
AppMode
::
debugger
);
}
myOptions
->
open
();
loadConfig
();
break
;
...
...
thrust26
@thrust26
mentioned in commit
6f466c35
·
Jan 24, 2021
mentioned in commit
6f466c35
mentioned in commit 6f466c355200dc1fcae2c7c55755b269713caaf3
Toggle commit list
thrust26
@thrust26
mentioned in commit
bd3f34ba
·
Jan 24, 2021
mentioned in commit
bd3f34ba
mentioned in commit bd3f34ba910830b90d9f03cbcd897aa6df22a957
Toggle commit list
thrust26
@thrust26
mentioned in commit
dcb155a0
·
Jan 24, 2021
mentioned in commit
dcb155a0
mentioned in commit dcb155a0034e5060ded0861864f821296a4e7343
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment