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]

Comprehending command trace


Hi all,
I 'm tracing the "print <var_name>" command given from the gdb-promt.
I 'm debugging GDB (gdb-arm) with GDB (gdb). I 've a small try.c which
I run in (gdb-arm).
For that ... I 've inserted a breakpoint at lookup_symtab (symtab.c)
Problem :
I 've also got the trace ... but I 'm not able to follow many of the
functions which get called in between. Some are comprehendable like

---------------------------------------------------------------------------------------------------------
<start_log>

#0  lookup_symtab (name=0x8fe750 "a") at ../../gdb-6.5/gdb/symtab.c:158
#1  0x00000000005a0103 in c_lex () at c-exp.y:1750
#2  0x000000000059d076 in c_parse () at c-exp.c.tmp:1441
#3  0x000000000055cb9d in c_preprocess_and_parse () at
../../gdb-6.5/gdb/c-lang.c:472
#4  0x000000000050fe7f in parse_exp_in_context
(stringptr=0x7fbffff228, block=0x0, comma=0, void_context_p=0)
   at ../../gdb-6.5/gdb/parse.c:1108
#5  0x000000000050fd32 in parse_exp_1 (stringptr=0x7fbffff228,
block=0x0, comma=0) at ../../gdb-6.5/gdb/parse.c:1053
#6  0x000000000050ff65 in parse_expression (string=0x88e106 "a") at
../../gdb-6.5/gdb/parse.c:1147
#7  0x00000000004c78bf in print_command_1 (exp=0x88e106 "a",
inspect=0, voidprint=1) at ../../gdb-6.5/gdb/printcmd.c:896
#8  0x00000000004c7a38 in print_command (exp=0x88e106 "a", from_tty=1)
at ../../gdb-6.5/gdb/printcmd.c:942
#9  0x000000000047d480 in do_cfunc (c=0x8bb8e0, args=0x88e106 "a",
from_tty=1) at ../../gdb-6.5/gdb/cli/cli-decode.c:57
#10 0x000000000047fdd4 in cmd_func (cmd=0x8bb8e0, args=0x88e106 "a",
from_tty=1) at ../../gdb-6.5/gdb/cli/cli-decode.c:1631
#11 0x00000000004467d0 in execute_command (p=0x88e106 "a", from_tty=1)
at ../../gdb-6.5/gdb/top.c:452
#12 0x00000000004f4709 in command_handler (command=0x88e100 "print a")
at ../../gdb-6.5/gdb/event-top.c:512
#13 0x00000000004f4f2b in command_line_handler (rl=0x8f1c50
"°\035\217") at ../../gdb-6.5/gdb/event-top.c:797
#14 0x00000000005c9f79 in rl_callback_read_char () at
../../gdb-6.5/readline/callback.c:204
#15 0x00000000004f3db1 in rl_callback_read_char_wrapper
(client_data=0x0) at ../../gdb-6.5/gdb/event-top.c:178
#16 0x00000000004f45cc in stdin_event_handler (error=0,
client_data=0x0) at ../../gdb-6.5/gdb/event-top.c:428
#17 0x00000000004f30ef in handle_file_event (event_file_desc=0) at
../../gdb-6.5/gdb/event-loop.c:730
#18 0x00000000004f27fb in process_event () at ../../gdb-6.5/gdb/event-loop.c:343
#19 0x00000000004f284a in gdb_do_one_event (data=0x0) at
../../gdb-6.5/gdb/event-loop.c:380
#20 0x00000000004ef935 in catch_errors (func=0x4f2810
<gdb_do_one_event>, func_args=0x0, errstring=0x683dd3 "", mask=6)
   at ../../gdb-6.5/gdb/exceptions.c:515
#21 0x000000000048e4d1 in tui_command_loop (data=0x0) at
../../gdb-6.5/gdb/tui/tui-interp.c:151
#22 0x00000000004efe7f in current_interp_command_loop () at
../../gdb-6.5/gdb/interps.c:278
#23 0x000000000043ff55 in captured_command_loop (data=0x0) at
../../gdb-6.5/gdb/main.c:101
#24 0x00000000004ef935 in catch_errors (func=0x43ff44
<captured_command_loop>, func_args=0x0, errstring=0x66dd5d "", mask=6)
   at ../../gdb-6.5/gdb/exceptions.c:515
#25 0x0000000000440e8c in captured_main (data=0x7fbffff8b0) at
../../gdb-6.5/gdb/main.c:836
#26 0x00000000004ef935 in catch_errors (func=0x43ff84 <captured_main>,
func_args=0x7fbffff8b0, errstring=0x66dd5d "", mask=6)
   at ../../gdb-6.5/gdb/exceptions.c:515
#27 0x0000000000440ebf in gdb_main (args=0x7fbffff8b0) at
../../gdb-6.5/gdb/main.c:845
#28 0x000000000043ff40 in main (argc=1, argv=0x7fbffff9b8) at
../../gdb-6.5/gdb/gdb.c:35

<end_log>

Could anyone please give a 1-line description of these functions (Just
what the functions does and gives out) OR any pointers in this regard.
eg. I 'm not able to comprehend gdb_main().
Actually I 'm tracing many other commands ... so would like if someone
could give pointers as to comprehending these functions.

2. Which is the loop which is responsible for giving the GDB
interpreter prompt.
3. Also ... simple commands like "echo", "pwd" etc. are defined in
cli-cmds.c ... but other system-level commads like "breakpoint" "print
<var_name>" etc. are defined in breakpoint.c What was the reason for
such distinction.

Please help.
Thanks.

Regards,
Rajesh
--
wrr


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