Hello.
I'm working on a Firefox plugin that uses external libraries to render 3D graphics on the browser.
The problem is that i want the plugin to use external libraries packed with it without changing the LD_LIBRARY_PATH variable.
The libraries are installed in a position relative to the plugin (a shared library too), while the actual...
My question is clear:
How to get the compiled instructions for inlined functions when using -O2? I tried readelf to get the mapping between the source code lines and the binary codes addresses. But there is no mapping at all for the line where the inlined function is called.
So, what compiler option or any approach could be used?
In f...
I've had numerous problems compiling shared objects that link statically against static libraries. This problem only shows up on x84_64 platforms. When doing the same compilation work on x86_32 I do not have any problems.
Perhaps this is a OS specific GCC configuration thing, but my research indicates that its how GCC works on x86_64 p...
We can set breakpoint at a func, hence gdb knows the entrance and exit address of a certain function. But how does it get this information? Does it uses DWARF or readelf for the executable, if yes, how?
Thanks
...
I am using the following code to set the cr0 bit to disable cache.
When I compile this
#include <stdio.h>
int main()
{
__asm__("pushl %eax\n\t"
"mov %cr0,%eax;\n\t"
"orl $(1 << 30),%eax;\n\t"
"mov %eax,%cr0;\n\t"
"wbinvd\n\t"
"popl %eax"...
I have some legacy code that I have to wrap, and I have come across this declaration:
class Foo : Bar
{
// ...
};
This seems to compile under GCC. I know it's bad, but I can't change it. My question is, if no inheritance access specifier is present, how does the C++ compiler handle it?
...
If I have a C file foo.c and while I have given -DMACRO=1 as command line option for compilation. However, if within the header file also I have
#define MACRO 2
Which of these will get precedence?
...
I have the gcc compiler in "/Developer/usr/bin/gcc" but when i type in gcc into terminal it says can not be found, i assume this is because its not in the "/usr/bin" dir. So can i a) move gcc from the first dir to the second, or set some kind of shortcut pointing gcc to "/Developer/usr/bin/gcc"
...
this
en.wikipedia.org/wiki/Hot_swapping#cite_note-1
says that VS can do it with the help of its debugger. Does gdb provide a similar functionality ?
this is the closest i could find, but doesn't seem to be ready to be used:
http://www.aitdspace.gr/xmlui/handle/123456789/219
dlopen/dlsym/dlclose are also close, but will not work for ...
When I attempt to debug a external process with Eclipse CDT, I'm able to attach to it, but I cannot get the debug configuration to find the original C source. When I launch the debugger with the process running within Eclipse, I can get the debugger to find the source code.
It is only when attaching to an external process that CDT doesn...
Hi while i cross compile an startup.s file
(arm-none-eabi-as file.s)
(*-gcc)
I am getting in each commentary line some errors
- junk at end of line, first unrecognized character is /
when i delete the // some comment lines i get
errors about undefined symbols even i defined them at beginning of the file.
anyone know whats wrong?
...
Hello,
I just got stuck with the following C++ compiler error:
no matching function for call "EPTDerivedException::HandleClass( BaseClass& )"
candidates are: void EPTDerivedException::HandleClass( DerivedClass )
I cannot explain this, because there should be a function HandleClass( BaseClass ). This is the calling code:
BaseClass oB...
Hello newcomer here (be gentle),
I am attempting to write a program which has floating point code in it. However this program needs to run on 2 different processors. Which have roughly identical ISAs except for their floating point model. They use completely different instructions and registers to do floating point calculations. Wha...
Having source like this:
void foo() {
func1();
if(qqq) {
func2();
};
func3();
func4();
for(...) {
func5();
}
}
I want to obtain info like this:
void foo() {
5 ms; 2 times; func1();
0 ms; 2 times; if(qqq) {
0 ms; 0 times; func2();
0 ms; 2 times; };
20 ms; 2...
Is it possible with gcc to eliminate the warning below without eliminating all warnings?
pasting "/" and "/" does not give a valid preprocessing token
For a certain platform, I must use a specific cross-compiler, but I can use make, so I use gcc to create the dependencies.
I know that I'm passing the “//” token to the compiler and it’...
For example, there is the source:
void my_special_debugging_function(const char* function_name, const char* file_name, int line_number);
void func1() {
func3();
func4();
}
void foo() {
func1();
if(qqq) {
func2();
};
func3();
func4();
for(...) {
func5();
}
}
It should compile as:
v...
#include <string>
#include <tr1/regex>
#include "TextProcessing.h"
const std::string URL_PATTERN("((http://)[-a-zA-Z0-9@:%_\\+.~#?&//=]+)");
const std::string REPLACEMENT("<a href=\"$&\"\">$&</a>");
std::string textprocessing::processLinks(const std::string & text)
{
// essentially the same regex as in the previous example, b...
Assume the x86 64 and linux platform.
If you look into the ELF header, the offset are all 64bit.
So it's easy to create an object file larger than 4G with relocatoin R_X86_64_64. This means a static .o file and executable can be as large as 64bit can represent.
However, for shared library, like gcc , we only have R_X86_64_PLT32 reloca...
I have #include<math.h>,
and I tried to use pow(x, y) and powf(x, y).
but it seems neither of them are under c99 standard.
and I use the command gcc -std=c99 test.c -o test to compile.
what function there exists I can use?
...
For example, there is the source:
void func1() {
func3();
if(qqq) {
func2();
}
func4(
);
}
It should be transformed to:
void func1() {
MYMACRO
func3();
MYMACRO
if(qqq) {
MYMACRO
func2();
MYMACRO
}
MYMACRO
func4(
);
MYMACRO
}
I.e. to insert "MYMACRO\n" at the end of each line...