1

I am trying to set up the insight debugger on a rhel6 64 bit VM system: uname -a Linux lb-cam-bca-devel 2.6.32-358.23.2.el6.x86_64 #1 SMP Sat Sep 14 05:32:37 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux

I have downloaded the source - insight-6.8-1a.tar.bz2, obtained from ftp://sourceware.org/pub/insight/releases, configured, built and installed.

I can run up insight, but when I try to set breakpoints they are not getting hit.

Here's what I have tried: 1) Set a breakpoint by mouse clicking on the assembly view and select Run from the GUI. The executable runs through to the end. Output on the console view is "Program exited normally."

2) Set a breakpoint by mouse clicking on the source code and select Run from the GUI. Insight windows all disappear (crashes?). "Segmentation fault" output to terminal.

3) Remove default breakpoints from GUI and set a breakpoint from the gdb command line in the console window. Type r to run. Insight windows all disappear (crashes?). "Segmentation fault" output to terminal.

If I simply run gdb from the terminal I can set breakpoints and step through the source file fine.

The file I am debugging is a simple asm script taken from a book (Assembly Language Step By Step).

The commands I am using to build the file are: nasm -f elf64 -g -F dwarf eatsyscall.asm ld -o eatsyscall eatsyscall.o

The command I am using to open insight is: insight eatsyscall

Would anyone have any idea what might be happening here ? Or could anyone suggest how I can go about debugging the issue ? I'm a bit stuck on it at the moment.

The nearest thing I've seen reported on the net to this behaviour is here: osdir.com/ml/debugging.insight/2008-09/msg00001.html

But there are no shared libraries involved in my case.

  • I got a more to date version of the source (insight-7.8), built it and this is working fine.I still do not know what was going wrong with the original build, but when I built the newer version it complained about not being able to find a shared library - I had to set LD_LIBRARY_PATH correcty. Possibly the previous version was finding an incorrect library from somewhere ? – user1802664 Feb 20 '15 at 13:42

1 Answers1

1

I had the same problem, to solve use dwarf as debug information format i.e assemble the code (if using nasm) as

nasm -f elf -g -F dwarf anyfile.asm

(the format of -g is set to "stabs" by default but gdb understands dwarf better, you can change it with a -F switch)

now link the object code as (if using gnu's linker)

ld -o executable_name anyfile.o 

with dwarf as debug format you can now set the breakpoints.

Qiu
  • 5,651
  • 10
  • 49
  • 56