Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
0d20dd0b
Commit
0d20dd0b
authored
Oct 26, 2011
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util: Add hex_dump helper
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@gmail.com
>
parent
ae41bc9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
util.h
include/util.h
+2
-0
util.c
util.c
+14
-0
No files found.
include/util.h
View file @
0d20dd0b
...
@@ -154,6 +154,8 @@ int reopen_fd_as(int new_fd, int old_fd);
...
@@ -154,6 +154,8 @@ int reopen_fd_as(int new_fd, int old_fd);
int
parse_maps
(
pid_t
pid
,
struct
list_head
*
vma_list
);
int
parse_maps
(
pid_t
pid
,
struct
list_head
*
vma_list
);
int
close_safe
(
int
*
fd
);
int
close_safe
(
int
*
fd
);
void
hex_dump
(
void
*
addr
,
unsigned
long
len
);
DIR
*
opendir_proc
(
char
*
fmt
,
...);
DIR
*
opendir_proc
(
char
*
fmt
,
...);
FILE
*
fopen_proc
(
char
*
fmt
,
char
*
mode
,
...);
FILE
*
fopen_proc
(
char
*
fmt
,
char
*
mode
,
...);
int
open_fmt
(
char
*
fmt
,
int
mode
,
...);
int
open_fmt
(
char
*
fmt
,
int
mode
,
...);
...
...
util.c
View file @
0d20dd0b
...
@@ -130,6 +130,20 @@ err:
...
@@ -130,6 +130,20 @@ err:
return
-
2
;
return
-
2
;
}
}
void
hex_dump
(
void
*
addr
,
unsigned
long
len
)
{
unsigned
char
*
p
=
addr
;
unsigned
long
i
;
len
=
(
len
+
8
)
&
~
7
;
for
(
i
=
0
;
i
<
len
;
i
+=
8
)
{
printk
(
"%08lx: %02x %02x %02x %02x %02x %02x %02x %02x
\n
"
,
p
,
p
[
i
+
0
],
p
[
i
+
1
],
p
[
i
+
2
],
p
[
i
+
3
],
p
[
i
+
4
],
p
[
i
+
5
],
p
[
i
+
6
],
p
[
i
+
7
]);
}
}
void
printk_registers
(
user_regs_struct_t
*
regs
)
void
printk_registers
(
user_regs_struct_t
*
regs
)
{
{
printk
(
"ip : %16lx cs : %16lx ds : %16lx
\n
"
printk
(
"ip : %16lx cs : %16lx ds : %16lx
\n
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment