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)
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.
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
P.S., I assume you're the same Tavis who is known for your FVWM
config?
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
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.
P.S., I assume you're the same Tavis who is known for your FVWM
config?
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.
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.
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.
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).
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.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 30:32:35 |
Calls: | 6,707 |
Files: | 12,239 |
Messages: | 5,353,030 |