Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Krishna Vinnakota
CSEP551
Commits
568bbae8
Commit
568bbae8
authored
15 years ago
by
Silas Boyd-Wickizer
Browse files
Options
Downloads
Patches
Plain Diff
qemu-gdb target and script
parent
c51e175b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gdbinit.tmpl
+28
-0
28 additions, 0 deletions
.gdbinit.tmpl
Makefile
+13
-2
13 additions, 2 deletions
Makefile
with
41 additions
and
2 deletions
.gdbinit.tmpl
0 → 100644
+
28
−
0
View file @
568bbae8
set $lastcs = -1
# This fails on Darwin because the default gdb has no ELF support
# echo + symbol-file obj/kern/kernel\n
# symbol-file obj/kern/kernel
define hook-stop
# There doesn't seem to be a good way to detect if we're in 16- or
# 32-bit mode, but in 32-bit mode we always run with CS == 8 in the
# kernel and CS == 35 in user space
if $cs == 8 || $cs == 35
if $lastcs != 8 && $lastcs != 35
set architecture i386
end
x/i $pc
else
if $lastcs == -1 || $lastcs == 8 || $lastcs == 35
set architecture i8086
end
# Translate the segment:offset into a physical address
printf "[%4x:%4x] ", $cs, $eip
x/i $cs*16+$eip
end
set $lastcs = $cs
end
echo + target remote localhost:1234\n
target remote localhost:1234
This diff is collapsed.
Click to expand it.
Makefile
+
13
−
2
View file @
568bbae8
...
...
@@ -138,11 +138,22 @@ bochs : fs.img xv6.img
if
[
!
-e
.bochsrc
]
;
then
ln
-s
dot-bochsrc .bochsrc
;
fi
bochs
-q
# try to generate a unique GDB port
GDBPORT
=
$(
shell
expr
`
id
-u
`
% 5000 + 25000
)
QEMUOPTS
=
-smp
2
-hdb
fs.img xv6.img
qemu
:
fs.img xv6.img
qemu
-parallel
stdio
-smp
2
-hdb
fs.img xv6.img
qemu
-parallel
mon:
stdio
$(
QEMUOPTS
)
qemutty
:
fs.img xv6.img
qemu
-nographic
-smp
2
-hdb
fs.img xv6.img
qemu
-nographic
$(
QEMUOPTS
)
.gdbinit
:
.gdbinit.tmpl
sed
"s/localhost:1234/localhost:
$(
GDBPORT
)
/"
<
$^
>
$@
qemu-gdb
:
fs.img xv6.img .gdbinit
@
echo
"*** Now run 'gdb'."
1>&2
qemu
-parallel
mon:stdio
$(
QEMUOPTS
)
-s
-S
-p
$(
GDBPORT
)
# CUT HERE
# prepare dist for students
...
...
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