Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Carl Shapiro
cmucl
Commits
e8e8525a
Commit
e8e8525a
authored
32 years ago
by
wlott
Browse files
Options
Downloads
Patches
Plain Diff
Added calls to os_flush_icache after each place the breakpoint code changes
an instruction.
parent
c1b57fcf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lisp/mips-arch.c
+10
-0
10 additions, 0 deletions
lisp/mips-arch.c
with
10 additions
and
0 deletions
lisp/mips-arch.c
+
10
−
0
View file @
e8e8525a
...
...
@@ -60,12 +60,17 @@ unsigned long arch_install_breakpoint(void *pc)
unsigned
long
*
ptr
=
(
unsigned
long
*
)
pc
;
unsigned
long
result
=
*
ptr
;
*
ptr
=
(
trap_Breakpoint
<<
16
)
|
0xd
;
os_flush_icache
((
os_vm_address_t
)
ptr
,
sizeof
(
unsigned
long
));
return
result
;
}
void
arch_remove_breakpoint
(
void
*
pc
,
unsigned
long
orig_inst
)
{
*
(
unsigned
long
*
)
pc
=
orig_inst
;
os_flush_icache
((
os_vm_address_t
)
pc
,
sizeof
(
unsigned
long
));
}
static
unsigned
long
*
skipped_break_addr
,
displaced_after_inst
;
...
...
@@ -95,6 +100,7 @@ void arch_do_displaced_inst(struct sigcontext *scp,
/* Put the original instruction back. */
*
break_pc
=
orig_inst
;
os_flush_icache
((
os_vm_address_t
)
break_pc
,
sizeof
(
unsigned
long
));
skipped_break_addr
=
break_pc
;
/* Figure out where it goes. */
...
...
@@ -109,6 +115,7 @@ void arch_do_displaced_inst(struct sigcontext *scp,
displaced_after_inst
=
*
next_pc
;
*
next_pc
=
(
trap_AfterBreakpoint
<<
16
)
|
0xd
;
os_flush_icache
((
os_vm_address_t
)
next_pc
,
sizeof
(
unsigned
long
));
sigreturn
(
scp
);
}
...
...
@@ -143,8 +150,11 @@ static void sigtrap_handler(int signal, int code, struct sigcontext *scp)
case
trap_AfterBreakpoint
:
*
skipped_break_addr
=
(
trap_Breakpoint
<<
16
)
|
0xd
;
os_flush_icache
((
os_vm_address_t
)
skipped_break_addr
,
sizeof
(
unsigned
long
));
skipped_break_addr
=
NULL
;
*
(
unsigned
long
*
)
scp
->
sc_pc
=
displaced_after_inst
;
os_flush_icache
((
os_vm_address_t
)
scp
->
sc_pc
,
sizeof
(
unsigned
long
));
scp
->
sc_mask
=
orig_sigmask
;
break
;
...
...
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