Skip to content

Commit 4df0bfc

Browse files
author
petarj
committed
mips: adding MIPS64LE support to Valgrind
Necessary changes to Valgrind to support MIPS64LE on Linux. Minor cleanup/style changes embedded in the patch as well. The change corresponds to r2687 in VEX. Patch written by Dejan Jevtic and Petar Jovanovic. More information about this issue: https://bugs.kde.org/show_bug.cgi?id=313267 git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13292 a5019735-40e9-0310-863c-91ae7b9d1cf9
1 parent 3a00f52 commit 4df0bfc

File tree

84 files changed

+5496
-342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+5496
-342
lines changed

Makefile.all.am

+4
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ AM_FLAG_M3264_MIPS32_LINUX = @FLAG_M32@
176176
AM_CFLAGS_MIPS32_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE) -mips32
177177
AM_CCASFLAGS_MIPS32_LINUX = @FLAG_M32@ -mips32 -g
178178

179+
AM_FLAG_M3264_MIPS64_LINUX = @FLAG_M64@
180+
AM_CFLAGS_MIPS64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) -mips64
181+
AM_CCASFLAGS_MIPS64_LINUX = @FLAG_M64@ -mips64 -g
179182

180183
# Flags for the primary target. These must be used to build the
181184
# regtests and performance tests. In fact, these must be used to
@@ -214,4 +217,5 @@ PRELOAD_LDFLAGS_X86_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch i386
214217
PRELOAD_LDFLAGS_AMD64_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch x86_64
215218
PRELOAD_LDFLAGS_S390X_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
216219
PRELOAD_LDFLAGS_MIPS32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
220+
PRELOAD_LDFLAGS_MIPS64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
217221

Makefile.tool.am

+12
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ TOOL_LDFLAGS_MIPS32_LINUX = \
6464
-static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
6565
@FLAG_M32@
6666

67+
TOOL_LDFLAGS_MIPS64_LINUX = \
68+
-static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
69+
@FLAG_M64@
70+
6771
# On Android we must ask for non-executable stack, not sure why.
6872
if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
6973
if VGCONF_PLATVARIANT_IS_ANDROID
@@ -111,6 +115,9 @@ LIBREPLACEMALLOC_S390X_LINUX = \
111115
LIBREPLACEMALLOC_MIPS32_LINUX = \
112116
$(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips32-linux.a
113117

118+
LIBREPLACEMALLOC_MIPS64_LINUX = \
119+
$(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips64-linux.a
120+
114121
LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \
115122
-Wl,--whole-archive \
116123
$(LIBREPLACEMALLOC_X86_LINUX) \
@@ -152,6 +159,11 @@ LIBREPLACEMALLOC_LDFLAGS_MIPS32_LINUX = \
152159
$(LIBREPLACEMALLOC_MIPS32_LINUX) \
153160
-Wl,--no-whole-archive
154161

162+
LIBREPLACEMALLOC_LDFLAGS_MIPS64_LINUX = \
163+
-Wl,--whole-archive \
164+
$(LIBREPLACEMALLOC_MIPS64_LINUX) \
165+
-Wl,--no-whole-archive
166+
155167
#----------------------------------------------------------------------------
156168
# General stuff
157169
#----------------------------------------------------------------------------

README

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ platforms:
4141
- AMD64/MacOSX
4242
- S390X/Linux
4343
- MIPS32/Linux
44+
- MIPS64/Linux
4445

4546
Note that AMD64 is just another name for x86_64, and Valgrind runs fine
4647
on Intel processors. Also note that the core of MacOSX is called

cachegrind/cg-arch.c

+7
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,13 @@ configure_caches(cache_t *I1c, cache_t *D1c, cache_t *LLc,
404404
*D1c = (cache_t) { 32768, 4, 32 };
405405
*LLc = (cache_t) { 524288, 8, 32 };
406406

407+
#elif defined(VGA_mips64)
408+
409+
// Set caches to default (for MIPS64 - 5kc)
410+
*I1c = (cache_t) { 32768, 4, 32 };
411+
*D1c = (cache_t) { 32768, 4, 32 };
412+
*LLc = (cache_t) { 524288, 8, 32 };
413+
407414
#elif defined(VGA_x86) || defined(VGA_amd64)
408415

409416
*I1c = (cache_t) { 65536, 2, 64 };

cachegrind/cg_branchpred.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/* How many bits at the bottom of an instruction address are
4646
guaranteed to be zero? */
4747
#if defined(VGA_ppc32) || defined(VGA_ppc64) || defined(VGA_arm) \
48-
|| defined(VGA_mips32)
48+
|| defined(VGA_mips32) || defined(VGA_mips64)
4949
# define N_IADDR_LO_ZERO_BITS 2
5050
#elif defined(VGA_x86) || defined(VGA_amd64)
5151
# define N_IADDR_LO_ZERO_BITS 0

configure.in

+36-12
Original file line numberDiff line numberDiff line change
@@ -192,20 +192,29 @@ case "${host_cpu}" in
192192
;;
193193

194194
mips)
195-
AC_MSG_RESULT([ok (${host_cpu})])
196-
ARCH_MAX="mips32"
197-
;;
195+
AC_MSG_RESULT([ok (${host_cpu})])
196+
ARCH_MAX="mips32"
197+
;;
198198

199199
mipsel)
200-
AC_MSG_RESULT([ok (${host_cpu})])
201-
ARCH_MAX="mips32"
202-
;;
200+
AC_MSG_RESULT([ok (${host_cpu})])
201+
ARCH_MAX="mips32"
202+
;;
203203

204204
mipsisa32r2)
205-
AC_MSG_RESULT([ok (${host_cpu})])
206-
ARCH_MAX="mips32"
207-
;;
205+
AC_MSG_RESULT([ok (${host_cpu})])
206+
ARCH_MAX="mips32"
207+
;;
208208

209+
mips64*)
210+
AC_MSG_RESULT([ok (${host_cpu})])
211+
ARCH_MAX="mips64"
212+
;;
213+
214+
mipsisa64*)
215+
AC_MSG_RESULT([ok (${host_cpu})])
216+
ARCH_MAX="mips64"
217+
;;
209218
*)
210219
AC_MSG_RESULT([no (${host_cpu})])
211220
AC_MSG_ERROR([Unsupported host architecture. Sorry])
@@ -567,7 +576,16 @@ case "$ARCH_MAX-$VGCONF_OS" in
567576
valt_load_address_sec_norml="0xUNSET"
568577
valt_load_address_sec_inner="0xUNSET"
569578
AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
570-
AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
579+
;;
580+
mips64-linux)
581+
VGCONF_ARCH_PRI="mips64"
582+
VGCONF_PLATFORM_PRI_CAPS="MIPS64_LINUX"
583+
VGCONF_PLATFORM_SEC_CAPS=""
584+
valt_load_address_pri_norml="0x38000000"
585+
valt_load_address_pri_inner="0x28000000"
586+
valt_load_address_sec_norml="0xUNSET"
587+
valt_load_address_sec_inner="0xUNSET"
588+
AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
571589
;;
572590
*)
573591
VGCONF_ARCH_PRI="unknown"
@@ -606,6 +624,8 @@ AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X,
606624
test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX )
607625
AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS32,
608626
test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX )
627+
AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS64,
628+
test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX )
609629

610630
# Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these
611631
# become defined.
@@ -626,6 +646,8 @@ AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX,
626646
-o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX)
627647
AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX,
628648
test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX)
649+
AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS64_LINUX,
650+
test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX)
629651

630652
AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN,
631653
test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
@@ -644,7 +666,8 @@ AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
644666
-o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
645667
-o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
646668
-o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
647-
-o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX)
669+
-o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
670+
-o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX)
648671
AM_CONDITIONAL(VGCONF_OS_IS_DARWIN,
649672
test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
650673
-o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
@@ -2079,7 +2102,8 @@ mflag_primary=
20792102
if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
20802103
-o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
20812104
-o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
2082-
-o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX ; then
2105+
-o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
2106+
-o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX ; then
20832107
mflag_primary=$FLAG_M32
20842108
elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
20852109
-o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \

coregrind/Makefile.am

+17-1
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ COREGRIND_SOURCES_COMMON = \
308308
m_dispatch/dispatch-arm-linux.S \
309309
m_dispatch/dispatch-s390x-linux.S \
310310
m_dispatch/dispatch-mips32-linux.S \
311+
m_dispatch/dispatch-mips64-linux.S \
311312
m_dispatch/dispatch-x86-darwin.S \
312313
m_dispatch/dispatch-amd64-darwin.S \
313314
m_gdbserver/inferiors.c \
@@ -325,6 +326,7 @@ COREGRIND_SOURCES_COMMON = \
325326
m_gdbserver/valgrind-low-ppc64.c \
326327
m_gdbserver/valgrind-low-s390x.c \
327328
m_gdbserver/valgrind-low-mips32.c \
329+
m_gdbserver/valgrind-low-mips64.c \
328330
m_gdbserver/version.c \
329331
m_initimg/initimg-linux.c \
330332
m_initimg/initimg-darwin.c \
@@ -345,6 +347,7 @@ COREGRIND_SOURCES_COMMON = \
345347
m_sigframe/sigframe-arm-linux.c \
346348
m_sigframe/sigframe-s390x-linux.c \
347349
m_sigframe/sigframe-mips32-linux.c \
350+
m_sigframe/sigframe-mips64-linux.c \
348351
m_sigframe/sigframe-x86-darwin.c \
349352
m_sigframe/sigframe-amd64-darwin.c \
350353
m_syswrap/syscall-x86-linux.S \
@@ -354,6 +357,7 @@ COREGRIND_SOURCES_COMMON = \
354357
m_syswrap/syscall-arm-linux.S \
355358
m_syswrap/syscall-s390x-linux.S \
356359
m_syswrap/syscall-mips32-linux.S \
360+
m_syswrap/syscall-mips64-linux.S \
357361
m_syswrap/syscall-x86-darwin.S \
358362
m_syswrap/syscall-amd64-darwin.S \
359363
m_syswrap/syswrap-main.c \
@@ -368,6 +372,7 @@ COREGRIND_SOURCES_COMMON = \
368372
m_syswrap/syswrap-arm-linux.c \
369373
m_syswrap/syswrap-s390x-linux.c \
370374
m_syswrap/syswrap-mips32-linux.c \
375+
m_syswrap/syswrap-mips64-linux.c \
371376
m_syswrap/syswrap-x86-darwin.c \
372377
m_syswrap/syswrap-amd64-darwin.c \
373378
m_syswrap/syswrap-xen.c \
@@ -554,7 +559,18 @@ GDBSERVER_XML_FILES = \
554559
m_gdbserver/mips-linux-valgrind.xml \
555560
m_gdbserver/mips-fpu-valgrind-s1.xml \
556561
m_gdbserver/mips-fpu-valgrind-s2.xml \
557-
m_gdbserver/mips-fpu.xml
562+
m_gdbserver/mips-fpu.xml \
563+
m_gdbserver/mips64-cp0-valgrind-s1.xml \
564+
m_gdbserver/mips64-cp0-valgrind-s2.xml \
565+
m_gdbserver/mips64-cp0.xml \
566+
m_gdbserver/mips64-cpu-valgrind-s1.xml \
567+
m_gdbserver/mips64-cpu-valgrind-s2.xml \
568+
m_gdbserver/mips64-cpu.xml \
569+
m_gdbserver/mips64-linux.xml \
570+
m_gdbserver/mips64-linux-valgrind.xml \
571+
m_gdbserver/mips64-fpu-valgrind-s1.xml \
572+
m_gdbserver/mips64-fpu-valgrind-s2.xml \
573+
m_gdbserver/mips64-fpu.xml
558574

559575
# so as to make sure these get copied into the install tree
560576
vglibdir = $(pkglibdir)

coregrind/launcher-linux.c

+10-1
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ static const char *select_platform(const char *clientname)
211211
(ehdr->e_ident[EI_OSABI] == ELFOSABI_SYSV ||
212212
ehdr->e_ident[EI_OSABI] == ELFOSABI_LINUX)) {
213213
platform = "amd64-linux";
214+
} else if (ehdr->e_machine == EM_MIPS &&
215+
(ehdr->e_ident[EI_OSABI] == ELFOSABI_SYSV ||
216+
ehdr->e_ident[EI_OSABI] == ELFOSABI_LINUX)) {
217+
platform = "mips64-linux";
214218
}
215219
} else if (header[EI_DATA] == ELFDATA2MSB) {
216220
# if !defined(VGPV_arm_linux_android) && !defined(VGPV_x86_linux_android)
@@ -224,6 +228,10 @@ static const char *select_platform(const char *clientname)
224228
(ehdr->e_ident[EI_OSABI] == ELFOSABI_SYSV ||
225229
ehdr->e_ident[EI_OSABI] == ELFOSABI_LINUX)) {
226230
platform = "s390x-linux";
231+
} else if (ehdr->e_machine == EM_MIPS &&
232+
(ehdr->e_ident[EI_OSABI] == ELFOSABI_SYSV ||
233+
ehdr->e_ident[EI_OSABI] == ELFOSABI_LINUX)) {
234+
platform = "mips64-linux";
227235
}
228236
# endif
229237
}
@@ -300,7 +308,8 @@ int main(int argc, char** argv, char** envp)
300308
(0==strcmp(VG_PLATFORM,"ppc64-linux")) ||
301309
(0==strcmp(VG_PLATFORM,"arm-linux")) ||
302310
(0==strcmp(VG_PLATFORM,"s390x-linux")) ||
303-
(0==strcmp(VG_PLATFORM,"mips32-linux")))
311+
(0==strcmp(VG_PLATFORM,"mips32-linux")) ||
312+
(0==strcmp(VG_PLATFORM,"mips64-linux")))
304313
default_platform = VG_PLATFORM;
305314
else
306315
barf("Unknown VG_PLATFORM '%s'", VG_PLATFORM);

coregrind/m_aspacemgr/aspacemgr-common.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ SysRes VG_(am_do_mmap_NO_NOTIFY)( Addr start, SizeT length, UInt prot,
159159
res = VG_(do_syscall6)(__NR_mmap2, (UWord)start, length,
160160
prot, flags, fd, offset / 4096);
161161
# elif defined(VGP_amd64_linux) || defined(VGP_ppc64_linux) \
162-
|| defined(VGP_s390x_linux) || defined(VGP_mips32_linux)
162+
|| defined(VGP_s390x_linux) || defined(VGP_mips32_linux) \
163+
|| defined(VGP_mips64_linux)
163164
res = VG_(do_syscall6)(__NR_mmap, (UWord)start, length,
164165
prot, flags, fd, offset);
165166
# elif defined(VGP_x86_darwin)

coregrind/m_aspacemgr/aspacemgr-linux.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2533,7 +2533,7 @@ static SysRes VG_(am_mmap_file_float_valgrind_flags) ( SizeT length, UInt prot,
25332533
/* Ask for an advisory. If it's negative, fail immediately. */
25342534
req.rkind = MAny;
25352535
req.start = 0;
2536-
#if defined(VGA_arm) || defined(VGA_mips32)
2536+
#if defined(VGA_arm) || defined(VGA_mips32) || defined(VGA_mips64)
25372537
aspacem_assert(VKI_SHMLBA >= VKI_PAGE_SIZE);
25382538
#else
25392539
aspacem_assert(VKI_SHMLBA == VKI_PAGE_SIZE);

coregrind/m_cache.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ get_cache_info(VexArchInfo *vai)
539539
}
540540

541541
#elif defined(VGA_arm) || defined(VGA_ppc32) || defined(VGA_ppc64) || \
542-
defined(VGA_mips32)
542+
defined(VGA_mips32) || defined(VGA_mips64)
543543

544544
static Bool
545545
get_cache_info(VexArchInfo *vai)

coregrind/m_coredump/coredump-elf.c

+16
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,15 @@ static void fill_prstatus(const ThreadState *tst,
376376
# undef DO
377377
regs->orig_gpr2 = arch->vex.guest_r2;
378378
#elif defined(VGP_mips32_linux)
379+
# define DO(n) regs->MIPS_r##n = arch->vex.guest_r##n
380+
DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7);
381+
DO(8); DO(9); DO(10); DO(11); DO(12); DO(13); DO(14); DO(15);
382+
DO(16); DO(17); DO(18); DO(19); DO(20); DO(21); DO(22); DO(23);
383+
DO(24); DO(25); DO(26); DO(27); DO(28); DO(29); DO(30); DO(31);
384+
# undef DO
385+
regs->MIPS_hi = arch->vex.guest_HI;
386+
regs->MIPS_lo = arch->vex.guest_LO;
387+
#elif defined(VGP_mips64_linux)
379388
# define DO(n) regs->MIPS_r##n = arch->vex.guest_r##n
380389
DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7);
381390
DO(8); DO(9); DO(10); DO(11); DO(12); DO(13); DO(14); DO(15);
@@ -471,6 +480,13 @@ static void fill_fpu(const ThreadState *tst, vki_elf_fpregset_t *fpu)
471480
DO(16); DO(17); DO(18); DO(19); DO(20); DO(21); DO(22); DO(23);
472481
DO(24); DO(25); DO(26); DO(27); DO(28); DO(29); DO(30); DO(31);
473482
# undef DO
483+
#elif defined(VGP_mips32_linux) || defined(VGP_mips64_linux)
484+
# define DO(n) (*fpu)[n] = *(double*)(&arch->vex.guest_f##n)
485+
DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7);
486+
DO(8); DO(9); DO(10); DO(11); DO(12); DO(13); DO(14); DO(15);
487+
DO(16); DO(17); DO(18); DO(19); DO(20); DO(21); DO(22); DO(23);
488+
DO(24); DO(25); DO(26); DO(27); DO(28); DO(29); DO(30); DO(31);
489+
# undef DO
474490
#else
475491
# error Unknown ELF platform
476492
#endif

coregrind/m_debugger.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static Int ptrace_setregs(Int pid, VexGuestArchState* vex)
307307

308308
return VG_(ptrace)(VKI_PTRACE_POKEUSR_AREA, pid, &pa, NULL);
309309

310-
#elif defined(VGP_mips32_linux)
310+
#elif defined(VGP_mips32_linux) || defined(VGP_mips64_linux)
311311
struct vki_user_regs_struct regs;
312312
VG_(memset)(&regs, 0, sizeof(regs));
313313
regs.MIPS_r0 = vex->guest_r0;

coregrind/m_debuginfo/d3basics.c

+3
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,9 @@ static Bool get_Dwarf_Reg( /*OUT*/Addr* a, Word regno, RegSummary* regs )
415415
# elif defined(VGP_mips32_linux)
416416
if (regno == 29) { *a = regs->sp; return True; }
417417
if (regno == 30) { *a = regs->fp; return True; }
418+
# elif defined(VGP_mips64_linux)
419+
if (regno == 29) { *a = regs->sp; return True; }
420+
if (regno == 30) { *a = regs->fp; return True; }
418421
# else
419422
# error "Unknown platform"
420423
# endif

coregrind/m_debuginfo/debuginfo.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,8 @@ ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV, Int use_fd )
819819
is_rw_map = False;
820820
is_ro_map = False;
821821

822-
# if defined(VGA_x86) || defined(VGA_ppc32) || defined(VGA_mips32)
822+
# if defined(VGA_x86) || defined(VGA_ppc32) || defined(VGA_mips32) \
823+
|| defined(VGA_mips64)
823824
is_rx_map = seg->hasR && seg->hasX;
824825
is_rw_map = seg->hasR && seg->hasW;
825826
# elif defined(VGA_amd64) || defined(VGA_ppc64) || defined(VGA_arm)
@@ -2105,7 +2106,7 @@ UWord evalCfiExpr ( XArray* exprs, Int ix,
21052106
case Creg_IA_SP: return eec->uregs->sp;
21062107
case Creg_IA_BP: return eec->uregs->fp;
21072108
case Creg_S390_R14: return eec->uregs->lr;
2108-
# elif defined(VGA_mips32)
2109+
# elif defined(VGA_mips32) || defined(VGA_mips64)
21092110
case Creg_IA_IP: return eec->uregs->pc;
21102111
case Creg_IA_SP: return eec->uregs->sp;
21112112
case Creg_IA_BP: return eec->uregs->fp;
@@ -2344,7 +2345,7 @@ static Addr compute_cfa ( D3UnwindRegs* uregs,
23442345
case CFIC_IA_BPREL:
23452346
cfa = cfsi->cfa_off + uregs->fp;
23462347
break;
2347-
# elif defined(VGA_mips32)
2348+
# elif defined(VGA_mips32) || defined(VGA_mips64)
23482349
case CFIC_IA_SPREL:
23492350
cfa = cfsi->cfa_off + uregs->sp;
23502351
break;
@@ -2448,7 +2449,7 @@ Bool VG_(use_CF_info) ( /*MOD*/D3UnwindRegs* uregsHere,
24482449
ipHere = uregsHere->r15;
24492450
# elif defined(VGA_s390x)
24502451
ipHere = uregsHere->ia;
2451-
# elif defined(VGA_mips32)
2452+
# elif defined(VGA_mips32) || defined(VGA_mips64)
24522453
ipHere = uregsHere->pc;
24532454
# elif defined(VGA_ppc32) || defined(VGA_ppc64)
24542455
# else
@@ -2526,7 +2527,7 @@ Bool VG_(use_CF_info) ( /*MOD*/D3UnwindRegs* uregsHere,
25262527
COMPUTE(uregsPrev.ia, uregsHere->ia, cfsi->ra_how, cfsi->ra_off);
25272528
COMPUTE(uregsPrev.sp, uregsHere->sp, cfsi->sp_how, cfsi->sp_off);
25282529
COMPUTE(uregsPrev.fp, uregsHere->fp, cfsi->fp_how, cfsi->fp_off);
2529-
# elif defined(VGA_mips32)
2530+
# elif defined(VGA_mips32) || defined(VGA_mips64)
25302531
COMPUTE(uregsPrev.pc, uregsHere->pc, cfsi->ra_how, cfsi->ra_off);
25312532
COMPUTE(uregsPrev.sp, uregsHere->sp, cfsi->sp_how, cfsi->sp_off);
25322533
COMPUTE(uregsPrev.fp, uregsHere->fp, cfsi->fp_how, cfsi->fp_off);

coregrind/m_debuginfo/priv_storage.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ typedef
257257
Int fp_off;
258258
}
259259
DiCfSI;
260-
#elif defined(VGA_mips32)
260+
#elif defined(VGA_mips32) || defined(VGA_mips64)
261261
typedef
262262
struct {
263263
Addr base;

0 commit comments

Comments
 (0)