Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hust-x86-simulator
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
recolic-hust
hust-x86-simulator
Commits
ce18d37b
There was an error fetching the commit references. Please try again later.
Commit
ce18d37b
authored
5 years ago
by
Recolic Keghart
Browse files
Options
Downloads
Patches
Plain Diff
Debugger adapt doc
parent
7ff3eeb5
No related branches found
No related tags found
1 merge request
!3
Check
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
nemu/include/monitor/watchpoint.h
+1
-1
1 addition, 1 deletion
nemu/include/monitor/watchpoint.h
nemu/src/monitor/debug/expr_impl/lexer.l
+2
-1
2 additions, 1 deletion
nemu/src/monitor/debug/expr_impl/lexer.l
nemu/src/monitor/debug/ui.cc
+2
-1
2 additions, 1 deletion
nemu/src/monitor/debug/ui.cc
with
5 additions
and
3 deletions
nemu/include/monitor/watchpoint.h
+
1
−
1
View file @
ce18d37b
...
@@ -17,7 +17,7 @@ struct WP {
...
@@ -17,7 +17,7 @@ struct WP {
bool
evalulate
()
{
bool
evalulate
()
{
auto
new_value
=
evaluate_expr
(
expr
);
auto
new_value
=
evaluate_expr
(
expr
);
std
::
swap
(
new_value
,
curr_value
);
std
::
swap
(
new_value
,
curr_value
);
return
new_value
!=
curr_value
;
return
new_value
!=
curr_value
&&
curr_value
!=
0
;
}
}
WP
(
std
::
string
e
,
int
id
)
:
expr
(
e
),
id
(
id
)
{
WP
(
std
::
string
e
,
int
id
)
:
expr
(
e
),
id
(
id
)
{
evalulate
();
// initial expr value.
evalulate
();
// initial expr value.
...
...
This diff is collapsed.
Click to expand it.
nemu/src/monitor/debug/expr_impl/lexer.l
+
2
−
1
View file @
ce18d37b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
%%
%%
[ \t\n] {}
[ \t\n] {}
0
x
[0-9a-f]+ {yylval.ival = (int)strtol(yytext, NULL, 16); return T_INT;}
0
[xX]
[0-9a-f]+ {yylval.ival = (int)strtol(yytext, NULL, 16); return T_INT;}
[0-9]+ {yylval.ival = atoi(yytext); return T_INT;}
[0-9]+ {yylval.ival = atoi(yytext); return T_INT;}
"==" {return T_EQUAL;}
"==" {return T_EQUAL;}
"!=" {return T_NEQUAL;}
"!=" {return T_NEQUAL;}
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
[-+*/()] {return yytext[0];}
[-+*/()] {return yytext[0];}
"%"[a-z]{3} {yylval.ival = ((uint32_t)yytext[2] << 8) + yytext[3]; return T_REG;}
"%"[a-z]{3} {yylval.ival = ((uint32_t)yytext[2] << 8) + yytext[3]; return T_REG;}
"$"[a-z]{3} {yylval.ival = ((uint32_t)yytext[2] << 8) + yytext[3]; return T_REG;}
. {throw std::runtime_error(std::string("lexer error around token: ") + yytext);}
. {throw std::runtime_error(std::string("lexer error around token: ") + yytext);}
%%
%%
// Registers: eax='a'+'x', ebx='b'+'x', ...
// Registers: eax='a'+'x', ebx='b'+'x', ...
This diff is collapsed.
Click to expand it.
nemu/src/monitor/debug/ui.cc
+
2
−
1
View file @
ce18d37b
...
@@ -70,6 +70,7 @@ static struct {
...
@@ -70,6 +70,7 @@ static struct {
{
"help"
,
"Display informations about all supported commands"
,
cmd_help
},
{
"help"
,
"Display informations about all supported commands"
,
cmd_help
},
{
"c"
,
"Continue the execution of the program"
,
cmd_c
},
{
"c"
,
"Continue the execution of the program"
,
cmd_c
},
{
"n"
,
"= GDB `n`"
,
cmd_n
},
{
"n"
,
"= GDB `n`"
,
cmd_n
},
{
"si"
,
"= GDB `n`"
,
cmd_n
},
{
"info"
,
"= GDB `info`, supporting `info r` / `info w`"
,
cmd_info
},
{
"info"
,
"= GDB `info`, supporting `info r` / `info w`"
,
cmd_info
},
{
"x"
,
"x <bytes> <startAddr or expr>, dump memory content."
,
cmd_x
},
{
"x"
,
"x <bytes> <startAddr or expr>, dump memory content."
,
cmd_x
},
{
"w"
,
"w <expr>, add watchpoint for $expr"
,
cmd_w
},
{
"w"
,
"w <expr>, add watchpoint for $expr"
,
cmd_w
},
...
@@ -201,7 +202,7 @@ static int cmd_w(char *_args) {
...
@@ -201,7 +202,7 @@ static int cmd_w(char *_args) {
if
(
_args
==
NULL
)
if
(
_args
==
NULL
)
throw
std
::
invalid_argument
(
"w <expr>"
);
throw
std
::
invalid_argument
(
"w <expr>"
);
watchpoints
.
emplace_front
(
std
::
string
(
_args
),
++
max_watchpoint_id
);
watchpoints
.
emplace_front
(
std
::
string
(
_args
),
max_watchpoint_id
++
);
auto
iter
=
watchpoints
.
begin
();
// not thread-safe.
auto
iter
=
watchpoints
.
begin
();
// not thread-safe.
rlib
::
println
(
"Add watchpoint:"
,
*
iter
);
rlib
::
println
(
"Add watchpoint:"
,
*
iter
);
return
0
;
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment