It actually is inserted into the map.  Notice the type of bkpt.  It is
actually a *reference* to a pointer.  So, when bkpt is modified, it updates
the location in the map.

  Nate

On Sat Nov 01 2014 at 10:44:53 PM He Hu via gem5-dev <[email protected]>
wrote:

> Hi developers,
> In src/base/remote_gdb.cc, insertHardBreak() inserts a hard breakpoint to
> hardBreakMap. But it does not really insert an object of HardBreakpoint to
> the hardBreakMap.
>
> When the bkpt==0, an object is created but never insert to hardBreakMap. So
> the object will never be deleted.
>
>    557 bool
>    558 BaseRemoteGDB::insertHardBreak(Addr addr, size_t len)
>    559 {
>    560     if (len != sizeof(MachInst))
>    561         panic("invalid length\n");
>    562
>    563     DPRINTF(GDBMisc, "inserting hardware breakpoint at %#x\n",
> addr);
>    564
>    565     HardBreakpoint *&bkpt = hardBreakMap[addr];
>    566     if (bkpt == 0)
>    567         bkpt = new HardBreakpoint(this, addr);
>    568
>    569     bkpt->refcount++;
>    570
>    571     return true;
>    572 }
>
> Regards,
> Hu
>
>
>
> _______________________________________________
> gem5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/gem5-dev
>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to