This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

"info break" output for handwritten assembler code


If I compile the file hello.s below, with

as -g -o hello.o hello.s
ld -g -o hello hello.o

set a breakpoint at line 14 ("break _start" doesn't work for some reason)
and run under GDB 6.6.50, then I get:


(gdb) frame
#0  _start () at lxf.s:14
14              mov $14, %edx


(gdb) info break
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x08048083 lxf.s:14
        breakpoint already hit 1 time


The GDB command "frame" uses print_frame which finds _start () while 
"info break" checks for
find_pc_sect_function (b->loc->address, b->loc->section) and then prints
SYMBOL_PRINT_NAME of the return value if it's not NULL.

Shouldn't info break follow frame's approach to give:

(gdb) info break
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x08048083 in _start () at lxf.s:14
        breakpoint already hit 1 time

?

I'm thinking that this is important for consistent MI output too.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


.section .data
	.globl _start

message:
	.string "Hello World!\n"

.section .text
	.global _start

_start:
	mov $4, %eax 		/* OS call to print string */
	mov $1, %ebx		/* Print to stdout */
	mov $message, %ecx
	mov $14, %edx
	call _syscall	


	mov $1, %eax		/* OS call to end app */
	mov $0, %ebx
	call _syscall	

_syscall:
	int $0x80
	ret


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]