[Lldb-commits] [PATCH] D126109: [lldb] Fix broken bad-address-breakpoint test

Will Hawkins via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon May 23 10:49:25 PDT 2022


hawkinsw added inline comments.


================
Comment at: lldb/test/API/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py:43
+            if region.GetRegionEnd() > illegal_address:
+                illegal_address = region.GetRegionEnd()
 
----------------
DavidSpickett wrote:
> DavidSpickett wrote:
> > I'm confused as to what the logic is here now.
> > 
> > You:
> > * read from address 0x0 to fill in error
> > * walk the memory regions until the highest one, making the end of that the illegal address
> > * assume that the error value from reading 0x0 is the same as you'd get from this new illegal address
> > ...
> > 
> > Or am I missing something and the ptr was just left in accidentally.
> > 
> > (I would suggest you could jump to the last region in the list straight away but I don't think we actually require them to be sorted, plus sometimes you get multiple regions with the same base)
> > 
> (same base but different end addresses I mean)
Hello! Thank you for the review!

I was initializing `illegal_address` to 0 as a way to, well, initialize the value. I suppose that I could have initialized it to `None` and then used that a special value in the loop. In fact, now that I think about it, that's the tact that I will take in a second version of this patch. 

But, yes, you basically have the rest correct: I walk through all the memory regions and find the highest address. Then, when I have that address (which I know is not in a valid memory region), I will use that as the address to set for the illegal breakpoint.

Does that make sense?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126109/new/

https://reviews.llvm.org/D126109



More information about the lldb-commits mailing list