Skip to content

Commit 3c622ed

Browse files
committed
Merge branch 'fixes' into 'derivgrind'
Fixes to support newer GCC versions that handle certain warnings as errors by default. Thanks to tungcg1906 for reporting the bug. See merge request aehle/valgrind!30
2 parents 0bd14a1 + 530de68 commit 3c622ed

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

derivgrind/dg_shadow.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@
104104
* \param[in] tag - Tag that is also printed.
105105
* \param[in] value - Printed value.
106106
*/
107-
static VG_REGPARM(0) void dg_Print_double(ULong tag, ULong value){ VG_(printf)("Value for %d : ", tag); VG_(printf)("%lf\n", *(double*)&value); }
108-
static VG_REGPARM(0) void dg_Print_unsignedlong(ULong tag, ULong value){ VG_(printf)("Value for %d : ", tag); VG_(printf)("%p\n", (void*)value); }
109-
static VG_REGPARM(0) void dg_Print_unsignedint(ULong tag, Int value){ VG_(printf)("Value for %d : ", tag); VG_(printf)("%p\n", (void*)value); }
107+
static VG_REGPARM(0) void dg_Print_double(ULong tag, ULong value){ VG_(printf)("Value for %Lu : ", tag); VG_(printf)("%lf\n", *(double*)&value); }
108+
static VG_REGPARM(0) void dg_Print_unsignedlong(ULong tag, ULong value){ VG_(printf)("Value for %Lu : ", tag); VG_(printf)("%p\n", (void*)value); }
109+
static VG_REGPARM(0) void dg_Print_unsignedint(ULong tag, Int value){ VG_(printf)("Value for %Lu : ", tag); VG_(printf)("%p\n", (void*)value); }
110110

111111
/*! Debugging help. Add a dirty statement to IRSB that prints the value of expr whenever it is run.
112112
* \param[in] tag - Tag of your choice, will be printed alongside.
@@ -115,7 +115,7 @@ static VG_REGPARM(0) void dg_Print_unsignedint(ULong tag, Int value){ VG_(printf
115115
*/
116116
void dg_add_print_stmt(ULong tag, IRSB* sb_out, IRExpr* expr){
117117
IRType type = typeOfIRExpr(sb_out->tyenv, expr);
118-
char* fname;
118+
char const* fname;
119119
void* fptr;
120120
IRExpr* expr_to_print;
121121
switch(type){

derivgrind/dg_shadow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
#include "pub_tool_mallocfree.h"
3838
#include "pub_tool_libcassert.h"
3939
#include "pub_tool_gdbserver.h"
40+
#include "pub_tool_machine.h"
4041
#include "pub_tool_libcbase.h"
42+
#include "pub_tool_libcprint.h"
4143

4244
#include "dg_utils.h"
4345

derivgrind/dg_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
#include "pub_tool_basics.h"
3636
#include "pub_tool_tooliface.h"
37+
#include "pub_tool_libcprint.h"
3738

3839
#ifndef __GNUC__
3940
#error "Only tested with GCC."

derivgrind/dot/dg_dot_diffquotdebug.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "pub_tool_libcassert.h"
1111
#include "pub_tool_gdbserver.h"
1212
#include "pub_tool_libcbase.h"
13+
#include "pub_tool_libcprint.h"
14+
#include "pub_tool_machine.h"
1315

1416
#include "dg_utils.h"
1517

derivgrind/trick/dg_trick.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#define DG_TRICK_H
3434

3535
#include "pub_tool_basics.h"
36+
#include "pub_tool_threadstate.h"
37+
#include "pub_tool_stacktrace.h"
3638
#include "../dg_utils.h"
3739

3840
/*! Add bit-trick-finding instrumentation to output IRSB.

0 commit comments

Comments
 (0)