Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
55d13e8d
Commit
55d13e8d
authored
Jul 12, 2011
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* build dbug manual and unit tests
* document safemalloc
parent
20056897
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
3 deletions
+63
-3
dbug/CMakeLists.txt
dbug/CMakeLists.txt
+44
-0
dbug/user.r
dbug/user.r
+19
-3
No files found.
dbug/CMakeLists.txt
View file @
55d13e8d
...
...
@@ -20,3 +20,47 @@ INCLUDE_DIRECTORIES(
SET
(
DBUG_SOURCES dbug.c
)
ADD_CONVENIENCE_LIBRARY
(
dbug
${
DBUG_SOURCES
}
)
TARGET_LINK_LIBRARIES
(
dbug mysys
)
ADD_EXECUTABLE
(
tests tests.c
)
TARGET_LINK_LIBRARIES
(
tests dbug
)
ADD_EXECUTABLE
(
factorial my_main.c factorial.c
)
TARGET_LINK_LIBRARIES
(
factorial dbug
)
IF
(
NOT WIN32
)
FIND_PROGRAM
(
GROFF groff
)
FIND_PROGRAM
(
NROFF nroff
)
SET
(
OUTPUT_INC output1.r output2.r output3.r output4.r output5.r
)
SET
(
SOURCE_INC factorial.r main.r example1.r example2.r example3.r
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
OUTPUT_INC
}
DEPENDS factorial
COMMAND ./factorial 1 2 3 4 5 > output1.r
COMMAND ./factorial -\
#t:o 2 3 > output2.r
COMMAND ./factorial -\
#d:t:o 3 > output3.r
COMMAND ./factorial -\
#d,result:o 4 > output4.r
COMMAND ./factorial -\
#d:f,factorial:F:L:o 3 > output5.r)
FOREACH
(
file
${
SOURCE_INC
}
)
STRING
(
REGEX REPLACE
"
\\
.r"
".c"
srcfile
${
file
}
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
file
}
DEPENDS
${
srcfile
}
COMMAND sed -e 's!\\\\!\\\\\\\\!g'
<
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
srcfile
}
>
${
file
}
)
ENDFOREACH
(
file
)
ADD_CUSTOM_COMMAND
(
OUTPUT tests-t DEPENDS tests-t.pl
COMMAND cp -f
${
CMAKE_CURRENT_SOURCE_DIR
}
/tests-t.pl tests-t
)
ADD_CUSTOM_TARGET
(
unit ALL DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/tests-t
)
IF
(
GROFF
)
ADD_CUSTOM_COMMAND
(
OUTPUT user.ps
DEPENDS user.r
${
OUTPUT_INC
}
${
SOURCE_INC
}
COMMAND
${
GROFF
}
-mm
${
CMAKE_CURRENT_SOURCE_DIR
}
/user.r > user.ps
)
ADD_CUSTOM_TARGET
(
ps ALL DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/user.ps
)
ENDIF
(
GROFF
)
IF
(
NROFF
)
ADD_CUSTOM_COMMAND
(
OUTPUT user.t
DEPENDS user.r
${
OUTPUT_INC
}
${
SOURCE_INC
}
COMMAND
${
NROFF
}
-mm
${
CMAKE_CURRENT_SOURCE_DIR
}
/user.r > user.t
)
ADD_CUSTOM_TARGET
(
t ALL DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/user.t
)
ENDIF
(
NROFF
)
ENDIF
(
NOT WIN32
)
dbug/user.r
View file @
55d13e8d
...
...
@@ -881,6 +881,20 @@ Modifying
.I initial
value does not affect threads that are already running. Obviously,
these macros are only useful in the multi-threaded environment.
.SP 1
.LI DBUG_MALLOC\
.LI DBUG_REALLOC\
.LI DBUG_FREE\
When these macros are used instead of system malloc(), realloc(), and free(),
.I dbug
built-in memory debugger performs checks for memory overwrites, underwrites,
memory leaks, and accesses to uninitialized or freed memory. Memory leaks are
found as memory not deallocated at shutdown. Memory overwrites and underwrites
are detected when this memory is about to be freed (by
.B DBUG_FREE
macro), unless
.B S
flag is present in the debug control string (see below).
.LE
.SK
...
...
@@ -989,9 +1003,11 @@ Most useful with
macros used to temporarily alter the
debugger state.
.LI S
When compiled with
.I safemalloc
this flag invokes "
sanity
" memory checks (for overwrites/underwrites)
Check the memory allocated with
.B DBUG_MALLOC
and
.B DBUG_REALLOC
for overwrites/underwrites
on each
.B DBUG_ENTER
and
...
...
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