4

I have just started using KDbg and am having a hard time finding the answer to my question. I open a file in KDbg (I opened an executable written in assembly), there is a pop up that says

GDB: Reading symbols from /home/myputer/Desktop/ASMdirectory/chapter5/eatsyscall/eatsyscall...done.

How do I get the option to run the program in the debugger and add breakpoints and etc. It doesn't allow me to click the button to run the program or add any breakpoints, is there an issue here? Am I missing a step? Thanks in advance. BTW I'm using Linux(Ubuntu) and NASM for my assembler.

John Smith
  • 41
  • 1
  • 3

1 Answers1

2

What are the versions of software you are running?

For example I am running Ubuntu 12.04, kdbg 2.5.0 (KDE Development Platform 4.8.5), gdb 7.4-2012.04, nasm 2.09.10

You are using Duntemann's book, yes? I am assuming you changed SECTION .txt to SECTION .text because when GDB attempts to read symbols it reports "done" instead of "Can't find any code sections in symbol file"

I would recommend using gdb directly instead of kdbg. I do not know of a way to get kdbg to show disassembled code or list (or how to send any gdb commands directly). I think the best that can be done is:

  1. Run kdbg
  2. Open the executable
  3. Switch to the Breakpoints tab
  4. Enter "_start" (which I believe is the only visible symbol you have) in the edit box.
  5. Hit the "Add Breakpoint" button
  6. Hit the "Run" button
  7. Execution should have broken at _start
  8. Switch to the Registers tab
  9. Hit the "Step into by instruction" button to walk through your code

Kdbg does not seem to be able to restart execution. It seems the program must be killed then run again.

LogicG8
  • 1,767
  • 16
  • 26
  • I was running into the same issue and this fixed it for me. I typed in "section .txt" instead of "section .text" in my asm code. This prevents the "-F" and "-g" switches from picking up the debug symbols as expected. Good catch! – 0xsteve Feb 24 '22 at 12:20