A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure some paranoid compilers don't choke on our example (unused variable globalc...
[simgrid.git]
/
src
/
xbt
/
ex.c
diff --git
a/src/xbt/ex.c
b/src/xbt/ex.c
index
b29414d
..
598fbf9
100644
(file)
--- a/
src/xbt/ex.c
+++ b/
src/xbt/ex.c
@@
-147,12
+147,15
@@
void xbt_ex_setup_backtrace(xbt_ex_t *e) {
DEBUG4("%#lx %s [%#lx-%#lx]",
addr, found? "in":"out of",first,last);
}
DEBUG4("%#lx %s [%#lx-%#lx]",
addr, found? "in":"out of",first,last);
}
- if (!found)
- CRITICAL0("Problem while reading the maps file");
-
fclose(maps);
free(maps_name);
fclose(maps);
free(maps_name);
+ if (!found) {
+ WARN0("Problem while reading the maps file");
+ e->bt_strings[i] = bprintf("** In ?? (%s)", backtrace[i]);
+ continue;
+ }
+
/* Ok, Found the offset of the maps line containing the searched symbol.
We now need to substract this from the address we got from backtrace.
*/
/* Ok, Found the offset of the maps line containing the searched symbol.
We now need to substract this from the address we got from backtrace.
*/
@@
-451,9
+454,10
@@
static void bad_example(void) {
/* end_of_bad_example */
}
#endif
/* end_of_bad_example */
}
#endif
-
+typedef struct {char *first;} global_context_t;
+
static void good_example(void) {
static void good_example(void) {
-
struct {char*first;} *globalcontext
;
+
global_context_t *global_context=malloc(sizeof(global_context_t))
;
xbt_ex_t ex;
/* GOOD_EXAMPLE */
xbt_ex_t ex;
/* GOOD_EXAMPLE */
@@
-463,7
+467,7
@@
static void good_example(void) {
char * volatile /*03*/ cp3 = NULL /*02*/;
TRY {
cp1 = mallocex(SMALLAMOUNT);
char * volatile /*03*/ cp3 = NULL /*02*/;
TRY {
cp1 = mallocex(SMALLAMOUNT);
- globalcontext->first = cp1;
+ global
_
context->first = cp1;
cp1 = NULL /*05 give away*/;
cp2 = mallocex(TOOBIG);
cp3 = mallocex(SMALLAMOUNT);
cp1 = NULL /*05 give away*/;
cp2 = mallocex(TOOBIG);
cp3 = mallocex(SMALLAMOUNT);