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
dc957533
Commit
dc957533
authored
34 years ago
by
ch
Browse files
Options
Downloads
Patches
Plain Diff
Modified parse_lispobj to understand registers.
parent
5f1bb579
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
ldb/parse.c
+57
-6
57 additions, 6 deletions
ldb/parse.c
with
57 additions
and
6 deletions
ldb/parse.c
+
57
−
6
View file @
dc957533
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/parse.c,v 1.
3
1990/0
3/28 22:50:33
ch Exp $ */
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/parse.c,v 1.
4
1990/0
5/12 16:41:58
ch Exp $ */
#include
<stdio.h>
#include
<stdio.h>
#include
<ctype.h>
#include
<signal.h>
#include
<strings.h>
#include
"ldb.h"
#include
"ldb.h"
#include
"lisp.h"
#include
"lisp.h"
#include
"globals.h"
#include
"globals.h"
#include
"vars.h"
#include
"vars.h"
#include
"parse.h"
#include
"parse.h"
#include
"interrupt.h"
#include
"lispregs.h"
static
void
skip_ws
(
ptr
)
static
void
skip_ws
(
ptr
)
char
**
ptr
;
char
**
ptr
;
...
@@ -251,6 +256,33 @@ lispobj *result;
...
@@ -251,6 +256,33 @@ lispobj *result;
return
FALSE
;
return
FALSE
;
}
}
static
int
parse_regnum
(
s
)
char
*
s
;
{
if
((
s
[
1
]
==
'R'
)
||
(
s
[
1
]
==
'r'
))
{
int
regnum
;
if
(
s
[
2
]
==
'\0'
)
return
-
1
;
/* skip the $R part and call atoi on the number */
regnum
=
atoi
(
s
+
2
);
if
((
regnum
>=
0
)
&&
(
regnum
<
NREGS
))
return
regnum
;
else
return
-
1
;
}
else
{
int
i
;
for
(
i
=
0
;
i
<
NREGS
;
i
++
)
if
(
strcasecmp
(
s
+
1
,
lisp_register_names
[
i
])
==
0
)
return
i
;
return
-
1
;
}
}
lispobj
parse_lispobj
(
ptr
)
lispobj
parse_lispobj
(
ptr
)
char
**
ptr
;
char
**
ptr
;
{
{
...
@@ -261,14 +293,33 @@ char **ptr;
...
@@ -261,14 +293,33 @@ char **ptr;
if
(
token
==
NULL
)
{
if
(
token
==
NULL
)
{
printf
(
"Expected an object.
\n
"
);
printf
(
"Expected an object.
\n
"
);
throw_to_monitor
();
throw_to_monitor
();
}
}
else
if
(
token
[
0
]
==
'$'
)
{
else
if
(
token
[
0
]
==
'$'
)
{
if
(
isalpha
(
token
[
1
]))
{
if
(
!
lookup_variable
(
token
+
1
,
&
result
))
{
int
free
;
int
regnum
;
struct
sigcontext
*
context
;
free
=
SymbolValue
(
FREE_INTERRUPT_CONTEXT_INDEX
)
>>
2
;
if
(
free
==
0
)
{
printf
(
"Variable ``%s'' is not valid -- there is no current interrupt context.
\n
"
,
token
);
throw_to_monitor
();
}
context
=
lisp_interrupt_contexts
[
free
-
1
];
regnum
=
parse_regnum
(
token
);
if
(
regnum
<
0
)
{
printf
(
"Bogus register: ``%s''
\n
"
,
token
);
throw_to_monitor
();
}
result
=
context
->
sc_regs
[
regnum
];
}
else
if
(
!
lookup_variable
(
token
+
1
,
&
result
))
{
printf
(
"Unknown variable: ``%s''
\n
"
,
token
);
printf
(
"Unknown variable: ``%s''
\n
"
,
token
);
throw_to_monitor
();
throw_to_monitor
();
}
}
}
}
else
if
(
token
[
0
]
==
'@'
)
{
else
if
(
token
[
0
]
==
'@'
)
{
if
(
string_to_long
(
token
+
1
,
&
pointer
))
{
if
(
string_to_long
(
token
+
1
,
&
pointer
))
{
pointer
&=
~
3
;
pointer
&=
~
3
;
if
(
valid_addr
(
pointer
))
if
(
valid_addr
(
pointer
))
...
...
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