Git Product home page Git Product logo

Comments (4)

hiyuh avatar hiyuh commented on August 25, 2024

according to google result:

http://www.miriamruiz.es/code/backtrace_test.c

the third warning I mentioned above can be fixed by:

diff --git a/src/util.c b/src/util.c
index 526c8b4..426613c 100644
--- a/src/util.c
+++ b/src/util.c
@@ -51,6 +51,8 @@
#else
#define ARCH_IP_REG eip
#endif
+#elif defined __powerpc

+#define ARCH_IP_REG __nip
#else
#warning "Don't know the IP register name for your architecture!"
#define NO_STACK_TRACE
@@ -261,6 +263,8 @@ static void bt_sighandler(int sig, siginfo_t *info, void *secret)

#ifdef APPLE
uintptr_t ip = uc->uc_mcontext->ss.ARCH_IP_REG;
+#elif defined __powerpc

  • uintptr_t ip = uc->uc_mcontext.regs->nip;
    #else
    uintptr_t ip = uc->uc_mcontext.gregs[ARCH_IP_REG];
    #endif

from nvc.

nickg avatar nickg commented on August 25, 2024

Thanks, I applied the above patch.

from nvc.

nickg avatar nickg commented on August 25, 2024

I've fixed the warnings you posted above. Which version of GCC are you using? I prefer leaving -Werror on as it often highlights interesting things that would otherwise be missed.

from nvc.

hiyuh avatar hiyuh commented on August 25, 2024

my gcc -v shows:

Using built-in specs.
COLLECT_GCC=/usr/powerpc-unknown-linux-gnu/gcc-bin/4.5.3/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/powerpc-unknown-linux-gnu/4.5.3/lto-wrapper
Target: powerpc-unknown-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/gcc-4.5.3/configure --prefix=/usr --bindir=/usr/powerpc-unknown-linux-gnu/gcc-bin/4.5.3 --includedir=/usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/include --datadir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/4.5.3 --mandir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/4.5.3/man --infodir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/4.5.3/info --with-gxx-include-dir=/usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/include/g++-v4 --host=powerpc-unknown-linux-gnu --build=powerpc-unknown-linux-gnu --enable-altivec --disable-fixed-point --with-ppl --with-cloog --disable-ppl-version-check --with-cloog-include=/usr/include/cloog-ppl --enable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/powerpc-unknown-linux-gnu/4.5.3/python --enable-checking=release --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.5.3-r2 p1.0, pie-0.4.6'
Thread model: posix
gcc version 4.5.3 (Gentoo 4.5.3-r2 p1.0, pie-0.4.6)

from nvc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.