Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

I find you lack of faith in the forth dithturbing. -- Darse ("Darth") Vader


devel / comp.lang.asm.x86 / Debugger problems

SubjectAuthor
* Debugger problemsMartijn Bos
`* Debugger problemsTavis Ormandy
 +* Debugger problemsBorax Man
 |+- Debugger problemsMartijn Bos
 |`* Debugger problemsTavis Ormandy
 | `* Debugger problemsBorax Man
 |  `* Debugger problemsTavis Ormandy
 |   `* Debugger problemsBorax Man
 |    `* Debugger problemsBorax Man
 |     `- Debugger problemsMartijn Bos
 `- Debugger problemsMartijn Bos

1
Debugger problems

<fa661ff7-9381-4a32-9802-3d4691627145n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=871&group=comp.lang.asm.x86#871

  copy link   Newsgroups: comp.lang.asm.x86
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: martijnm.bos@gmail.com (Martijn Bos)
Newsgroups: comp.lang.asm.x86
Subject: Debugger problems
Date: Thu, 30 Nov 2023 01:00:11 -0800 (PST)
Organization: A noiseless patient Spider
Lines: 72
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <fa661ff7-9381-4a32-9802-3d4691627145n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Date: Thu, 30 Nov 2023 09:00:12 +0000
Injection-Info: dont-email.me; posting-host="9d999418ce1555edfacd1c4a1288a4df";
logging-data="1536292"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6NrlHZVtB2EvsppRpMEv13MZ6LYYanYA="
User-Agent: G2/1.0
Cancel-Lock: sha1:I3OXzoIdDU2L0NGkW5p/eFf7Tgs=
 by: Martijn Bos - Thu, 30 Nov 2023 09:00 UTC

All,
It has been 30+ years since I played around with some assembly.
Just for learning purposes I'm doing some more playing :-)

First some information :
The system I'm on:
[martijn@fedora asm]$ uname -a
Linux fedora 6.2.15-100.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 11 16:51:53 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[martijn@fedora asm]$

Then for completeness also the program (for this particular problem I do not think it's that relevant :-) ):
[martijn@fedora asm]$ cat een.asm
section .data

section .text

global _start

_start:
mov al, 1 ; mov 1 into the al register
add al, 1 ; add one to the al register

mov rax, 60 ; syscall for exit
mov rdi, 0 ; Return code
syscall
[martijn@fedora asm]$

Then I compile, link and run the progrm:
[martijn@fedora asm]$ nasm -f elf64 -gdwarf een.asm
[martijn@fedora asm]$ ld -m elf_x86_64 -o een een.o
[martijn@fedora asm]$ ./een
[martijn@fedora asm]$

So far so good (I think):

But I want to see what is actually happening, so I want to see it in my debugger :

[martijn@fedora asm]$ gdb een
GNU gdb (GDB) Fedora 12.1-2.fc36
.....
.....
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from een...
(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 add al, 1 ; add one to the al register
(gdb) break 8
No line 8 in the current file.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb)

As you can see I can not set a breakpoint. And that's my problem.
Whitout breakpoints I can not step through my program.

Does anyone have any pointers/tips/trics on how to resolve this issue.

(I know myself...I probably oversee the obvious...do not hesitate to point that out)

Best Regards,
Martijn Bos

Re: Debugger problems

<ksvc0sFdtc9U1@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=872&group=comp.lang.asm.x86#872

  copy link   Newsgroups: comp.lang.asm.x86
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: taviso@nospicedham.gmail.com (Tavis Ormandy)
Newsgroups: comp.lang.asm.x86
Subject: Re: Debugger problems
Date: 2 Dec 2023 00:28:12 GMT
Organization: A noiseless patient Spider
Lines: 31
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <ksvc0sFdtc9U1@mid.individual.net>
References: <fa661ff7-9381-4a32-9802-3d4691627145n@googlegroups.com>
Injection-Info: dont-email.me; posting-host="4e844becf0b0549eeef552ecb2f7ffa4";
logging-data="2187358"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Q0lrUg+2n+U7bnx8nlF0Rcmud4ycC3xU="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:eqcmP5/HedRdVtdichne2wSlzzM=
 by: Tavis Ormandy - Sat, 2 Dec 2023 00:28 UTC

On 2023-11-30, Martijn Bos wrote:
> Does anyone have any pointers/tips/trics on how to resolve this issue.
>
> (I know myself...I probably oversee the obvious...do not hesitate to point that out)

I would just use the disassembler, for example `x/10i _start` instead of
`list _start`!

I don't think nasm will generate line info automatically (just names),
so you would set breakpoints on symbols `b _start` or addresses `b
*0x401000)

However... gas can do it if you prefer this style. Your code is
basically valid gas syntax already. Just add `.intel_syntax noprefix`
and add a `.` before directives, e.g. .section, .global, etc, and use #
for comments instead of ;.

Then you can use `as -g foo.asm -o foo.o` instead.

Now `b foo.asm:123` should work.

Nasm and gas are both great assemblers, it doesn't make much difference
which one you choose while you're getting started.

Tavis.

--
_o) $ lynx lock.cmpxchg8b.com
/\\ _o) _o) $ finger taviso@sdf.org
_\_V _( ) _( ) @taviso

Re: Debugger problems

<ukesnb$2a8g9$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=873&group=comp.lang.asm.x86#873

  copy link   Newsgroups: comp.lang.asm.x86
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rotflol2@nospicedham.hotmail.com (Borax Man)
Newsgroups: comp.lang.asm.x86
Subject: Re: Debugger problems
Date: Sat, 2 Dec 2023 09:17:32 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 39
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <ukesnb$2a8g9$1@dont-email.me>
References: <fa661ff7-9381-4a32-9802-3d4691627145n@googlegroups.com>
<ksvc0sFdtc9U1@mid.individual.net>
Injection-Info: dont-email.me; posting-host="4e844becf0b0549eeef552ecb2f7ffa4";
logging-data="2435394"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/DBwCRQev2RmatRYQzkM05tJLs+3DcEA="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:P+kRT4TJWw6yYNOx2niixXfVsqE=
 by: Borax Man - Sat, 2 Dec 2023 09:17 UTC

On 2023-12-02, Tavis Ormandy <taviso@nospicedham.gmail.com> wrote:
> On 2023-11-30, Martijn Bos wrote:
>> Does anyone have any pointers/tips/trics on how to resolve this issue.
>>
>> (I know myself...I probably oversee the obvious...do not hesitate to point that out)
>
> I would just use the disassembler, for example `x/10i _start` instead of
> `list _start`!
>
> I don't think nasm will generate line info automatically (just names),
> so you would set breakpoints on symbols `b _start` or addresses `b
> *0x401000)
>
> However... gas can do it if you prefer this style. Your code is
> basically valid gas syntax already. Just add `.intel_syntax noprefix`
> and add a `.` before directives, e.g. .section, .global, etc, and use #
> for comments instead of ;.
>
> Then you can use `as -g foo.asm -o foo.o` instead.
>
> Now `b foo.asm:123` should work.
>
> Nasm and gas are both great assemblers, it doesn't make much difference
> which one you choose while you're getting started.
>
> Tavis.
>

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.

ie.
nasm -f elf32 -F dwarf hello.asm

P.S., I assume you're the same Tavis who is known for your FVWM
config?

Re: Debugger problems

<b9a580a3-c0e2-46a0-a25b-bb5babc135f6n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=874&group=comp.lang.asm.x86#874

  copy link   Newsgroups: comp.lang.asm.x86
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: martijnm.bos@nospicedham.gmail.com (Martijn Bos)
Newsgroups: comp.lang.asm.x86
Subject: Re: Debugger problems
Date: Sat, 2 Dec 2023 02:12:44 -0800 (PST)
Organization: A noiseless patient Spider
Lines: 41
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <b9a580a3-c0e2-46a0-a25b-bb5babc135f6n@googlegroups.com>
References: <fa661ff7-9381-4a32-9802-3d4691627145n@googlegroups.com> <ksvc0sFdtc9U1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Date: Sat, 02 Dec 2023 10:12:44 +0000
Injection-Info: dont-email.me; posting-host="4e844becf0b0549eeef552ecb2f7ffa4";
logging-data="2452533"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19+PzWjEWqLHnWI66++Hu9r4nWIeTDCsng="
User-Agent: G2/1.0
Cancel-Lock: sha1:xw5+f4LlsHwO/dnYaN1s+m9cjf4=
 by: Martijn Bos - Sat, 2 Dec 2023 10:12 UTC

Thank you so much for this information.

Today I have to visit my parents (my father turned 83 :-))
So...no testing today.

I'll report back hopefully tomorrow.

Best Regards,
Martijn

Op zaterdag 2 december 2023 om 01:36:03 UTC+1 schreef Tavis Ormandy:
> On 2023-11-30, Martijn Bos wrote:
> > Does anyone have any pointers/tips/trics on how to resolve this issue.
> >
> > (I know myself...I probably oversee the obvious...do not hesitate to point that out)
> I would just use the disassembler, for example `x/10i _start` instead of
> `list _start`!
>
> I don't think nasm will generate line info automatically (just names),
> so you would set breakpoints on symbols `b _start` or addresses `b
> *0x401000)
>
> However... gas can do it if you prefer this style. Your code is
> basically valid gas syntax already. Just add `.intel_syntax noprefix`
> and add a `.` before directives, e.g. .section, .global, etc, and use #
> for comments instead of ;.
>
> Then you can use `as -g foo.asm -o foo.o` instead.
>
> Now `b foo.asm:123` should work.
>
> Nasm and gas are both great assemblers, it doesn't make much difference
> which one you choose while you're getting started.
>
> Tavis.
>
> --
> _o) $ lynx lock.cmpxchg8b.com
> /\\ _o) _o) $ finger tav...@sdf.org
> _\_V _( ) _( ) @taviso

Re: Debugger problems

<cefabdf5-1611-4c5a-840a-a29f80649c3cn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=875&group=comp.lang.asm.x86#875

  copy link   Newsgroups: comp.lang.asm.x86
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: martijnm.bos@nospicedham.gmail.com (Martijn Bos)
Newsgroups: comp.lang.asm.x86
Subject: Re: Debugger problems
Date: Sat, 2 Dec 2023 03:04:22 -0800 (PST)
Organization: A noiseless patient Spider
Lines: 80
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <cefabdf5-1611-4c5a-840a-a29f80649c3cn@googlegroups.com>
References: <fa661ff7-9381-4a32-9802-3d4691627145n@googlegroups.com>
<ksvc0sFdtc9U1@mid.individual.net> <ukesnb$2a8g9$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Date: Sat, 02 Dec 2023 11:04:23 +0000
Injection-Info: dont-email.me; posting-host="4e844becf0b0549eeef552ecb2f7ffa4";
logging-data="2465142"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19delyrPZxid23Vpa8ApNQj0vu+u+XKAh0="
User-Agent: G2/1.0
Cancel-Lock: sha1:5nj/Ip0Rf4Q5jQ5ZbSsUSgPq4yE=
 by: Martijn Bos - Sat, 2 Dec 2023 11:04 UTC

Hi,

Thanks for taking the tmie to answer.
See my remarks inline

Best regards,
Martijn

Op zaterdag 2 december 2023 om 10:24:46 UTC+1 schreef Borax Man:
> On 2023-12-02, Tavis Ormandy <tav...@nospicedham.gmail.com> wrote:
> > On 2023-11-30, Martijn Bos wrote:
> >> Does anyone have any pointers/tips/trics on how to resolve this issue.
> >>
> >> (I know myself...I probably oversee the obvious...do not hesitate to point that out)
> >
> > I would just use the disassembler, for example `x/10i _start` instead of
> > `list _start`!
> >
> > I don't think nasm will generate line info automatically (just names),
> > so you would set breakpoints on symbols `b _start` or addresses `b
> > *0x401000)
> >
> > However... gas can do it if you prefer this style. Your code is
> > basically valid gas syntax already. Just add `.intel_syntax noprefix`
> > and add a `.` before directives, e.g. .section, .global, etc, and use #
> > for comments instead of ;.
> >
> > Then you can use `as -g foo.asm -o foo.o` instead.
> >
> > Now `b foo.asm:123` should work.
> >
> > Nasm and gas are both great assemblers, it doesn't make much difference
> > which one you choose while you're getting started.
> >
> > Tavis.
> >
> 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.
>
> ie.
> nasm -f elf32 -F dwarf hello.asm
>

From 'man nasm' I quote:
==quote==
-F format
Specifies the debug information format. To see a list of valid output formats, use the -y option (for example -felf -y).

-g
Causes nasm to generate debug information.

-gformat
Equivalent to -g -F format.>
==unquote==

When I tried your suggestion I got the same result:
(gdb) break 8
No line 8 in the current file.

So i tried -gdwarf

Same result.

Maybe I should also give the linker some options to handle debug information (?)

Anyway....I'm off for familiy matters.

I'll try further tomorrow

> P.S., I assume you're the same Tavis who is known for your FVWM
> config?

Re: Debugger problems

<kt18crF1b8hU1@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=879&group=comp.lang.asm.x86#879

  copy link   Newsgroups: comp.lang.asm.x86
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: taviso@nospicedham.gmail.com (Tavis Ormandy)
Newsgroups: comp.lang.asm.x86
Subject: Re: Debugger problems
Date: 2 Dec 2023 17:38:35 GMT
Organization: A noiseless patient Spider
Lines: 25
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <kt18crF1b8hU1@mid.individual.net>
References: <fa661ff7-9381-4a32-9802-3d4691627145n@googlegroups.com>
<ksvc0sFdtc9U1@mid.individual.net> <ukesnb$2a8g9$1@dont-email.me>
Injection-Info: dont-email.me; posting-host="4e844becf0b0549eeef552ecb2f7ffa4";
logging-data="2582977"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19DTkZnuNLM5pX+v6znwg996IOYThhhmCY="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:qDq2ucgu82KITTmn9jnP/v1tK2w=
 by: Tavis Ormandy - Sat, 2 Dec 2023 17:38 UTC

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?

>
> P.S., I assume you're the same Tavis who is known for your FVWM
> config?
>

Hah, yes, that was me :)

Tavis.

--
_o) $ lynx lock.cmpxchg8b.com
/\\ _o) _o) $ finger taviso@sdf.org
_\_V _( ) _( ) @taviso

Re: Debugger problems

<ukhhrg$2q0aj$3@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=882&group=comp.lang.asm.x86#882

  copy link   Newsgroups: comp.lang.asm.x86
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rotflol2@nospicedham.hotmail.com (Borax Man)
Newsgroups: comp.lang.asm.x86
Subject: Re: Debugger problems
Date: Sun, 3 Dec 2023 09:30:25 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 31
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <ukhhrg$2q0aj$3@dont-email.me>
References: <fa661ff7-9381-4a32-9802-3d4691627145n@googlegroups.com>
<ksvc0sFdtc9U1@mid.individual.net> <ukesnb$2a8g9$1@dont-email.me>
<kt18crF1b8hU1@mid.individual.net>
Injection-Info: dont-email.me; posting-host="56dc22d500cedf326df24ee0538cfdaa";
logging-data="2959258"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19dp8vZbEAptxiIn/yiF81UBh9KZbx4avU="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:vVUJACyysfyePtB/o2LyGIDQvK8=
 by: Borax Man - Sun, 3 Dec 2023 09:30 UTC

On 2023-12-02, Tavis Ormandy <taviso@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.

I didn't mention "-g" before, oops.

>>
>> P.S., I assume you're the same Tavis who is known for your FVWM
>> config?
>>
>
> Hah, yes, that was me :)
>
> Tavis.
>

Cool. Avid and longtime FVWM user here.

Re: Debugger problems

<kt3phrFlp8jU1@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=883&group=comp.lang.asm.x86#883

  copy link   Newsgroups: comp.lang.asm.x86
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: taviso@nospicedham.gmail.com (Tavis Ormandy)
Newsgroups: comp.lang.asm.x86
Subject: Re: Debugger problems
Date: 3 Dec 2023 16:43:39 GMT
Organization: A noiseless patient Spider
Lines: 29
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <kt3phrFlp8jU1@mid.individual.net>
References: <fa661ff7-9381-4a32-9802-3d4691627145n@googlegroups.com>
<ksvc0sFdtc9U1@mid.individual.net> <ukesnb$2a8g9$1@dont-email.me>
<kt18crF1b8hU1@mid.individual.net> <ukhhrg$2q0aj$3@dont-email.me>
Injection-Info: dont-email.me; posting-host="56dc22d500cedf326df24ee0538cfdaa";
logging-data="3084895"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+l7e5tY0zrxVkjX7wUlKADoxtCdXQQt4Q="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:AoWLZ5zKW18Xpmsns2lFaN28v1M=
 by: Tavis Ormandy - Sun, 3 Dec 2023 16:43 UTC

On 2023-12-03, Borax Man wrote:
> On 2023-12-02, Tavis Ormandy <taviso@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.

--
_o) $ lynx lock.cmpxchg8b.com
/\\ _o) _o) $ finger taviso@sdf.org
_\_V _( ) _( ) @taviso

Re: Debugger problems

<20231204181048.43ae1234@hotmail.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=884&group=comp.lang.asm.x86#884

  copy link   Newsgroups: comp.lang.asm.x86
Path: i2pn2.org!i2pn.org!usenet.network!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rotflol2@nospicedham.hotmail.com (Borax Man)
Newsgroups: comp.lang.asm.x86
Subject: Re: Debugger problems
Date: Mon, 4 Dec 2023 18:10:48 +1100
Organization: A noiseless patient Spider
Lines: 30
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <20231204181048.43ae1234@hotmail.com>
References: <fa661ff7-9381-4a32-9802-3d4691627145n@googlegroups.com>
<ksvc0sFdtc9U1@mid.individual.net>
<ukesnb$2a8g9$1@dont-email.me>
<kt18crF1b8hU1@mid.individual.net>
<ukhhrg$2q0aj$3@dont-email.me>
<kt3phrFlp8jU1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="0fcebba557738de5d81934eba72108d9";
logging-data="3508947"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18pPHIxZrUGTMa4NsX8C/gLSRuNfWoMLsc="
Cancel-Lock: sha1:CvYs0xdObiGxA0MklZHot1AIioU=
 by: Borax Man - Mon, 4 Dec 2023 07:10 UTC

On 3 Dec 2023 16:43:39 GMT
Tavis Ormandy <taviso@nospicedham.gmail.com> wrote:

> On 2023-12-03, Borax Man wrote:
> > On 2023-12-02, Tavis Ormandy <taviso@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).

Re: Debugger problems

<ukkf3m$3dbv4$2@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=885&group=comp.lang.asm.x86#885

  copy link   Newsgroups: comp.lang.asm.x86
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rotflol2@nospicedham.hotmail.com (Borax Man)
Newsgroups: comp.lang.asm.x86
Subject: Re: Debugger problems
Date: Mon, 4 Dec 2023 12:01:58 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 34
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <ukkf3m$3dbv4$2@dont-email.me>
References: <fa661ff7-9381-4a32-9802-3d4691627145n@googlegroups.com>
<ksvc0sFdtc9U1@mid.individual.net> <ukesnb$2a8g9$1@dont-email.me>
<kt18crF1b8hU1@mid.individual.net> <ukhhrg$2q0aj$3@dont-email.me>
<kt3phrFlp8jU1@mid.individual.net> <20231204181048.43ae1234@hotmail.com>
Injection-Info: dont-email.me; posting-host="0fcebba557738de5d81934eba72108d9";
logging-data="3589242"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fp3hip3rgu6H8+8FbjcYA3ScUQCL2X2w="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:Ns4YMc54W/vY0jliLXeRPLr0vpo=
 by: Borax Man - Mon, 4 Dec 2023 12:01 UTC

On 2023-12-04, Borax Man <rotflol2@nospicedham.hotmail.com> wrote:
> On 3 Dec 2023 16:43:39 GMT
> Tavis Ormandy <taviso@nospicedham.gmail.com> wrote:
>
>> On 2023-12-03, Borax Man wrote:
>> > On 2023-12-02, Tavis Ormandy <taviso@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.

Re: Debugger problems

<2c613631-1ad7-4722-9a6d-e3aa7990cb3bn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=886&group=comp.lang.asm.x86#886

  copy link   Newsgroups: comp.lang.asm.x86
Path: i2pn2.org!rocksolid2!news.neodome.net!news.ortolo.eu!news.gegeweb.eu!gegeweb.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: martijnm.bos@nospicedham.gmail.com (Martijn Bos)
Newsgroups: comp.lang.asm.x86
Subject: Re: Debugger problems
Date: Wed, 6 Dec 2023 03:55:18 -0800 (PST)
Organization: A noiseless patient Spider
Lines: 77
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <2c613631-1ad7-4722-9a6d-e3aa7990cb3bn@googlegroups.com>
References: <fa661ff7-9381-4a32-9802-3d4691627145n@googlegroups.com>
<ksvc0sFdtc9U1@mid.individual.net> <ukesnb$2a8g9$1@dont-email.me>
<kt18crF1b8hU1@mid.individual.net> <ukhhrg$2q0aj$3@dont-email.me>
<kt3phrFlp8jU1@mid.individual.net> <20231204181048.43ae1234@hotmail.com> <ukkf3m$3dbv4$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Date: Wed, 06 Dec 2023 11:55:18 +0000
Injection-Info: dont-email.me; posting-host="9dbccc17cff6988e31646ff7f9931410";
logging-data="805826"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18d5SVbmwtEFv0vbT5WM5bTI886AMa2wHY="
User-Agent: G2/1.0
Cancel-Lock: sha1:8xhsIVfSqINyOX++X4WdLUB3t2M=
 by: Martijn Bos - Wed, 6 Dec 2023 11:55 UTC

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.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor