Groups | Search | Server Info | Login | Register


Groups > comp.lang.asm.x86 > #8827

Re: Debugger problems

From Martijn Bos <martijnm.bos@nospicedham.gmail.com>
Newsgroups comp.lang.asm.x86
Subject Re: Debugger problems
Date 2023-12-06 03:55 -0800
Organization A noiseless patient Spider
Message-ID <2c613631-1ad7-4722-9a6d-e3aa7990cb3bn@googlegroups.com> (permalink)
References (3 earlier) <kt18crF1b8hU1@mid.individual.net> <ukhhrg$2q0aj$3@dont-email.me> <kt3phrFlp8jU1@mid.individual.net> <20231204181048.43ae1234@hotmail.com> <ukkf3m$3dbv4$2@dont-email.me>

Show all headers | View raw


All,

Reporting back was taking a little longer then I expexted ...sorry.

Anyway.
I still cannot get the debugger to break on a linenumber. If I read correctly you had more luck (or wisdom).

However the method mentioned earlier : x/10i _start does work!

Did really helps me, I was not aware of x being able to display instructions.
Then I was able to set a breakpoint on the adress that I need/want.

And now I can start debugging.
Stepping through the program with "s" was running through the program immediately, so I found that I had to use "si" (Step Instruction)

It still seams/seems silly to me that I can list a piece of a program in gdb, but can not set a break on the kines I think trhe debugger knows:

(gdb) list 
1       section .data
2
3       section .text
4
5       global _start
6
7       _start:
8               mov al, 1       ; mov 1 into the al register
9
10              mov rax, 60     ; syscall for exit
(gdb) b 8
No line 8 in the current file.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) 

Anyway....I can dust off some more old assembly knowledge now.


Thanks all for you help and time.

Best Regards,
Martijn



Op maandag 4 december 2023 om 13:12:49 UTC+1 schreef Borax Man:
> On 2023-12-04, Borax Man <rotf...@nospicedham.hotmail.com> wrote: 
> > On 3 Dec 2023 16:43:39 GMT 
> > Tavis Ormandy <tav...@nospicedham.gmail.com> wrote: 
> > 
> >> On 2023-12-03, Borax Man wrote: 
> >> > On 2023-12-02, Tavis Ormandy <tav...@nospicedham.gmail.com> wrote: 
> >> >> On 2023-12-02, Borax Man wrote: 
> >> >>> NASM can generate debugging information which I believe will generate 
> >> >>> line info. Pass '-F dwarf' option to nasm if under Linux, and you should see each 
> >> >>> line of source in the debugger. 
> >> >> 
> >> >> You're thinking of line markers I think (like %line 123), but I think 
> >> >> Martijn wants the assembler to do that automatically so that b 
> >> >> foo.asm:123 works, like it does in gas. 
> >> >> 
> >> >> As far as I know nasm won't do that? 
> >> >> 
> >> > 
> >> > I did a test using nasm with the '-F dwarf' and '-g' parameters, and I 
> >> > was able to add breakpoints in GDB specifying the line using the 
> >> > syntax you mentioned. 
> >> 
> >> Weird.... and this is for elf64? 
> >> 
> >> Perhaps you have a newer version than me, good to know it will arrive eventually! 
> >> 
> >> Tavis. 
> > 
> > I tested this on Debian 12... 32 bit (my laptop is old). 
> > 
> >
> Just to clarify, NASM version 2.16.01.

Back to comp.lang.asm.x86 | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Debugger problems Martijn Bos <martijnm.bos@gmail.com> - 2023-11-30 01:00 -0800
  Re: Debugger problems Tavis Ormandy <taviso@nospicedham.gmail.com> - 2023-12-02 00:28 +0000
    Re: Debugger problems Borax Man <rotflol2@nospicedham.hotmail.com> - 2023-12-02 09:17 +0000
      Re: Debugger problems Martijn Bos <martijnm.bos@nospicedham.gmail.com> - 2023-12-02 03:04 -0800
      Re: Debugger problems Tavis Ormandy <taviso@nospicedham.gmail.com> - 2023-12-02 17:38 +0000
        Re: Debugger problems Borax Man <rotflol2@nospicedham.hotmail.com> - 2023-12-03 09:30 +0000
          Re: Debugger problems Tavis Ormandy <taviso@nospicedham.gmail.com> - 2023-12-03 16:43 +0000
            Re: Debugger problems Borax Man <rotflol2@nospicedham.hotmail.com> - 2023-12-04 18:10 +1100
              Re: Debugger problems Borax Man <rotflol2@nospicedham.hotmail.com> - 2023-12-04 12:01 +0000
                Re: Debugger problems Martijn Bos <martijnm.bos@nospicedham.gmail.com> - 2023-12-06 03:55 -0800
    Re: Debugger problems Martijn Bos <martijnm.bos@nospicedham.gmail.com> - 2023-12-02 02:12 -0800

csiph-web