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
ad72810b
Commit
ad72810b
authored
32 years ago
by
wlott
Browse files
Options
Downloads
Patches
Plain Diff
Fixed to work.
parent
5c2ed817
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/breakpoint.c
+39
-24
39 additions, 24 deletions
lisp/breakpoint.c
with
39 additions
and
24 deletions
lisp/breakpoint.c
+
39
−
24
View file @
ad72810b
...
...
@@ -37,34 +37,33 @@ void breakpoint_remove(lispobj code_obj, int pc_offset,
void
breakpoint_do_displaced_inst
(
struct
sigcontext
*
scp
,
unsigned
long
orig_inst
)
{
undo_fake_foreign_function_call
(
scp
);
arch_do_displaced_inst
(
scp
,
orig_inst
);
}
static
lispobj
find_code
(
struct
sigcontext
*
scp
)
{
#ifdef CODE
lispobj
code
=
SC_REG
(
scp
,
CODE
),
header
;
#ifdef
reg_
CODE
lispobj
code
=
SC_REG
(
scp
,
reg_
CODE
),
header
;
if
(
LowtagOf
(
code
)
!=
type_OtherPointer
)
return
NIL
;
header
=
*
(
lispobj
*
)
PTR
(
code
);
header
=
*
(
lispobj
*
)(
code
-
type_OtherPointer
);
if
(
TypeOf
(
header
)
==
type_CodeHeader
)
return
code
;
else
return
code
-
HeaderValue
(
co
de
)
*
sizeof
(
lispobj
);
return
code
-
HeaderValue
(
hea
de
r
)
*
sizeof
(
lispobj
);
#else
return
NIL
;
#endif
}
static
void
internal_handle_breakpoin
t
(
struct
sigcontext
*
scp
,
lispobj
code
)
static
int
compute_offse
t
(
struct
sigcontext
*
scp
,
lispobj
code
)
{
int
offset
;
if
(
code
==
NIL
)
offset
=
0
;
return
0
;
else
{
unsigned
long
code_start
;
struct
code
*
codeptr
=
(
struct
code
*
)
PTR
(
code
);
...
...
@@ -72,39 +71,55 @@ static void internal_handle_breakpoint(struct sigcontext *scp, lispobj code)
code_start
=
(
unsigned
long
)
codeptr
+
HeaderValue
(
codeptr
->
header
)
*
sizeof
(
lispobj
);
if
(
SC_PC
(
scp
)
<
code_start
)
offset
=
0
;
return
0
;
else
{
offset
=
SC_PC
(
scp
)
-
code_start
;
int
offset
=
SC_PC
(
scp
)
-
code_start
;
if
(
offset
>=
codeptr
->
code_size
)
offset
=
0
;
return
0
;
else
return
make_fixnum
(
offset
);
}
}
}
void
handle_breakpoint
(
int
signal
,
int
subcode
,
struct
sigcontext
*
scp
)
{
lispobj
code
;
fake_foreign_function_call
(
scp
);
code
=
find_code
(
scp
);
funcall3
(
SymbolFunction
(
HANDLE_BREAKPOINT
),
make_fixnum
(
offset
),
compute_offset
(
scp
,
code
),
code
,
alloc_sap
(
scp
));
scp
->
sc_mask
=
sigblock
(
0
);
}
void
handle_breakpoint
(
int
signal
,
int
subcode
,
struct
sigcontext
*
scp
)
{
internal_handle_breakpoint
(
scp
,
find_code
(
scp
));
undo_fake_foreign_function_call
(
scp
);
}
void
*
handle_function_end_breakpoint
(
int
signal
,
int
subcode
,
struct
sigcontext
*
scp
)
{
lispobj
code
=
find_code
(
scp
);
struct
code
*
codeptr
=
(
struct
code
*
)
PTR
(
code
);
lispobj
lra
;
lispobj
code
,
lra
;
struct
code
*
codeptr
;
fake_foreign_function_call
(
scp
);
internal_handle_breakpoint
(
scp
,
code
);
code
=
find_code
(
scp
);
codeptr
=
(
struct
code
*
)
PTR
(
code
);
funcall3
(
SymbolFunction
(
HANDLE_BREAKPOINT
),
compute_offset
(
scp
,
code
),
code
,
alloc_sap
(
scp
));
lra
=
codeptr
->
constants
[
REAL_LRA_SLOT
];
#ifdef CODE
#ifdef
reg_
CODE
if
(
codeptr
->
constants
[
KNOWN_RETURN_P_SLOT
]
==
NIL
)
SC_REG
(
scp
,
CODE
)
=
lra
;
SC_REG
(
scp
,
reg_
CODE
)
=
lra
;
#endif
return
(
void
*
)(
lra
-
type_OtherPointer
+
sizeof
(
lispobj
));
undo_fake_foreign_function_call
(
scp
);
return
(
void
*
)(
lra
-
type_OtherPointer
+
sizeof
(
lispobj
));
}
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