This is the mail archive of the gdb-patches@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]

Re: [RFC] reviving 'catch syscall' for gdbserver


On Fri, 2015-09-18 at 17:42 -0700, Josh Stone wrote:
> On 09/15/2015 03:01 PM, Philippe Waroquiers wrote:
> > On Fri, 2015-09-11 at 18:44 -0700, Josh Stone wrote:
> What about relying on the current target, and use Hg switching?  Or is
> it more common for new commands to have an explicit pid?  It doesn't
> look like many q packets have a pid, even though many have an action
> specific to one target.
Yes, that will work, and is effectively used for many
operations/packets.

Note that as far as I can see, gdb + gdbserver + multiple arch
inferiors + breakpoints seems somewhat broken.

E.g. I tried 7.10 gdb+gdbserver --multi, with 2 inferiors
of different archs : x86 (badseg) and amd64 (trivialleak).
The way breakpoints are handled seems buggy to me.
E.g. at some point, I had:
  (gdb) info break
  Num     Type           Disp Enb Address            What
  2       breakpoint     keep y   0x080484f9         in main at badseg.c:13 inf 2
  3       breakpoint     keep y   0x000000000040053a in main at trivialleak.c:11 inf 1
(breakpoints set using *0x....)

So, a breakpoint for 'inf 2' and a breakpoint for 'inf 1'.
Then when doing run, gdb reported:
  Warning:
  Cannot insert breakpoint 2.
  Cannot access memory at address 0x80484f9
So, GDB (wronly IMO) tried to insert a breakpoint aimed at the x86 inferior
in the amd64 inferior.

Same problem when running the x86 target: it could not insert the amd64 breakpoint.
What is even more strange is that after that, the info breakpoints gives:
  (gdb) info break
  Num     Type           Disp Enb Address            What
  2       breakpoint     keep y   0x080484f9         in main at badseg.c:13 inf 2
  3       breakpoint     keep y   0x000000000040053a  inf 2
So, the breakpoint 3 'was lost' for inferior 1, and was 'transferred' to inferior 2.

I also searched for the regexp 'inf [0-9]' in the doc, and could
not find anything. The description for 'What' in the manual of 'info breakpoints'
does only describe file/line number.
So, this 'inf x' in info breakpoint seems not documented.
More generally, I could not find a description of the behaviour of breakpoints
with multiple inferiors and/or multiple archs inferior.

The doc only says: "Many commands will work the same with multiple programs as with a
single program ..."
No more details found.

Philippe



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