User forums > General (but related to Code::Blocks)

Breakpoints in assembly code

<< < (2/4) > >>

druizm:
I answer you between lines...

--> This probably means that you nasm compiler has failed to generate a proper frame info for your asm function or something similar.
How can I know if nasm has compiled my assembler code correctly?

--> Does stepping using the instruction commands?
Well, in Dissassembly window I can see assembler generated code from my binary. Also, I can mark "Mixed Mode" that allows me check dissassembly assembler code and C source code (from my source C file). But if my breakpoint is inside my asm file, step-by-step doesn't jump to asm code, so F7 executes correctly each line from my asm code but breakpoint mark stills at C file. So I can debug each of my asm code.

--> Does breaking on an address works?
Mmm, not. I have added breakpoints asm function start point (in asm file) and, also, I have added some breakpoints in "mov" or "jmp" instructions, but F7 still remains at line in C file from I call my asm function.

oBFusCATed:
Try something simple:
1. Put a breakpoint on the line calling your asm function in C
2. Start debugger and wait it to hit the breakpoint
3. Use the Debug -> Step into instruction command

What happens at 3? What is the code generated from your asm code? If the code is inline the behaviour is expected.

Krice:

--- Quote from: druizm on May 10, 2019, 01:40:10 pm ---but NOT ENTER into the asm file.
--- End quote ---

It's possible the C debugger treats assembler parts as a single "line" of C code.

druizm:

--- Quote from: oBFusCATed on May 14, 2019, 07:08:14 pm ---Try something simple:
1. Put a breakpoint on the line calling your asm function in C
2. Start debugger and wait it to hit the breakpoint
3. Use the Debug -> Step into instruction command

What happens at 3? What is the code generated from your asm code? If the code is inline the behaviour is expected.

--- End quote ---

At 3, code generated from my asm code (in Dissassembly view) is 99.99% like mine (some registers have changed name)... So, is it normal? I suppose that... but my problem persists: I can't apply a breakpoint directly in the asm code (I only can in the line calling my asm function from C)

druizm:

--- Quote from: Krice on May 16, 2019, 11:00:51 am ---
--- Quote from: druizm on May 10, 2019, 01:40:10 pm ---but NOT ENTER into the asm file.
--- End quote ---

It's possible the C debugger treats assembler parts as a single "line" of C code.

--- End quote ---

Uppps, so... is there no solution?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version