Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kernel Program Behaviour Models
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
felixkhals
Kernel Program Behaviour Models
Commits
ba52bac8
Commit
ba52bac8
authored
Jul 5, 2022
by
fu5520tp
Browse files
Options
Downloads
Patches
Plain Diff
changed config and added info for gdb debugging
parent
bd09eef9
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.config
+6
-2
6 additions, 2 deletions
.config
build
+2
-1
2 additions, 1 deletion
build
pb_utils/readme.md
+17
-0
17 additions, 0 deletions
pb_utils/readme.md
pb_utils/run_qemu.sh
+1
-1
1 addition, 1 deletion
pb_utils/run_qemu.sh
with
26 additions
and
4 deletions
.config
+
6
−
2
View file @
ba52bac8
...
@@ -203,7 +203,7 @@ CONFIG_SYSFS_SYSCALL=y
...
@@ -203,7 +203,7 @@ CONFIG_SYSFS_SYSCALL=y
# CONFIG_SYSCTL_SYSCALL is not set
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_POSIX_TIMERS
=
y
CONFIG_POSIX_TIMERS
=
y
CONFIG_KALLSYMS
=
y
CONFIG_KALLSYMS
=
y
#
CONFIG_KALLSYMS_ALL
is not set
CONFIG_KALLSYMS_ALL
=
y
CONFIG_KALLSYMS_ABSOLUTE_PERCPU
=
y
CONFIG_KALLSYMS_ABSOLUTE_PERCPU
=
y
CONFIG_KALLSYMS_BASE_RELATIVE
=
y
CONFIG_KALLSYMS_BASE_RELATIVE
=
y
CONFIG_PRINTK
=
y
CONFIG_PRINTK
=
y
...
@@ -3770,7 +3770,11 @@ CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
...
@@ -3770,7 +3770,11 @@ CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
#
#
# Compile-time checks and compiler options
# Compile-time checks and compiler options
#
#
# CONFIG_DEBUG_INFO is not set
CONFIG_DEBUG_INFO
=
y
# CONFIG_DEBUG_INFO_REDUCED is not set
# CONFIG_DEBUG_INFO_SPLIT is not set
# CONFIG_DEBUG_INFO_DWARF4 is not set
CONFIG_GDB_SCRIPTS
=
y
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_WARN_DEPRECATED is not set
CONFIG_ENABLE_MUST_CHECK
=
y
CONFIG_ENABLE_MUST_CHECK
=
y
CONFIG_FRAME_WARN
=
2048
CONFIG_FRAME_WARN
=
2048
...
...
This diff is collapsed.
Click to expand it.
build
+
2
−
1
View file @
ba52bac8
worker
=
8
worker
=
8
make
-
j
"
$worker
"
bzImage
time
make
-
j
"
$worker
"
bzImage
ln
-
sf
scripts
/
gdb
/
vmlinux
-
gdb
.
py
vmlinux
-
gdb
.
py
# fix symlink for gdb
This diff is collapsed.
Click to expand it.
pb_utils/readme.md
+
17
−
0
View file @
ba52bac8
...
@@ -22,3 +22,20 @@ cd /mnt
...
@@ -22,3 +22,20 @@ cd /mnt
# run the build kernel with the created rootfs
# run the build kernel with the created rootfs
run
`./run_qemu.sh`
run
`./run_qemu.sh`
# debug using gdb
run
`./run_qemu.sh gdb`
run in a seperate shell:
```
bash
cd
..
# to workspace root
gdb vmlinux
\
-ex
'lx-symbols'
\
-ex
'target remote :1234'
\
-ex
'hb init_pb_rq'
```
look for gdb
`add-auto-load-safe-path`
warning and follow instruction to enable loading of kernel gdb scripts
use hardware breakpoints instead of software breaks
This diff is collapsed.
Click to expand it.
pb_utils/run_qemu.sh
+
1
−
1
View file @
ba52bac8
...
@@ -9,7 +9,7 @@ COMMAND="qemu-system-x86_64"
...
@@ -9,7 +9,7 @@ COMMAND="qemu-system-x86_64"
[
"
$MODE
"
==
"gdb"
]
&&
COMMAND+
=
$DEBUG_OPTIONS
[
"
$MODE
"
==
"gdb"
]
&&
COMMAND+
=
$DEBUG_OPTIONS
COMMAND+
=
" -kernel
$KERNEL
-cpu host"
COMMAND+
=
" -kernel
$KERNEL
-cpu host"
COMMAND+
=
$IMAGE_OPTIONS
COMMAND+
=
$IMAGE_OPTIONS
COMMAND+
=
" -append
\"
root=/dev/sda rootwait rw single console=ttyS0
\"
"
COMMAND+
=
" -append
\"
root=/dev/sda rootwait rw single console=ttyS0
nokaslr
\"
"
# disable kaslr for better gdb debugging
COMMAND+
=
" --enable-kvm"
COMMAND+
=
" --enable-kvm"
COMMAND+
=
" --nographic"
COMMAND+
=
" --nographic"
COMMAND+
=
" --smp 1"
COMMAND+
=
" --smp 1"
...
...
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