List actual code around more than one location
authorZhouyi Zhou <zhouzhouyi@gmail.com>
Tue, 22 Aug 2017 14:32:19 +0000 (15:32 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 22 Aug 2017 14:32:19 +0000 (15:32 +0100)
commit0d999a6ef0f98b22430d70951408869864c979e0
treed52c4e826f32083f59cb7675e34a0336e734d1ae
parent329d5e7e56f852dcf9956683be4345c165d277db
List actual code around more than one location

With the following C++ code:
 int bar() { return 0;}
 int bar(int) { return 0; }

GDB behaves as:
 (gdb) list bar
  file: "overload.cc", line number: 1
  file: "overload.cc", line number: 2

It would be better for GDB to list the actual code around those two
locations, not just print the location.  Like:

 (gdb) list bar
 file: "overload.cc", line number: 1
 1       int bar() { return 0;}
 2       int bar(int) { return 0; }
 file: "overload.cc", line number: 2
 1       int bar() { return 0;}
 2       int bar(int) { return 0; }

That's what this this commit implements.

Tested on x86-64 GNU/Linux.

gdb/ChangeLog:
2017-08-22  Zhouyi Zhou  <zhouzhouyi@gmail.com>

* cli-cmds.c (list_commands): List actual code around more than
one location.
gdb/ChangeLog
gdb/cli/cli-cmds.c
This page took 0.025514 seconds and 4 git commands to generate.