User forums > Using Code::Blocks

Debugger Scripts - avoiding template matches

(1/1)

nomadwolf:
I'm trying to use the gdb_types script to register a new type, let's say 'foo'
However, I do not want that to match when foo is used within a template type, such as tuple<foo, int, int>

I'm not particularly adept with RegExps, but the scripts that come with C::B would suggest using
[^[:alnum:]_]*foo[^[:alnum:]_]*")
However, that also matches the tuple example above

I essentially don't want to have a < before or a comma after 'foo', which leads me to try
(?<![a-zA-Z0-9<])foo(?![a-zA-Z0-9,])
That doesn't work when I try to use that in the script, but it does work as I expect when I run it through an online RegExp checker.
(i.e. 'foo' should pass, '<foo' shouldn't, nor should 'foo,')

Other option would be
[^a-zA-Z0-9<]+CEID[^a-zA-Z0-9,]+
but that won't match 'foo' by itself.

thoughts & help?

ollydbg:

--- Quote from: nomadwolf on April 30, 2016, 06:16:43 am ---I'm trying to use the gdb_types script to register a new type, let's say 'foo'
...
...
thoughts & help?

--- End quote ---
Hi, welcome to our forum.
I suggest that you can use "GDB python pretty printer" to do the customized print.

nomadwolf:

--- Quote from: ollydbg on April 30, 2016, 03:47:45 pm ---Hi, welcome to our forum.
I suggest that you can use "GDB python pretty printer" to do the customized print.

--- End quote ---

Oooh, that is much more better.  Works for locals, function parameters, and sub-types.  Thanks!
Now I just have to learn some basic python...

oBFusCATed:
Yep, the original debug scripts will be as soon as I find some time to do it.

Navigation

[0] Message Index

Go to full version