Strange error that I've never encounter in c++ before, anyone know what it means?
I won't post any code, because there is too much that could be relevant. But When I run my program it prints
Internal Bad Op Name!
: Success
Anybody even know what that means? I'm using g++ to compile my code and nowhere in my code do I开发者_StackOverflow中文版 cout anything even remotely close to something like that. I don't know where it's coming from. Also, any suggestions as to figure out where in the code it's coming from, maybe using gdb somehow to do that?
Thanks!
It's not a message I've seen, and Googling for it doesn't show anything obviously related.
You can identify where it comes from by stepping through the program with gdb until the message appears. Alternatively, one can sprinkle some timing delays, "I am here" statements, or input prompts to discover suspect portions of the logic.
< < < (edit) > > >
To use gdb
, first be sure to compile and link with debug symbols. With either gcc or g++, just add -g
to the command line. It's also often helpful to eliminate any compiler optimizations since those can sometimes make stepping through the program non-intuitive.
[wally@lf ~]$ gdb program
GNU gdb Fedora (6.8-32.fc10)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) break main
Breakpoint 1 at 0x8048c3c: file rtpsim.cpp, line 30.
(gdb) run
Starting program: ~/program
Breakpoint 1, main () at rtpsim.cpp:30
30 rtp_io (&obj, INIT_CYCLE);
(gdb) next
31 printf ("- - - - - init complete - - - - -\n");
(gdb) <---- pressed "enter" to repeat last command
- - - - - init complete - - - - -
33 for (int j = 0; j < 10; ++j)
(gdb)
35 sleep (1);
(gdb)
36 rtp_io (&obj, SCAN_CYCLE);
(gdb)
37 printf ("- - - - - scan %d complete - - - - -\n", j+1);
...
What libraries and what platform are you using? No C++ compiler I know of (certainly not GCC) introduces output to your program except before aborting.
Edit: maybe easier than backtracking or finding references, use grep -a
to find that string in all your sources and library binaries.
To debug the program with GDB, first make sure that it is compiled with the -g
flag. Then type gdb your-program-name
into the command line. GDB is a command based debugger. To get started, type help
. Or, there are graphical debugging tools, like xxgdb (though for this, it is a good thing to understand basic gdb commands), ddd, kdbg (KDE based), Eclipse (it is not very straightforward to configure if you want to use your own makefile) etc.
精彩评论