Questions tagged [debug-information]

Anything related to debug information, i.e. information stored by a compiler in the compiled code that doesn't alter the code behavior, but can be used to ease the debugging of the code itself. For example, a compiler could generate debug information about line numbers, variable names, etc.

Anything related to debug information, i.e. information stored by a compiler in the compiled code that doesn't alter the code behavior, but can be used to ease the debugging of the code itself. For example, a compiler could generate debug information about line numbers, variable names, etc.

Specific tools such as debuggers can make use of debug information to improve various aspects of the debugging process.

67 questions
136
votes
4 answers

What are CFI directives in Gnu Assembler (GAS) used for?

There seem to be a .CFI directive after every line and also there are wide varieties of these ex.,.cfi_startproc , .cfi_endproc etc.. more here. .file "temp.c" .text .globl main .type main, @function main: .LFB0: .cfi_startproc …
claws
  • 52,236
  • 58
  • 146
  • 195
23
votes
3 answers

Does compiling with -g, in itself, degrade performance?

(This is a question about gcc and clang, but might apply to other compilers.) If I compile my C or C++ code, and generate debug info using the -g switch, does this in itself degrade performance of the compiled program in any way... With minimum…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
9
votes
3 answers

Simple way to send debug information to the Visual Studio 'Output' window

I started a blank project in Visual Studio 2010 to write a C application. How can I send debug information to the Output window (menu Debug -> Windows -> Output )? Is there a relatively simple way to implement TRACE or OutputDebugString or something…
Jim Fell
  • 13,750
  • 36
  • 127
  • 202
7
votes
4 answers

Displaying exception debug information to users

I'm currently working on adding exceptions and exception handling to my OSS application. Exceptions have been the general idea from the start, but I wanted to find a good exception framework and in all honesty, understand C++ exception handling…
Lucas
  • 6,328
  • 8
  • 37
  • 49
6
votes
1 answer

Any Java counterpart for `/usr/bin/strip`?

Is there any tool that can remove debug info from Java .class files, just like /usr/bin/strip can from C/C++ object files on Linux? EDIT: I liked both Thilo's and Peter Mmm's answers: Peter's was short and to the point exposing my ignorance of what…
Harry
  • 3,684
  • 6
  • 39
  • 48
6
votes
1 answer

"Serious error when reading debug info" - suppress? ignore? fix?

I'm using valgrind to try and locate the cause of a violating memory access in a C-cum-C++ program. Even with this access averted (i.e. when everything runs fine), valgrind tells me: ==11436== Memcheck, a memory error detector ==11436== Copyright…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
4
votes
1 answer

Why is it that assembling/linking in one step loses debug info for my assembly source?

When I build my source code using two steps: localhost % clang -g -c factorial.s localhost % clang -o factorial factorial.o I get debug info about the assembly source. localhost % lldb factorial (lldb) target create "factorial" Current…
Chris
  • 342
  • 1
  • 12
4
votes
1 answer

Can I make a template function noinline or else force it to appear in the profiler?

I'm trying to profile with perf on Ubuntu 20.04, but the problem is that many functions do not appear in it (likely because they are inlined), or only their addresses appear (without names etc.). I'm using CMake's RelWithDebInfo build. But there are…
Serge Rogatch
  • 13,865
  • 7
  • 86
  • 158
4
votes
1 answer

GDB - map address to line and column in source code

Both gcc and clang have option -gcolumn-info, which is described this way: Emit location column information into DWARF debugging information, rather than just file and line. I have compiled my binary with this option. Now I have address of some…
michalsrb
  • 4,703
  • 1
  • 18
  • 35
3
votes
0 answers

debuginfo handling within fedora, how to remove debuginfo

I can simply install debug info's for several packages with e.g: sudo dnf debuginfo-install ibus-gtk3-1.5.21-5.fc31.x86_64 But I did not see any command to remove the debuginfos. Is there any dnf command which can remove debuginfos? I know that I…
Klaus
  • 24,205
  • 7
  • 58
  • 113
3
votes
0 answers

Where the debug info of static library is merged after linking with MSVC?

Let's say that I have static library which generates it's debug info in pdb format with /Zi option. Next let's link it into executable which also generates its debug info in pdb. Am I right that the debug info of the static library will be merged…
bobeff
  • 3,543
  • 3
  • 34
  • 62
3
votes
1 answer

Figure out pattern in order to find variables in compiled program

I need to extract the global variables from a compiled c program. What am I doing right now is using the Linux readelf command in order to get that information. In other words when I do: readelf.exe -w[i] myFile.out I do that with…
Tono Nam
  • 34,064
  • 78
  • 298
  • 470
2
votes
0 answers

Can I tell my compiler to "inline" a function also w.r.t. debug/source-line info?

In my code (either C or C++; let's say it's C++) I have a one-liner inline function foo() which gets called from many places in the code. I'm using a profiling tool which gathers statistics by line in the object code, which it translates into…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
2
votes
1 answer

Can I get inlining to apply to source location information?

I'm writing code in a C-like language, and am using an inline function which does actually tend to get inlined. However, the inlining maintains the location in that function's source, in terms of the debugging info added by the compiler (e.g. DWARF…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
2
votes
1 answer

Can gdb print expanded preprocessor/macro results?

For example: #include #define A 20 #define B 22 #define C (A+B) int main() { srand(time(0)); int i = (rand()&1) + C; return i; } In gdb, (gdb) print C No symbol "C" in current context. How can I know what C is? Can gdb…
jozxyqk
  • 16,424
  • 12
  • 91
  • 180
1
2 3 4 5